public static org.eclipse.jdt.core.dom.AbstractTypeDeclaration findTypeDeclaration(IType searchType, List<?> nodes) { for (Object object : nodes) { if (object instanceof org.eclipse.jdt.core.dom.AbstractTypeDeclaration) { org.eclipse.jdt.core.dom.AbstractTypeDeclaration typeDeclaration = (org.eclipse.jdt.core.dom.AbstractTypeDeclaration) object; if (typeDeclaration.getName().toString().equals(searchType.getElementName())) return typeDeclaration; } } return null; }
if (declaration instanceof org.eclipse.jdt.core.dom.MethodDeclaration) { org.eclipse.jdt.core.dom.MethodDeclaration methodDeclaration = (org.eclipse.jdt.core.dom.MethodDeclaration) declaration; if (methodDeclaration.getName().toString().equals(methodName)) { return methodDeclaration;
@Override public String getName() { return member.getName().toString(); }
@Override public String getName() { SimpleName name = param.getName(); if (name != null) { return name.toString(); } return ""; }
private String getSignature(AnnotationTypeMemberDeclaration node) { StringBuffer buffer= new StringBuffer(); buffer.append(node.getName().toString()); buffer.append('('); buffer.append(')'); return buffer.toString(); }
@Override public String getName() { SimpleName name = param.getName(); if (name != null) { return name.toString(); } return ""; }
@Override public String getName() { return member.getName().toString(); }
private String getSignature(AnnotationTypeMemberDeclaration node) { StringBuilder buffer= new StringBuilder(); buffer.append(node.getName().toString()); buffer.append('('); buffer.append(')'); return buffer.toString(); }
@Override public boolean visit( MethodDeclaration node ) { examples.addAll( extractExamples( imports, classPkg.get(), className.get(), node.getName().toString(), node ) ); return true; }
@Override public boolean visit( TypeDeclaration node ) { if( className.get() == null ) { className.set( node.getName().getIdentifier().toString() ); } examples.addAll( extractExamples( imports, classPkg.get(), className.get(), node.getName().toString() + " classdoc", node ) ); return true; } };
private String getFieldName(VariableDeclarationFragment node) { StringBuffer buffer= new StringBuffer(); buffer.append(node.getName().toString()); ASTNode parent= node.getParent(); if (parent instanceof FieldDeclaration) { FieldDeclaration fd= (FieldDeclaration) parent; buffer.append(" : "); //$NON-NLS-1$ buffer.append(getType(fd.getType())); } return buffer.toString(); }
private String getFieldName(VariableDeclarationFragment node) { StringBuffer buffer= new StringBuffer(); buffer.append(node.getName().toString()); ASTNode parent= node.getParent(); if (parent instanceof FieldDeclaration) { FieldDeclaration fd= (FieldDeclaration) parent; buffer.append(" : "); //$NON-NLS-1$ buffer.append(getType(fd.getType())); } return buffer.toString(); }
private String mappedMethodDeclarationName(MethodDeclaration node) { final String mappedName = mappedMethodName(node); if (null == mappedName || 0 == mappedName.length()|| mappedName.contains(".")) { return methodName(node.getName().toString()); } return mappedName; }
@Override public boolean visit(MethodDeclaration node) { try { // TODO: improve the comparison of the method which is visited and the debug // frame inFrame = (node.getName().toString().equals(fFrame.getMethodName())); } catch (DebugException e) { e.printStackTrace(); } return super.visit(node); }
@Override public boolean visit(BreakStatement node) { pushNode(node, node.getLabel() != null ? node.getLabel().toString() : ""); return false; }
@Override public boolean visit(ContinueStatement node) { pushNode(node, node.getLabel() != null ? node.getLabel().toString() : ""); return false; }
@Override public boolean visit(ContinueStatement node) { pushNode(node, node.getLabel() != null ? node.getLabel().toString() : ""); return false; }
private void performSearch() { fResult= new ArrayList<>(); markReferences(); if (!fResult.isEmpty()) { Type returnType= fMethodDeclaration.getReturnType2(); if (returnType != null) { String desc= Messages.format(SearchMessages.MethodExitsFinder_occurrence_return_description, BasicElementLabels.getJavaElementName(fMethodDeclaration.getName().toString())); fResult.add(new OccurrenceLocation(returnType.getStartPosition(), returnType.getLength(), 0, desc)); } } }
@Override public boolean visit(EnumConstantDeclaration node) { push(JavaNode.FIELD, node.getName().toString(), node.getStartPosition(), node.getLength()); return false; }
private void mapImplicitSetterParameter(MethodDeclaration node, CSProperty property) { final String parameterName = parameter(node, 0).getName().toString(); if (parameterName.equals("value")) { return; } property.setter().addStatement(0, newVariableDeclarationExpression(parameterName, property.type(), new CSReferenceExpression("value"))); }