Package com.bacoder.parser.java.api

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


    super(adapters);
  }

  @Override
  public ConstDeclaration adapt(ConstDeclarationContext context) {
    final ConstDeclaration constDeclaration = createNode(context);

    final TypeContext typeContext = getChild(context, TypeContext.class);
    if (typeContext != null) {
      constDeclaration.setType(getAdapter(TypeAdapter.class).adapt(typeContext));
    }

    constDeclaration.setVariableDeclarations(transform(context, ConstantDeclaratorContext.class,
        new Function<ConstantDeclaratorContext, VariableDeclaration>() {
          @Override
          public VariableDeclaration apply(ConstantDeclaratorContext context) {
            return getAdapter(ConstDeclaratorAdapter.class).adapt(context);
          }
View Full Code Here


    throw new RuntimeException("Not supported");
  }

  public ConstDeclaration adapt(AnnotationConstantRestContext context, Type baseType,
      ParseTree baseTypeContext) {
    ConstDeclaration constDeclaration = createNode(context);
    constDeclaration.setType(baseType);

    VariableDeclaratorsContext variableDeclaratorsContext =
        getChild(context, VariableDeclaratorsContext.class);
    if (variableDeclaratorsContext != null) {
      constDeclaration.setVariableDeclarations(
          getAdapter(VariableDeclaratorsAdapter.class).adapt(variableDeclaratorsContext,
              constDeclaration.getType(), baseTypeContext));
    }

    return constDeclaration;
  }
View Full Code Here

TOP

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

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.