Package com.bacoder.parser.java.api

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


  @Override
  public ConstructorDeclaration adapt(GenericConstructorDeclarationContext context) {
    ConstructorDeclarationContext constructorDeclarationContext =
        getChild(context, ConstructorDeclarationContext.class);
    if (constructorDeclarationContext == null) {
      ConstructorDeclaration constructorDeclaration =
          getAdapter(ConstructorDeclarationAdapter.class).adapt(constructorDeclarationContext);
      TypeParametersContext typeParametersContext = getChild(context, TypeParametersContext.class);
      if (typeParametersContext != null) {
        constructorDeclaration.setTypeParameters(
            getAdapter(TypeParametersAdapter.class).adapt(typeParametersContext));
      }
      return constructorDeclaration;
    }
View Full Code Here


    super(adapters);
  }

  @Override
  public ConstructorDeclaration adapt(ConstructorDeclarationContext context) {
    ConstructorDeclaration constructorDeclaration = createNode(context);

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

    FormalParametersContext formalParametersContext =
        getChild(context, FormalParametersContext.class);
    if (formalParametersContext != null) {
      constructorDeclaration.setFormalParameters(
          getAdapter(FormalParametersAdapter.class).adapt(formalParametersContext));
    }

    QualifiedNameListContext qualifiedNameListContext =
        getChild(context, QualifiedNameListContext.class);
    if (qualifiedNameListContext != null) {
      constructorDeclaration.setThrowsExceptions(
          getAdapter(QualifiedNamesAdapter.class).adapt(qualifiedNameListContext));
    }

    ConstructorBodyContext constructorBodyContext = getChild(context, ConstructorBodyContext.class);
    if (constructorBodyContext != null) {
      BlockContext blockContext = getChild(constructorBodyContext, BlockContext.class);
      if (blockContext != null) {
        constructorDeclaration.setBody(getAdapter(BlockAdapter.class).adapt(blockContext));
      }
    }

    return constructorDeclaration;
  }
View Full Code Here

TOP

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

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.