Package com.sun.codemodel

Examples of com.sun.codemodel.JInvocation.arg()


        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);
        }

        varName = variableManager.createId(varName);
        return block.decl(type, varName, invocation);
    }
View Full Code Here


            // Global reader methods don't have arguments
            if (vars == null) vars = builder.getVariables();
            if (vars != null) {
                for (JExpression var : vars) {
                    invocation.arg(var);
                }
            }

            if (readBlock != null) {
                if (expected.getReadVar() != null) {
View Full Code Here

    JInvocation domainTypeInit = JExpr._new( domainType );

    //Add the arguments for the fields
    List<? extends FieldInitializedInConstructorInfo> fieldsToSerialize = domainObjectDescriptor.getFieldsInitializedInConstructor();
    for ( FieldInitializedInConstructorInfo fieldInfo : fieldsToSerialize ) {
      domainTypeInit.arg( fieldToVar.get( fieldInfo ) );
    }

    //Add the object type
    JVar domainObjectVar = deserializeMethod.body().decl( domainType, VAR_NAME_OBJECT, domainTypeInit );
View Full Code Here

            JExpression test;
            JConditional jc;
            JInvocation invocation;
                           
            invocation = JExpr.invoke("tryOverwrite");
            invocation.arg(JExpr.dotclass(type.boxify()));
            invocation.arg(JExpr.lit(fieldName));
            JVar tmp = method.body().decl(type.boxify(), "_" + fieldName,
                                          invocation);
            test = JOp.not(JOp.eq(JExpr._null(), tmp));
            jc = method.body()._if(test);
View Full Code Here

            JConditional jc;
            JInvocation invocation;
                           
            invocation = JExpr.invoke("tryOverwrite");
            invocation.arg(JExpr.dotclass(type.boxify()));
            invocation.arg(JExpr.lit(fieldName));
            JVar tmp = method.body().decl(type.boxify(), "_" + fieldName,
                                          invocation);
            test = JOp.not(JOp.eq(JExpr._null(), tmp));
            jc = method.body()._if(test);
            jc._then()._return(tmp);
View Full Code Here

            test = JOp.not(JOp.eq(JExpr._null(), fr));
            jc = method.body()._if(test);
            jc._then()._return(fr);
           
            invocation = JExpr.invoke("tryFallback");
            invocation.arg(JExpr.dotclass(type.boxify()));
            invocation.arg(JExpr.lit(fieldName));
            // tmp = method.body().decl(type.boxify(), "_" + fieldName, invocation);
            method.body().assign(tmp, invocation);
            test = JOp.not(JOp.eq(JExpr._null(), tmp));
            jc = method.body()._if(test);
View Full Code Here

            jc = method.body()._if(test);
            jc._then()._return(fr);
           
            invocation = JExpr.invoke("tryFallback");
            invocation.arg(JExpr.dotclass(type.boxify()));
            invocation.arg(JExpr.lit(fieldName));
            // tmp = method.body().decl(type.boxify(), "_" + fieldName, invocation);
            method.body().assign(tmp, invocation);
            test = JOp.not(JOp.eq(JExpr._null(), tmp));
            jc = method.body()._if(test);
            jc._then()._return(tmp);
View Full Code Here

            // modify the setter to notify the property change
 
            JMethod method = dc.getMethod(setterName, new JType[] {type.boxify()});
            if (null != method) {
                JInvocation invocation = JExpr.invoke("notifyPropertyChange");
                invocation.arg(JExpr.lit(fieldName));
                method.body().add(invocation);
            }
        }
    }
}
View Full Code Here

    JInvocation domainTypeInit = JExpr._new( domainType );

    //Add the arguments for the fields
    List<? extends FieldInitializedInConstructorInfo> fieldsToSerialize = domainObjectDescriptor.getFieldsInitializedInConstructor();
    for ( FieldInitializedInConstructorInfo fieldInfo : fieldsToSerialize ) {
      domainTypeInit.arg( fieldToVar.get( fieldInfo ) );
    }

    //Add the object type
    JVar domainObjectVar = deserializeMethod.body().decl( domainType, VAR_NAME_OBJECT, domainTypeInit );
View Full Code Here

    method.annotate( Override.class );


    JInvocation asListInvocation = codeModel.ref( Arrays.class ).staticInvoke( "asList" );
    for ( int i = 0; i < NUMBER_OF_OBJECTS; i++ ) {
      asListInvocation.arg( JExpr.lit( "<implementMe/>" ) );
    }

    method.body()._return( asListInvocation );
    return method;
  }
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.