@Override public boolean visit(TypeDeclaration node) { push(node.isInterface() ? JavaNode.INTERFACE : JavaNode.CLASS, node.getName().toString(), node.getStartPosition(), node.getLength()); return true; }
typeRefService.createTypeReference(fileModel, TypeReferenceLocation.TYPE, cu.getLineNumber(typeDeclaration.getStartPosition()), cu.getColumnNumber(cu.getStartPosition()), cu.getLength(), this.fqcn);
public boolean visit(TypeDeclaration node) { push(node.isInterface() ? JavaNode.INTERFACE : JavaNode.CLASS, node.getName().toString(), node.getStartPosition(), node.getLength()); return true; }
@Override public boolean visit(TypeDeclaration node) { push(node.isInterface() ? JavaNode.INTERFACE : JavaNode.CLASS, node.getName().toString(), node.getStartPosition(), node.getLength()); return true; }
@Override public boolean visit(TypeDeclaration node) { if (method == null && node.isLocalTypeDeclaration()) { ITypeBinding binding = node.resolveBinding(); String binaryName = binding.getBinaryName(); if (type.getName().endsWith(binaryName)) { try { IJavaElement element = jtype.getCompilationUnit().getElementAt(node.getStartPosition()); if (element.getElementType() == IJavaElement.TYPE) { IType ltype = (IType) element; IJavaElement parent = ltype.getParent(); if (parent.getElementType() == IJavaElement.METHOD) { method = (IMethod) parent; } } } catch (JavaModelException jme) { ApiPlugin.log(jme); } return false; } } return true; } }
if (binding == null) { logNullBinding("type declaration", node.getName(), ((CompilationUnit) node.getRoot()).getLineNumber(node.getStartPosition())); return false;
private FieldDeclaration createParameterObjectField(ParameterObjectFactory pof, TypeDeclaration typeNode, int modifier) { AST ast= fBaseCURewrite.getAST(); ClassInstanceCreation creation= ast.newClassInstanceCreation(); creation.setType(pof.createType(fDescriptor.isCreateTopLevel(), fBaseCURewrite, typeNode.getStartPosition())); ListRewrite listRewrite= fBaseCURewrite.getASTRewrite().getListRewrite(creation, ClassInstanceCreation.ARGUMENTS_PROPERTY); for (Iterator<FieldInfo> iter= fVariables.values().iterator(); iter.hasNext();) { fieldDeclaration.setType(pof.createType(fDescriptor.isCreateTopLevel(), fBaseCURewrite, typeNode.getStartPosition())); if (acc != null) fieldDeclaration.modifiers().add(ast.newModifier(acc));
@Override public boolean visit(TypeDeclaration node) { // enums and annotations can't be local if (node.getStartPosition() <= typeRange.getOffset()) { return true; if (node.getStartPosition() > typeRange.getOffset() + typeRange.getLength()) { return true;
ASTNode clone0(AST target) { TypeDeclaration result = new TypeDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); result.setJavadoc( (Javadoc) ASTNode.copySubtree(target, getJavadoc())); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { result.internalSetModifiers(getModifiers()); result.setSuperclass( (Name) ASTNode.copySubtree(target, getSuperclass())); result.superInterfaces().addAll( ASTNode.copySubtrees(target, superInterfaces())); } result.setInterface(isInterface()); result.setName((SimpleName) getName().clone(target)); if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); result.typeParameters().addAll( ASTNode.copySubtrees(target, typeParameters())); result.setSuperclassType( (Type) ASTNode.copySubtree(target, getSuperclassType())); result.superInterfaceTypes().addAll( ASTNode.copySubtrees(target, superInterfaceTypes())); } result.bodyDeclarations().addAll( ASTNode.copySubtrees(target, bodyDeclarations())); return result; }
private FieldDeclaration createParameterObjectField(ParameterObjectFactory pof, TypeDeclaration typeNode, int modifier) { AST ast= fBaseCURewrite.getAST(); ClassInstanceCreation creation= ast.newClassInstanceCreation(); creation.setType(pof.createType(fDescriptor.isCreateTopLevel(), fBaseCURewrite, typeNode.getStartPosition())); ListRewrite listRewrite= fBaseCURewrite.getASTRewrite().getListRewrite(creation, ClassInstanceCreation.ARGUMENTS_PROPERTY); for (Iterator<FieldInfo> iter= fVariables.values().iterator(); iter.hasNext();) { fieldDeclaration.setType(pof.createType(fDescriptor.isCreateTopLevel(), fBaseCURewrite, typeNode.getStartPosition())); if (acc != null) fieldDeclaration.modifiers().add(ast.newModifier(acc));
@Override public boolean visit(TypeDeclaration node){ // enums and annotations can't be local if (node.getStartPosition() <= typeRange.getOffset()) return true; if (node.getStartPosition() > typeRange.getOffset() + typeRange.getLength()) return true;
ASTNode clone0(AST target) { TypeDeclaration result = new TypeDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); result.setJavadoc( (Javadoc) ASTNode.copySubtree(target, getJavadoc())); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { result.internalSetModifiers(getModifiers()); result.setSuperclass( (Name) ASTNode.copySubtree(target, getSuperclass())); result.superInterfaces().addAll( ASTNode.copySubtrees(target, superInterfaces())); } result.setInterface(isInterface()); result.setName((SimpleName) getName().clone(target)); if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); result.typeParameters().addAll( ASTNode.copySubtrees(target, typeParameters())); result.setSuperclassType( (Type) ASTNode.copySubtree(target, getSuperclassType())); result.superInterfaceTypes().addAll( ASTNode.copySubtrees(target, superInterfaceTypes())); } result.bodyDeclarations().addAll( ASTNode.copySubtrees(target, bodyDeclarations())); return result; }
ASTNode clone0(AST target) { TypeDeclaration result = new TypeDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); result.setJavadoc( (Javadoc) ASTNode.copySubtree(target, getJavadoc())); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { result.internalSetModifiers(getModifiers()); result.setSuperclass( (Name) ASTNode.copySubtree(target, getSuperclass())); result.superInterfaces().addAll( ASTNode.copySubtrees(target, superInterfaces())); } result.setInterface(isInterface()); result.setName((SimpleName) getName().clone(target)); if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); result.typeParameters().addAll( ASTNode.copySubtrees(target, typeParameters())); result.setSuperclassType( (Type) ASTNode.copySubtree(target, getSuperclassType())); result.superInterfaceTypes().addAll( ASTNode.copySubtrees(target, superInterfaceTypes())); } result.bodyDeclarations().addAll( ASTNode.copySubtrees(target, bodyDeclarations())); return result; }
@Override ASTNode clone0(AST target) { TypeDeclaration result = new TypeDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); result.setJavadoc( (Javadoc) ASTNode.copySubtree(target, getJavadoc())); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { result.internalSetModifiers(getModifiers()); result.setSuperclass( (Name) ASTNode.copySubtree(target, getSuperclass())); result.superInterfaces().addAll( ASTNode.copySubtrees(target, superInterfaces())); } result.setInterface(isInterface()); result.setName((SimpleName) getName().clone(target)); if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); result.typeParameters().addAll( ASTNode.copySubtrees(target, typeParameters())); result.setSuperclassType( (Type) ASTNode.copySubtree(target, getSuperclassType())); result.superInterfaceTypes().addAll( ASTNode.copySubtrees(target, superInterfaceTypes())); } result.bodyDeclarations().addAll( ASTNode.copySubtrees(target, bodyDeclarations())); return result; }
ASTNode clone0(AST target) { TypeDeclaration result = new TypeDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); result.setJavadoc( (Javadoc) ASTNode.copySubtree(target, getJavadoc())); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { result.internalSetModifiers(getModifiers()); result.setSuperclass( (Name) ASTNode.copySubtree(target, getSuperclass())); result.superInterfaces().addAll( ASTNode.copySubtrees(target, superInterfaces())); } result.setInterface(isInterface()); result.setName((SimpleName) getName().clone(target)); if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); result.typeParameters().addAll( ASTNode.copySubtrees(target, typeParameters())); result.setSuperclassType( (Type) ASTNode.copySubtree(target, getSuperclassType())); result.superInterfaceTypes().addAll( ASTNode.copySubtrees(target, superInterfaceTypes())); } result.bodyDeclarations().addAll( ASTNode.copySubtrees(target, bodyDeclarations())); return result; }
ASTNode clone0(AST target) { TypeDeclaration result = new TypeDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); result.setJavadoc( (Javadoc) ASTNode.copySubtree(target, getJavadoc())); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { result.internalSetModifiers(getModifiers()); result.setSuperclass( (Name) ASTNode.copySubtree(target, getSuperclass())); result.superInterfaces().addAll( ASTNode.copySubtrees(target, superInterfaces())); } result.setInterface(isInterface()); result.setName((SimpleName) getName().clone(target)); if (this.ast.apiLevel >= AST.JLS3) { result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); result.typeParameters().addAll( ASTNode.copySubtrees(target, typeParameters())); result.setSuperclassType( (Type) ASTNode.copySubtree(target, getSuperclassType())); result.superInterfaceTypes().addAll( ASTNode.copySubtrees(target, superInterfaceTypes())); } result.bodyDeclarations().addAll( ASTNode.copySubtrees(target, bodyDeclarations())); return result; }
public boolean visit(TypeDeclaration node){ // enums and annotations can't be local if (node.getStartPosition() <= typeRange.getOffset()) return true; if (node.getStartPosition() > typeRange.getOffset() + typeRange.getLength()) return true;
@Override public boolean visit(TypeDeclaration node){ // enums and annotations can't be local if (node.getStartPosition() <= typeRange.getOffset()) return true; if (node.getStartPosition() > typeRange.getOffset() + typeRange.getLength()) return true;
try { int typeToken= isInterface ? TerminalTokens.TokenNameinterface : TerminalTokens.TokenNameclass; int startPosition = node.getStartPosition(); if (!isJLS2) { List modifiers = node.modifiers(); int startIndent= getIndent(node.getStartPosition()) + 1; int startPos= getPosAfterLeftBrace(pos); rewriteParagraphList(node, TypeDeclaration.BODY_DECLARATIONS_PROPERTY, startPos, startIndent, -1, 2);
case AST.JLS2_INTERNAL : TypeDeclaration typeDecl = typeDeclarationStatement.internalGetTypeDeclaration(); typeDeclarationStatement.setSourceRange(typeDecl.getStartPosition(), typeDecl.getLength()); break; default :