本文整理汇总了Java中org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse方法的典型用法代码示例。如果您正苦于以下问题:Java TypeDeclaration.traverse方法的具体用法?Java TypeDeclaration.traverse怎么用?Java TypeDeclaration.traverse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.internal.compiler.ast.TypeDeclaration
的用法示例。
在下文中一共展示了TypeDeclaration.traverse方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: format
import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; //导入方法依赖的package包/类
private void format(
TypeDeclaration memberTypeDeclaration,
ClassScope scope,
boolean isChunkStart,
boolean isFirstClassBodyDeclaration) {
if (isFirstClassBodyDeclaration) {
int newLinesBeforeFirstClassBodyDeclaration = this.preferences.blank_lines_before_first_class_body_declaration;
if (newLinesBeforeFirstClassBodyDeclaration > 0) {
this.scribe.printEmptyLines(newLinesBeforeFirstClassBodyDeclaration);
}
} else {
int newLineBeforeChunk = isChunkStart ? this.preferences.blank_lines_before_new_chunk : 0;
if (newLineBeforeChunk > 0) {
this.scribe.printEmptyLines(newLineBeforeChunk);
}
final int newLinesBeforeMember = this.preferences.blank_lines_before_member_type;
if (newLinesBeforeMember > 0) {
this.scribe.printEmptyLines(newLinesBeforeMember);
}
}
memberTypeDeclaration.traverse(this, scope);
}
示例2: makeBuilderClass
import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; //导入方法依赖的package包/类
public EclipseNode makeBuilderClass(boolean isStatic, EclipseNode tdParent, String builderClassName, TypeParameter[] typeParams, ASTNode source) {
TypeDeclaration parent = (TypeDeclaration) tdParent.get();
TypeDeclaration builder = new TypeDeclaration(parent.compilationResult);
builder.bits |= Eclipse.ECLIPSE_DO_NOT_TOUCH_FLAG;
builder.modifiers |= ClassFileConstants.AccPublic;
if (isStatic) builder.modifiers |= ClassFileConstants.AccStatic;
builder.typeParameters = copyTypeParams(typeParams, source);
builder.name = builderClassName.toCharArray();
builder.traverse(new SetGeneratedByVisitor(source), (ClassScope) null);
return injectType(tdParent, builder);
}
示例3: makeBuilderClass
import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; //导入方法依赖的package包/类
public EclipseNode makeBuilderClass(EclipseNode tdParent, String builderClassName, TypeParameter[] typeParams, ASTNode source) {
TypeDeclaration parent = (TypeDeclaration) tdParent.get();
TypeDeclaration builder = new TypeDeclaration(parent.compilationResult);
builder.bits |= Eclipse.ECLIPSE_DO_NOT_TOUCH_FLAG;
builder.modifiers |= ClassFileConstants.AccPublic | ClassFileConstants.AccStatic;
builder.typeParameters = copyTypeParams(typeParams, source);
builder.name = builderClassName.toCharArray();
builder.traverse(new SetGeneratedByVisitor(source), (ClassScope) null);
return injectType(tdParent, builder);
}