Package com.bacoder.parser.java.api

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


    super(adapters);
  }

  @Override
  public EnumConstant adapt(EnumConstantContext context) {
    EnumConstant enumConstant = createNode(context);

    List<Annotation> annotations =
        transform(context, AnnotationContext.class, new Function<AnnotationContext, Annotation>() {
          @Override
          public Annotation apply(AnnotationContext context) {
            return getAdapter(AnnotationAdapter.class).adapt(context);
          }
        });
    enumConstant.setAnnotations(annotations);

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

    ArgumentsContext argumentsContext = getChild(context, ArgumentsContext.class);
    if (argumentsContext != null) {
      enumConstant.setArguments(getAdapter(ArgumentsAdapter.class).adapt(argumentsContext));
    }

    ClassBodyContext classBodyContext = getChild(context, ClassBodyContext.class);
    if (classBodyContext != null) {
      enumConstant.setMemberDeclarations(
          getAdapter(ClassBodyAdapter.class).adapt(classBodyContext));
    }

    return enumConstant;
  }
View Full Code Here

TOP

Related Classes of com.bacoder.parser.java.api.EnumConstant

Copyright © 2018 www.massapicom. 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.