Package com.bacoder.parser.java.api

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


  @Override
  public InterfaceMethodDeclaration adapt(GenericInterfaceMethodDeclarationContext context) {
    InterfaceMethodDeclarationContext interfaceDeclarationContext =
        getChild(context, InterfaceMethodDeclarationContext.class);
    if (interfaceDeclarationContext != null) {
      InterfaceMethodDeclaration interfaceMethodDeclaration =
          getAdapter(InterfaceMethodDeclarationAdapter.class).adapt(interfaceDeclarationContext);
      TypeParametersContext typeParametersContext = getChild(context, TypeParametersContext.class);
      if (typeParametersContext != null) {
        interfaceMethodDeclaration.setTypeParameters(
            getAdapter(TypeParametersAdapter.class).adapt(typeParametersContext));
      }
      return interfaceMethodDeclaration;
    }
View Full Code Here


    super(adapters);
  }

  @Override
  public InterfaceMethodDeclaration adapt(InterfaceMethodDeclarationContext context) {
    InterfaceMethodDeclaration interfaceDeclaration = createNode(context);

    TypeContext typeContext = getChild(context, TypeContext.class);
    if (typeContext != null) {
      interfaceDeclaration.setReturnType(getAdapter(TypeAdapter.class).adapt(typeContext));
    } else {
      TerminalNode voidNode = getTerminalNode(context, JavaParser.VOID);
      if (voidNode != null) {
        interfaceDeclaration.setReturnType(createNode(voidNode, VoidType.class));
      }
    }

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

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

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

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

    return interfaceDeclaration;
  }
View Full Code Here

TOP

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

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.