本文整理汇总了Java中org.eclipse.jdt.core.dom.TypeDeclaration.setName方法的典型用法代码示例。如果您正苦于以下问题:Java TypeDeclaration.setName方法的具体用法?Java TypeDeclaration.setName怎么用?Java TypeDeclaration.setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.core.dom.TypeDeclaration
的用法示例。
在下文中一共展示了TypeDeclaration.setName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createBuilderClass
import org.eclipse.jdt.core.dom.TypeDeclaration; //导入方法依赖的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.TypeDeclaration; //导入方法依赖的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