Examples of staticInvoke()


Examples of com.sun.codemodel.JClass.staticInvoke()

        } else if (cls.equals(float.class) || cls.equals(Float.class)) {
            JClass jc = (JClass) model._ref(Float.class);
            writeAs(block, jc.staticInvoke("toString").arg(objectVar));
        } else if (cls.equals(byte.class) || cls.equals(Byte.class)) {
            JClass jc = (JClass) model._ref(Byte.class);
            writeAs(block, jc.staticInvoke("toString").arg(objectVar));
        } else {
            throw new UnsupportedOperationException();
        }
    }
View Full Code Here

Examples of com.sun.codemodel.JClass.staticInvoke()

   * @return the invocation creating the version range
   */
  @NotNull
  protected JInvocation createDefaultVersionRangeInvocation( @NotNull Version from, @NotNull Version to ) {
    JClass versionRangeType = codeModel.ref( VersionRange.class );
    return versionRangeType.staticInvoke( METHOD_NAME_FROM ).arg( JExpr.lit( from.getMajor() ) ).arg( JExpr.lit( from.getMinor() ) ).arg( JExpr.lit( from.getBuild() ) )
      .invoke( METHOD_NAME_TO ).arg( JExpr.lit( to.getMajor() ) ).arg( JExpr.lit( to.getMinor() ) ).arg( JExpr.lit( to.getBuild() ) );
  }
}
View Full Code Here

Examples of com.sun.codemodel.JClass.staticInvoke()

    method.param( Version.class, PARAM_NAME_VERSION );

    JClass assertClass = codeGenerator.ref( "org.testng.Assert" );

    for ( FieldWithInitializationInfo fieldInfo : domainObjectDescriptor.getFieldsToSerialize() ) {
      method.body().add( assertClass.staticInvoke( METHOD_NAME_ASSERT_EQUALS ).arg( deserialized.invoke( fieldInfo.getGetterDeclaration().getSimpleName() ) ).arg( "daValue" ) );
    }
  }

  /**
   * Creates the getSerialized method (used for versioned tests
View Full Code Here

Examples of com.sun.codemodel.JClass.staticInvoke()

                    // parseMethod specifies the static method of the target type
                    // which will do the unmarshalling.

                    // because of an error check at the constructor,
                    // we can safely assume that this cast works.
                    inv = bim.staticInvoke(parseMethod).arg($value);
                } else {
                    inv = JExpr.direct(parseMethod+"(value)");
                }
            }
            unmarshal.body()._return(inv);
View Full Code Here

Examples of com.sun.codemodel.JClass.staticInvoke()

            actionBuilderClass.method(JMod.PUBLIC, actionBuilderClass, RestLiToolsUtils.nameCamelCase(paramName + "Param")) :
            actionBuilderClass.method(JMod.PUBLIC, actionBuilderClass, "param" + capitalize(paramName));
        JVar typesafeMethodParam = typesafeMethod.param(binding.valueClass, "value");

        JClass dataTemplateUtil = getCodeModel().ref(DataTemplateUtil.class);
        JExpression dataSchema = dataTemplateUtil.staticInvoke("getSchema").arg(binding.schemaClass.dotclass());

        typesafeMethod.body().add(JExpr._super().invoke(isOptional ? "setParam" : "setReqParam")
                                          .arg(resourceSpecField
                                                       .invoke("getRequestMetadata").arg(actionName)
                                                       .invoke("getFieldDef").arg(paramName))
View Full Code Here

Examples of com.sun.codemodel.JClass.staticInvoke()

    JClass mode = m.directClass(DataMode.class.getCanonicalName());
    for(int i=0; i<argTypes.length; i++) {
      sub.assign(
        oiArray.component(JExpr.lit(i)),
        oih.staticInvoke("getDrillObjectInspector")
          .arg(mode.staticInvoke("valueOf").arg(JExpr.lit(argTypes[i].getMode().getNumber())))
          .arg(mt.staticInvoke("valueOf").arg(JExpr.lit(argTypes[i].getMinorType().getNumber()))));
    }

    // declare and instantiate DeferredObject array
    sub.assign(workspaceJVars[2], JExpr.newArray(m._ref(DrillDeferredObject.class), argTypes.length));
View Full Code Here

Examples of com.sun.codemodel.JClass.staticInvoke()

                throw new BuildException(e);
            }
        } else if (c.equals(byte[].class)) {
            JClass buType = (JClass) builder.getCodeModel()._ref(BinaryUtils.class);
           
            toSet = buType.staticInvoke("decodeAsBytes").arg(builder.getXSR());
        } else if (c.equals(Byte.class) || c.equals(byte.class)) {
            toSet = JExpr.cast(model.BYTE, builder.getXSR().invoke("getElementAsInt"));
        } else if (c.equals(BigDecimal.class)) {
            JType bdType = builder.getCodeModel()._ref(BigDecimal.class);
            JVar var = builder.as(String.class, nillable);
View Full Code Here

Examples of com.sun.codemodel.JClass.staticInvoke()

        } else if (c.isEnum()) {
            toSet = handleEnum(builder, builder.as(String.class), c);
        } else if (c.equals(byte[].class)) {
            JClass b64Type = (JClass) builder.getCodeModel()._ref(Base64.class);
           
            toSet = b64Type.staticInvoke("decode").arg(builder.as(String.class));
        } else if (c.equals(BigDecimal.class)) {
            JType bdType = builder.getCodeModel()._ref(BigDecimal.class);
            JVar var = builder.as(String.class);
            toSet = JExpr._new(bdType).arg(var);
        } else if (c.equals(BigInteger.class)) {
View Full Code Here

Examples of com.sun.codemodel.JClass.staticInvoke()

    JClass jClass = model.ref( String.class );
    JInvocation wrappedGetterInvocation;
    if ( fieldInfo.isType( String.class ) ) {
      wrappedGetterInvocation = getterInvocation;
    } else {
      wrappedGetterInvocation = jClass.staticInvoke( STRING_VALUE_OF ).arg( getterInvocation );
    }
    return wrappedGetterInvocation;
  }

  @NotNull
View Full Code Here

Examples of com.sun.codemodel.JClass.staticInvoke()

           
            cond._else().add(b.getXSW().invoke("writeXsiNil"));
        }
       
        JClass buType = (JClass) model._ref(BinaryUtils.class);
        b.getCurrentBlock().add(buType.staticInvoke("encodeBytes").arg(b.getXSW()).arg(var));
       
        b.setCurrentBlock(block);
    }
   
    private void writeBase64BinaryAttribute(WriterBuilder b,
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.