001package org.apache.maven.tools.plugin;
002
003/*
004 * Licensed to the Apache Software Foundation (ASF) under one
005 * or more contributor license agreements.  See the NOTICE file
006 * distributed with this work for additional information
007 * regarding copyright ownership.  The ASF licenses this file
008 * to you under the Apache License, Version 2.0 (the
009 * "License"); you may not use this file except in compliance
010 * with the License.  You may obtain a copy of the License at
011 *
012 *  http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing,
015 * software distributed under the License is distributed on an
016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017 * KIND, either express or implied.  See the License for the
018 * specific language governing permissions and limitations
019 * under the License.
020 */
021
022import org.apache.maven.plugin.descriptor.MojoDescriptor;
023import org.apache.maven.plugin.descriptor.Parameter;
024
025/**
026 * Extensions to MojoDescriptor added to Maven 3, then are not available when run under Maven2.
027 * @author Kristian Rosenvold
028 */
029public class ExtendedMojoDescriptor
030    extends MojoDescriptor
031{
032    private final boolean containsXhtmlTextValues;
033
034    private boolean threadSafe = false;
035
036    private String requiresDependencyCollection = null;
037
038    public ExtendedMojoDescriptor()
039    {
040        this( false );
041    }
042
043    /**
044     * @param containsXhtmlTextValues
045     * @since 3.7.0
046     */
047    public ExtendedMojoDescriptor( boolean containsXhtmlTextValues )
048    {
049        this.containsXhtmlTextValues = containsXhtmlTextValues;
050    }
051
052    @Override
053    public boolean isThreadSafe()
054    {
055        return threadSafe;
056    }
057
058    @Override
059    public void setThreadSafe( boolean threadSafe )
060    {
061        this.threadSafe = threadSafe;
062    }
063
064    @Override
065    public String getDependencyCollectionRequired()
066    {
067        return requiresDependencyCollection;
068    }
069
070    @Override
071    public void setDependencyCollectionRequired( String requiresDependencyCollection )
072    {
073        this.requiresDependencyCollection = requiresDependencyCollection;
074    }
075    
076    /**
077     * Indicates if the methods {@link #getDescription()}, {@link #getDeprecated()}, {@link Parameter#getDescription()}
078     * and {@link Parameter#getDeprecated()} return XHTML values.
079     * @return {@code true} if aforementioned methods return XHTML values, if {@code false} those values contain
080     * javadoc (HTML + custom javadoc tags) (for legacy extractors)
081     * @since 3.7.0
082     */
083    public boolean containsXhtmlTextValues()
084    {
085        return containsXhtmlTextValues;
086    }
087}