示例#1
0
 public IModifierList getModifierList() {
   if (_modifierList == null) {
     _modifierList =
         new JavaSourceModifierList(this, _methodNode.getChildOfType(JavaASTConstants.modifiers));
   }
   return _modifierList;
 }
示例#2
0
 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);
   }
 }
示例#3
0
 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;
 }
示例#4
0
 public String getName() {
   return _methodNode.getChildOfType(JavaParser.IDENTIFIER).getText();
 }