Package com.bacoder.parser.java.api

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


    super(adapters);
  }

  @Override
  public VariableDeclaration adapt(ConstantDeclaratorContext context) {
    VariableDeclaration variableDeclarator = createNode(context);

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

    variableDeclarator.setDimensions(getAdapter(ArrayDimensionsAdapter.class).adapt(context));

    VariableInitializerContext variableInitializerContext =
        getChild(context, VariableInitializerContext.class);
    if (variableInitializerContext != null) {
      variableDeclarator.setInitializer(
          getAdapter(VariableInitializerAdapter.class).adapt(variableInitializerContext));
    }

    return variableDeclarator;
  }
View Full Code Here


    super(adapters);
  }

  @Override
  public VariableDeclaration adapt(VariableDeclaratorContext context) {
    VariableDeclaration variableDeclarator = createNode(context);

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

      variableDeclarator.setDimensions(
          getAdapter(ArrayDimensionsAdapter.class).adapt(variableDeclaratorIdContext));
    }

    VariableInitializerContext variableInitializerContext =
        getChild(context, VariableInitializerContext.class);
    if (variableInitializerContext != null) {
      variableDeclarator.setInitializer(
          getAdapter(VariableInitializerAdapter.class).adapt(variableInitializerContext));
    }

    return variableDeclarator;
  }
View Full Code Here

TOP

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

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.