Examples of AnnotationMethodDeclaration


Examples of com.bacoder.parser.java.api.AnnotationMethodDeclaration

    super(adapters);
  }

  @Override
  public AnnotationMethodDeclaration adapt(AnnotationMethodRestContext context) {
    AnnotationMethodDeclaration annotationMethodDeclaration = createNode(context);

    TerminalNode identifierNode = getTerminalNode(context, JavaParser.Identifier);
    if (identifierNode != null) {
      annotationMethodDeclaration.setName(
          getAdapter(IdentifierAdapter.class).adapt(identifierNode));
    }

    DefaultValueContext defaultValueContext = getChild(context, DefaultValueContext.class);
    if (defaultValueContext != null) {
      ElementValueContext elementValueContext =
          getChild(defaultValueContext, ElementValueContext.class);
      if (elementValueContext != null) {
        annotationMethodDeclaration.setDefaultValue(
            getAdapter(ElementValueAdapter.class).adapt(elementValueContext));
      }
    }

    return annotationMethodDeclaration;
View Full Code Here

Examples of com.bacoder.parser.java.api.AnnotationMethodDeclaration

        if (annotationMethodOrConstantRestContext != null) {
          AnnotationMethodRestContext annotationMethodRestContext = getChild(
              annotationMethodOrConstantRestContext,
              AnnotationMethodRestContext.class);
          if (annotationMethodRestContext != null) {
            AnnotationMethodDeclaration annotationMethodDeclaration = getAdapter(
                AnnotationMethodRestAdapter.class).adapt(
                annotationMethodRestContext);
            annotationMethodDeclaration.setType(type);
            annotationMemberDeclaration = annotationMethodDeclaration;
          }

          AnnotationConstantRestContext annotationConstantRestContext = getChild(
              annotationMethodOrConstantRestContext,
View Full Code Here

Examples of lombok.ast.AnnotationMethodDeclaration

    if (modifiers != null) decl.astModifiers(createModifiersIfNeeded(modifiers, currentPos()));
    return posify(decl);
  }
 
  public Node createAnnotationMethodDeclaration(Node modifiers, Node typeReference, Node name, List<org.parboiled.Node<Node>> dims, Node defaultValue) {
    AnnotationMethodDeclaration decl = new AnnotationMethodDeclaration()
        .astMethodName(createIdentifierIfNeeded(name, currentPos())).rawDefaultValue(defaultValue);
    if (modifiers != null) decl.astModifiers(createModifiersIfNeeded(modifiers, currentPos()));
    int extraDims = dims == null ? 0 : dims.size();
    Node returnType = typeReference;
    if (extraDims > 0 && returnType instanceof TypeReference) {
      ((TypeReference)returnType).astArrayDimensions(((TypeReference)returnType).astArrayDimensions() + extraDims);
    }
    decl.rawReturnTypeReference(returnType);
    return posify(decl);
  }
View Full Code Here

Examples of lombok.ast.AnnotationMethodDeclaration

        set(node, cd);
        return;
      }
     
      if (hasFlag(FlagKey.METHODS_ARE_ANNMETHODS)) {
        AnnotationMethodDeclaration md = new AnnotationMethodDeclaration();
        md.astModifiers((Modifiers) toTree(node.getModifiers()));
        md.astMethodName(setPos(node, new Identifier().astValue(name)));
        md.rawReturnTypeReference(toTree(node.getReturnType(), FlagKey.TYPE_REFERENCE));
        md.rawDefaultValue(toTree(node.getDefaultValue()));
        addJavadoc(md, node.mods);
        set(node, md);
        return;
      }
     
      MethodDeclaration md = new MethodDeclaration();
      md.rawBody(toTree(node.getBody()));
      md.astModifiers((Modifiers) toTree(node.getModifiers()));
      md.astMethodName(setPos(node, new Identifier().astValue(name)));
      fillList(node.getThrows(), md.rawThrownTypeReferences(), FlagKey.TYPE_REFERENCE);
      fillList(node.getTypeParameters(), md.rawTypeVariables());
      fillList(node.getParameters(), md.rawParameters(), FlagKey.NO_VARDECL_FOLDING, FlagKey.VARDEF_IS_DEFINITION);
      md.rawReturnTypeReference(toTree(node.getReturnType(), FlagKey.TYPE_REFERENCE));
      addJavadoc(md, node.mods);
      set(node, md);
    }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.ast.AnnotationMethodDeclaration

    // instead on the delegate for the declaringClass because it will likely be a BcelObjectType with the right stuff
    // in it - see the other checks on BcelObjectType in this class.
    if (realBinding instanceof MethodBinding) {
      AbstractMethodDeclaration methodDecl = getTypeDeclaration().declarationOf((MethodBinding) realBinding);
      if (methodDecl instanceof AnnotationMethodDeclaration) {
        AnnotationMethodDeclaration annoMethodDecl = (AnnotationMethodDeclaration) methodDecl;
        Expression e = annoMethodDecl.defaultValue;
        if (e.resolvedType == null) {
          e.resolve(methodDecl.scope);
        }
        // TODO does not cope with many cases...
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.ast.AnnotationMethodDeclaration

    if (method.isConstructor()) {
      ConstructorDeclaration decl = new ConstructorDeclaration(compilationResult);
      decl.bits &= ~ASTNode.IsDefaultConstructor;
      methodDeclaration = decl;
    } else {
      MethodDeclaration decl = type.isAnnotation() ? new AnnotationMethodDeclaration(compilationResult) : new MethodDeclaration(compilationResult);
      /* convert return type */
      decl.returnType = createTypeReference(Signature.toString(method.getReturnType()).toCharArray());
      methodDeclaration = decl;
    }
    methodDeclaration.selector = method.getElementName().toCharArray();
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.ast.AnnotationMethodDeclaration

          jmethod.typeParameters())) {
        return false;
      }
    } else {
      if (jmethod.isAnnotationMethod()) {
        AnnotationMethodDeclaration annotationMethod = (AnnotationMethodDeclaration) jmethod;
        Object defaultValue = null;
        if (annotationMethod.defaultValue != null) {
          defaultValue = getAnnotationElementValue(logger,
              annotationMethod.returnType.resolvedType,
              annotationMethod.defaultValue);
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.ast.AnnotationMethodDeclaration

   
  this.visitIfNeeded(methodDeclaration);

  if (isInRange) {
    if (methodDeclaration instanceof AnnotationMethodDeclaration) {
      AnnotationMethodDeclaration annotationMethodDeclaration = (AnnotationMethodDeclaration) methodDeclaration;
      Expression expression = annotationMethodDeclaration.defaultValue;
      if (expression != null) {
        requestor.exitMethod(methodDeclaration.declarationSourceEnd, expression);
        return;
      }
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.ast.AnnotationMethodDeclaration

    org.eclipse.jdt.internal.compiler.ast.ASTNode node = bindingsToNodes == null ? null : bindingsToNodes.get(methodBinding);
    if (node != null && !declaringType.isBinary()) {
      if (node instanceof AnnotationMethodDeclaration) {
        // node is an AnnotationMethodDeclaration
        AnnotationMethodDeclaration typeMemberDeclaration = (AnnotationMethodDeclaration) node;
        return (JavaElement) declaringType.getMethod(String.valueOf(typeMemberDeclaration.selector), CharOperation.NO_STRINGS); // annotation type members don't have parameters
      } else {
        // node is an MethodDeclaration
        MethodDeclaration methodDeclaration = (MethodDeclaration) node;
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.ast.AnnotationMethodDeclaration

          jmethod.typeParameters())) {
        return false;
      }
    } else {
      if (jmethod.isAnnotationMethod()) {
        AnnotationMethodDeclaration annotationMethod = (AnnotationMethodDeclaration) jmethod;
        Object defaultValue = null;
        if (annotationMethod.defaultValue != null) {
          defaultValue = getAnnotationElementValue(logger,
              annotationMethod.returnType.resolvedType,
              annotationMethod.defaultValue);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.