Package com.bacoder.parser.java.api

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


    super(adapters);
  }

  @Override
  public ClassOrInterfaceType adapt(ClassOrInterfaceTypeContext context) {
    ClassOrInterfaceType classOrInterfaceType = null;

    for (ParseTree child : context.children) {
      if (child instanceof TerminalNode
          && ((TerminalNode) child).getSymbol().getType() == JavaParser.Identifier) {
        ClassOrInterfaceType newClassOrInterfaceType =
            createNode(context, child, ClassOrInterfaceType.class);
        newClassOrInterfaceType.setName(
            getAdapter(IdentifierAdapter.class).adapt((TerminalNode) child));
        newClassOrInterfaceType.setScope(classOrInterfaceType);
        classOrInterfaceType = newClassOrInterfaceType;
      } else if (child instanceof TypeArgumentsContext && classOrInterfaceType != null) {
        setNodeAttributes(classOrInterfaceType, context, child);
        classOrInterfaceType.setTypeArguments(
            getAdapter(TypeArgumentsAdapter.class).adapt((TypeArgumentsContext) child));
View Full Code Here


  @Override
  public Type adapt(TypeContext context) {
    ClassOrInterfaceTypeContext classOrInterfaceTypeContext =
        getChild(context, ClassOrInterfaceTypeContext.class);
    if (classOrInterfaceTypeContext != null) {
      ClassOrInterfaceType type =
          getAdapter(ClassOrInterfaceTypeAdapter.class).adapt(classOrInterfaceTypeContext);
      type.setDimensions(getAdapter(ArrayDimensionsAdapter.class).adapt(context));
      return type;
    }

    PrimitiveTypeContext primitiveTypeContext = getChild(context, PrimitiveTypeContext.class);
    if (primitiveTypeContext != null) {
      PrimitiveType type = getAdapter(PrimitiveTypeAdapter.class).adapt(primitiveTypeContext);
      type.setDimensions(getAdapter(ArrayDimensionsAdapter.class).adapt(context));
      return type;
    }

    return null;
  }
View Full Code Here

TOP

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

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.