Examples of JInvocation


Examples of com.sun.codemodel.JInvocation

  }

  @NotNull
  @Override
  public Expressions createReadFromDeserializeFromExpression( @NotNull AbstractGenerator<?> generator, @NotNull JDefinedClass serializerClass, @NotNull JExpression deserializeFrom, @NotNull JVar formatVersion, @NotNull FieldDeclarationInfo fieldInfo ) {
    JInvocation nextTagExpression = createNextTagInvocation( serializerClass, deserializeFrom, fieldInfo );

    JClass type = codeGenerator.ref( fieldInfo.getType().toString() );
    JInvocation expression = JExpr.invoke( METHOD_NAME_DESERIALIZE ).arg( JExpr.dotclass( type ) ).arg( formatVersion ).arg( deserializeFrom );
    return new Expressions( expression, nextTagExpression );
  }
View Full Code Here

Examples of com.sun.codemodel.JInvocation

        JVar var;
        if (nillable) {
            var = method.body().decl(model._ref(cls), "value" + varCount++, JExpr._null());
            JConditional cond = method.body()._if(xsrVar.invoke("isXsiNil").not());
           
            JInvocation invocation = xsrVar.invoke(value);
            cond._then().assign(var, invocation);
        } else {
            var = method.body().decl(model._ref(cls), "value" + varCount++, xsrVar.invoke(value));
        }
       
View Full Code Here

Examples of com.sun.codemodel.JInvocation

        ElementParserBuilderImpl b = new ElementParserBuilderImpl(this, false, name);
        states.add(b);
       
        JMethod nextMethod = b.getMethod();
       
        JInvocation invocation = JExpr.invoke(nextMethod).arg(xsrVar).arg(rtContextVar);
        b.methodInvocation = invocation;
       
        block.add(invocation);
       
        return b;
View Full Code Here

Examples of com.sun.codemodel.JInvocation

        JBlock block = codeBlock;
       
        ElementParserBuilderImpl b = (ElementParserBuilderImpl) builder;
        JMethod nextMethod = b.getMethod();
       
        JInvocation invocation = JExpr.invoke(nextMethod).arg(xsrVar).arg(rtContextVar);
        for (JVar v : b.variables) {
            invocation.arg(v);
        }
       
        return block.decl(type, varName, invocation);
    }
View Full Code Here

Examples of com.sun.codemodel.JInvocation

                cond = cond._else()._if(qnameCompare);
            }
           
            JMethod nextMethod = builder.getMethod();
           
            JInvocation invocation = JExpr.invoke(nextMethod).arg(xsrVar).arg(rtContextVar);
            for (JVar v : builder.variables) {
                invocation.arg(v);
            }
           
            nextMethod.param(model._ref(String.class), "_attValue");
            invocation.arg(attValue);
           
            nextMethod.body().add(builder.codeBlock);
           
            if (root && builder.returnType != null) {
                cond._then()._return(invocation);
View Full Code Here

Examples of com.sun.codemodel.JInvocation

            }
           
            JBlock block = cond._then();
           
            JMethod nextMethod = builder.getMethod();
            JInvocation invocation = JExpr.invoke(nextMethod).arg(xsrVar).arg(rtContextVar);
            for (JExpression var : call.getVars()) {
                invocation.arg(var);
            }
            block.add(invocation);
            if (builder != this)
                builder.write();
        }
View Full Code Here

Examples of com.sun.codemodel.JInvocation

    private void writeElementReader(ElementParserBuilderImpl builder,
                                    JBlock block,
                                    boolean global) {
        JMethod nextMethod = builder.getMethod();
       
        JInvocation invocation = JExpr.invoke(nextMethod).arg(xsrVar).arg(rtContextVar);

        if (!global) {
            for (JVar v : builder.variables) {
                invocation.arg(v);
            }
        }
       
        if (root && builder.returnType != null) {
            block._return(invocation);
View Full Code Here

Examples of com.sun.codemodel.JInvocation

    createTestResource( mappingTestClass, STUB_DATA_POINT_NAME );
  }

  @NotNull
  protected JInvocation createDomainObjectCreationExpression() {
    JInvocation invocation = JExpr._new( codeGenerator.ref( descriptor.getQualifiedName() ) );

    ConstructorDeclaration constructor = descriptor.findBestConstructor();
    for ( ParameterDeclaration parameterDeclaration : constructor.getParameters() ) {
      invocation.arg( codeGenerator.getNewInstanceFactory().create( parameterDeclaration.getType(), parameterDeclaration.getSimpleName() ) );
    }

    return invocation;
  }
View Full Code Here

Examples of com.sun.codemodel.JInvocation

    createTestResource( jaxbTestClass, identifier );
  }

  private void createConstructor( @NotNull JDefinedClass parent ) {
    JMethod constructor = parent.constructor( JMod.PUBLIC );
    JInvocation superInvocation = constructor.body().invoke( SUPER ).arg( jaxbObject.dotclass() ).arg( jaxbStub.dotclass() );

    if ( parent == jaxbTestClass ) {
      superInvocation.arg( jaxbCollection.dotclass() );
    }
  }
View Full Code Here

Examples of com.sun.codemodel.JInvocation


    Collection<JStatement> statements = new ArrayList<JStatement>();

    for ( FieldWithInitializationInfo fieldInfo : descriptor.getFieldInfos() ) {
      JInvocation getterInvocation = source.invoke( fieldInfo.getGetterDeclaration().getSimpleName() );

      if ( fieldInfo.getSimpleName().equals( ID ) ) {
        continue;
      }


      if ( isStub && !shallAddFieldCopyStatementToStub( fieldInfo ) ) {
        continue;
      }

      JInvocation value;
      if ( isProbablyOwnType( fieldInfo.getType() ) ) {
        JClass fieldJaxbType = getJaxbType( fieldInfo, false );
        JClass fieldStubType = getJaxbType( fieldInfo, true );

        if ( isStub || TypeUtils.isCollectionType( fieldInfo.getType() ) ) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.