本文整理匯總了Java中org.eclipse.jdt.core.dom.AST.newTypeDeclaration方法的典型用法代碼示例。如果您正苦於以下問題:Java AST.newTypeDeclaration方法的具體用法?Java AST.newTypeDeclaration怎麽用?Java AST.newTypeDeclaration使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jdt.core.dom.AST
的用法示例。
在下文中一共展示了AST.newTypeDeclaration方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createBuilderClass
import org.eclipse.jdt.core.dom.AST; //導入方法依賴的package包/類
public TypeDeclaration createBuilderClass(AST ast, TypeDeclaration originalType) {
TypeDeclaration builderType = ast.newTypeDeclaration();
builderType.setName(ast.newSimpleName(getBuilderName(originalType)));
if (preferencesManager.getPreferenceValue(ADD_GENERATED_ANNOTATION)) {
generatedAnnotationPopulator.addGeneratedAnnotation(ast, builderType);
}
builderType.modifiers().add(ast.newModifier(ModifierKeyword.PUBLIC_KEYWORD));
builderType.modifiers().add(ast.newModifier(ModifierKeyword.STATIC_KEYWORD));
builderType.modifiers().add(ast.newModifier(ModifierKeyword.FINAL_KEYWORD));
if (preferencesManager.getPreferenceValue(GENERATE_JAVADOC_ON_BUILDER_CLASS)) {
Javadoc javadoc = javadocGenerator.generateJavadoc(ast, String.format(Locale.ENGLISH, "Builder to build {@link %s}.", originalType.getName().toString()),
Collections.emptyMap());
builderType.setJavadoc(javadoc);
}
return builderType;
}
示例2: createStageBuilderInterface
import org.eclipse.jdt.core.dom.AST; //導入方法依賴的package包/類
public TypeDeclaration createStageBuilderInterface(AST ast, String interfaceName) {
TypeDeclaration addedInterface = ast.newTypeDeclaration();
addedInterface.setInterface(true);
addedInterface.setName(ast.newSimpleName(interfaceName));
addedInterface.modifiers().add(ast.newModifier(ModifierKeyword.PUBLIC_KEYWORD));
javadocAdder.addJavadocForStagedInterface(ast, interfaceName, addedInterface);
return addedInterface;
}
開發者ID:helospark,項目名稱:SparkBuilderGenerator,代碼行數:9,代碼來源:StagedBuilderInterfaceTypeDefinitionCreatorFragment.java