Package com.bacoder.parser.java.api

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


    super(adapters);
  }

  @Override
  public InterfaceDeclaration adapt(InterfaceDeclarationContext context) {
    InterfaceDeclaration interfaceDeclaration = createNode(context);

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

    TypeParametersContext typeParametersContext = getChild(context, TypeParametersContext.class);
    if (typeParametersContext != null) {
      interfaceDeclaration.setTypeParameters(
          getAdapter(TypeParametersAdapter.class).adapt(typeParametersContext));
    }

    TypeListContext typeListContext = getChild(context, TypeListContext.class);
    if (typeListContext != null) {
      interfaceDeclaration.setExtendsTypes(
          getAdapter(TypeListAdapter.class).adapt(typeListContext));
    }

    InterfaceBodyContext interfaceBodyContext = getChild(context, InterfaceBodyContext.class);
    if (interfaceBodyContext != null) {
      List<InterfaceMemberDeclaration> memberDeclarations =
          transform(interfaceBodyContext, InterfaceBodyDeclarationContext.class,
              new Function<InterfaceBodyDeclarationContext, InterfaceMemberDeclaration>() {
                @Override
                public InterfaceMemberDeclaration apply(InterfaceBodyDeclarationContext context) {
                  return getAdapter(InterfaceBodyDeclarationAdapter.class).adapt(context);
                }
              });
      interfaceDeclaration.setMemberDeclarations(memberDeclarations);
    }

    return interfaceDeclaration;
  }
View Full Code Here


    }

    InterfaceDeclarationContext interfaceDeclarationContext =
        getChild(context, InterfaceDeclarationContext.class);
    if (interfaceDeclarationContext != null) {
      InterfaceDeclaration interfaceDeclaration =
          getAdapter(InterfaceDeclarationAdapter.class).adapt(interfaceDeclarationContext);
      setClassOrInterfaceModifiers(context, interfaceDeclaration);
      return interfaceDeclaration;
    }
View Full Code Here

TOP

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

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.