本文整理匯總了Java中org.apache.maven.plugins.annotations.Parameter類的典型用法代碼示例。如果您正苦於以下問題:Java Parameter類的具體用法?Java Parameter怎麽用?Java Parameter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Parameter類屬於org.apache.maven.plugins.annotations包,在下文中一共展示了Parameter類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: processTypeFields
import org.apache.maven.plugins.annotations.Parameter; //導入依賴的package包/類
private void processTypeFields(TypeElement type, MojoDescriptor descriptor) {
// non-static fields
for (Element member : type.getEnclosedElements()) {
if (member instanceof VariableElement) {
Parameter parameter = member.getAnnotation(Parameter.class);
Component component = member.getAnnotation(Component.class);
if (parameter != null && component != null) {
// TODO error marker
}
if (parameter != null) {
descriptor.addParameter(toParameterDescriptor((VariableElement) member, parameter));
} else if (component != null) {
descriptor.addRequirement(toComponentDescriptor((VariableElement) member, component));
}
}
}
}
示例2: toParameterDescriptor
import org.apache.maven.plugins.annotations.Parameter; //導入依賴的package包/類
private MojoParameter toParameterDescriptor(VariableElement field, Parameter parameter) {
MojoParameter result = new MojoParameter();
result.setName(field.getSimpleName().toString());
if (!isEmpty(parameter.alias())) {
result.setAlias(parameter.alias());
}
if (!isEmpty(parameter.defaultValue())) {
result.setDefaultValue(parameter.defaultValue());
}
if (!isEmpty(parameter.property())) {
result.setExpression("${" + parameter.property() + "}");
}
result.setEditable(!parameter.readonly());
result.setRequired(parameter.required());
result.setType(getTypeString(field.asType()));
result.setDescription(getDescription(field));
return result;
}
示例3: getAnnotatedTypes
import org.apache.maven.plugins.annotations.Parameter; //導入依賴的package包/類
private Set<TypeElement> getAnnotatedTypes(RoundEnvironment roundEnv) {
Set<TypeElement> types = new HashSet<>();
roundEnv.getElementsAnnotatedWith(Mojo.class).forEach(type -> types.add((TypeElement) type));
addAnnotatedMembers(types, roundEnv, Parameter.class);
addAnnotatedMembers(types, roundEnv, Component.class);
return types;
}
示例4: getSupportedAnnotationTypes
import org.apache.maven.plugins.annotations.Parameter; //導入依賴的package包/類
@Override
public Set<String> getSupportedAnnotationTypes() {
Set<String> types = new HashSet<>();
types.add(Mojo.class.getName());
types.add(Parameter.class.getName());
types.add(Component.class.getName());
return types;
}