Package com.bacoder.parser.java.api

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


        arrayCreation.setElementType(instantiableType);
        arrayCreation.setDimensions(arrayDimensions);
        arrayCreation.setInitializer(arrayInitializer);
        return arrayCreation;
      } else {
        ClassInstantiation newInvocation = createNode(context, ClassInstantiation.class);
        newInvocation.setTypeArguments(nonWildcardTypeArguments);
        newInvocation.setType(instantiableType);
        newInvocation.setArguments(arguments);
        newInvocation.setMemberDeclarations(classMemberDeclarations);
        return newInvocation;
      }
    }

    return null;
View Full Code Here


      return scopedExpression;
    }

    TerminalNode newNode = getTerminalNode(context, JavaParser.NEW);
    if (newNode != null) {
      ClassInstantiation newInvocation = createNode(newNode, context, ClassInstantiation.class);

      NonWildcardTypeArgumentsContext nonWildcardTypeArgumentsContext =
          getChild(context, NonWildcardTypeArgumentsContext.class);
      if (nonWildcardTypeArgumentsContext != null) {
        newInvocation.setTypeArguments(getAdapter(NonWildcardTypeArgumentsAdapter.class).adapt(
            nonWildcardTypeArgumentsContext));
      }

      InnerCreatorContext innerCreatorContext = getChild(context, InnerCreatorContext.class);
      if (innerCreatorContext != null) {
        TerminalNode typeIdentifierNode =
            getTerminalNode(innerCreatorContext, JavaParser.Identifier);
        NonWildcardTypeArgumentsOrDiamondContext nonWildcardTypeArgumentsOrDiamondContext =
            getChild(innerCreatorContext, NonWildcardTypeArgumentsOrDiamondContext.class);
        TypeWithArguments typeWithArguments =
            createNode(typeIdentifierNode,
                nonWildcardTypeArgumentsOrDiamondContext == null
                    ? typeIdentifierNode
                    : nonWildcardTypeArgumentsOrDiamondContext,
                TypeWithArguments.class);
        typeWithArguments.setIdentifiersWithTypeArguments(
            convertIdentifiersWithTypeArguments(innerCreatorContext));
        newInvocation.setType(typeWithArguments);

        ClassCreatorRestContext classCreatorRestContext =
            getChild(innerCreatorContext, ClassCreatorRestContext.class);
        if (classCreatorRestContext != null) {
          ArgumentsContext arguments = getChild(classCreatorRestContext, ArgumentsContext.class);
          if (arguments != null) {
            newInvocation.setArguments(getAdapter(ArgumentsAdapter.class).adapt(arguments));
          }

          ClassBodyContext classBodyContext =
              getChild(classCreatorRestContext, ClassBodyContext.class);
          if (classBodyContext != null) {
            newInvocation.setMemberDeclarations(
                getAdapter(ClassBodyAdapter.class).adapt(classBodyContext));
          }
        }
      }
View Full Code Here

TOP

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

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.