1 package org.apache.maven.tools.plugin; 2 3 /* 4 * Licensed to the Apache Software Foundation (ASF) under one 5 * or more contributor license agreements. See the NOTICE file 6 * distributed with this work for additional information 7 * regarding copyright ownership. The ASF licenses this file 8 * to you under the Apache License, Version 2.0 (the 9 * "License"); you may not use this file except in compliance 10 * with the License. You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, 15 * software distributed under the License is distributed on an 16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 * KIND, either express or implied. See the License for the 18 * specific language governing permissions and limitations 19 * under the License. 20 */ 21 22 import org.apache.maven.plugin.descriptor.MojoDescriptor; 23 import org.apache.maven.plugin.descriptor.Parameter; 24 25 /** 26 * Extensions to MojoDescriptor added to Maven 3, then are not available when run under Maven2. 27 * @author Kristian Rosenvold 28 */ 29 public class ExtendedMojoDescriptor 30 extends MojoDescriptor 31 { 32 private final boolean containsXhtmlTextValues; 33 34 private boolean threadSafe = false; 35 36 private String requiresDependencyCollection = null; 37 38 public ExtendedMojoDescriptor() 39 { 40 this( false ); 41 } 42 43 /** 44 * @param containsXhtmlTextValues 45 * @since 3.7.0 46 */ 47 public ExtendedMojoDescriptor( boolean containsXhtmlTextValues ) 48 { 49 this.containsXhtmlTextValues = containsXhtmlTextValues; 50 } 51 52 @Override 53 public boolean isThreadSafe() 54 { 55 return threadSafe; 56 } 57 58 @Override 59 public void setThreadSafe( boolean threadSafe ) 60 { 61 this.threadSafe = threadSafe; 62 } 63 64 @Override 65 public String getDependencyCollectionRequired() 66 { 67 return requiresDependencyCollection; 68 } 69 70 @Override 71 public void setDependencyCollectionRequired( String requiresDependencyCollection ) 72 { 73 this.requiresDependencyCollection = requiresDependencyCollection; 74 } 75 76 /** 77 * Indicates if the methods {@link #getDescription()}, {@link #getDeprecated()}, {@link Parameter#getDescription()} 78 * and {@link Parameter#getDeprecated()} return XHTML values. 79 * @return {@code true} if aforementioned methods return XHTML values, if {@code false} those values contain 80 * javadoc (HTML + custom javadoc tags) (for legacy extractors) 81 * @since 3.7.0 82 */ 83 public boolean containsXhtmlTextValues() 84 { 85 return containsXhtmlTextValues; 86 } 87 }