public IModifierList getModifierList() { if (_modifierList == null) { _modifierList = new JavaSourceModifierList(this, _methodNode.getChildOfType(JavaASTConstants.modifiers)); } return _modifierList; }
public static JavaSourceMethod create(IJavaASTNode methodNode, JavaSourceType containingClass) { IJavaASTNode nameNode = methodNode.getChildOfType(JavaParser.IDENTIFIER); if (nameNode == null) { return null; } String methodName = nameNode.getText(); if (methodName.equals(containingClass.getSimpleName())) { return new JavaSourceConstructor(methodNode, containingClass); } else if (containingClass.isAnnotation()) { return new JavaSourceAnnotationMethod(methodNode, containingClass); } else { return new JavaSourceMethod(methodNode, containingClass); } }
public IJavaClassTypeVariable[] getTypeParameters() { if (_typeParameters == null) { IJavaASTNode typeParamsNode = _methodNode.getChildOfType(JavaASTConstants.typeParameters); if (typeParamsNode != null) { List<IJavaASTNode> typeParamNodes = typeParamsNode.getChildrenOfTypes(JavaASTConstants.typeParameter); _typeParameters = new IJavaClassTypeVariable[typeParamNodes.size()]; for (int i = 0; i < _typeParameters.length; i++) { _typeParameters[i] = JavaSourceTypeVariable.create(this, typeParamNodes.get(i)); } } else { _typeParameters = JavaSourceTypeVariable.EMPTY; } } return _typeParameters; }
public String getName() { return _methodNode.getChildOfType(JavaParser.IDENTIFIER).getText(); }