public JType getRawType() { return core.getRawType(); }
public final JType type() { return fr.getRawType(); } }
public final JType type() { return fr.getRawType(); } }
public final JType type() { return fr.getRawType(); } }
public final JType type() { return fr.getRawType(); } }
public final JType type() { return fr.getRawType(); } }
PropertyImpl( Mapping parent, FieldOutline fr, QName elementName ) { this.parent = parent; this.fr = fr; this.elementName = elementName; this.codeModel = fr.getRawType().owner(); }
PropertyImpl( Mapping parent, FieldOutline fr, QName elementName ) { this.parent = parent; this.fr = fr; this.elementName = elementName; this.codeModel = fr.getRawType().owner(); }
PropertyImpl( Mapping parent, FieldOutline fr, QName elementName ) { this.parent = parent; this.fr = fr; this.elementName = elementName; this.codeModel = fr.getRawType().owner(); }
PropertyImpl( Mapping parent, FieldOutline fr, QName elementName ) { this.parent = parent; this.fr = fr; this.elementName = elementName; this.codeModel = fr.getRawType().owner(); }
PropertyImpl( Mapping parent, FieldOutline fr, QName elementName ) { this.parent = parent; this.fr = fr; this.elementName = elementName; this.codeModel = fr.getRawType().owner(); }
@Override public boolean test(FieldOutline fieldOutline){ CPropertyInfo propertyInfo = fieldOutline.getPropertyInfo(); if(("extensions").equals(propertyInfo.getName(false)) && propertyInfo.isCollection()){ JType elementType = CodeModelUtil.getElementType(fieldOutline.getRawType()); return checkType(elementType, "org.dmg.pmml.Extension"); } return false; } };
@Override public boolean test(FieldOutline fieldOutline){ CPropertyInfo propertyInfo = fieldOutline.getPropertyInfo(); if(propertyInfo.isCollection()){ JType elementType = CodeModelUtil.getElementType(fieldOutline.getRawType()); String name = elementType.name(); return ((this.name).equals(name + "s") || (this.name).equals(JJavaName.getPluralForm(name))); } return false; } };
/** * Returns the setter method for a given field. * * @param fieldOutline field outline * @return setter for the specified field */ protected JMethod setter(FieldOutline fieldOutline) { JDefinedClass theClass = fieldOutline.parent().implClass; String publicName = fieldOutline.getPropertyInfo().getName(true); return theClass.getMethod("set" + publicName, new JType[] {fieldOutline.getRawType()}); } }
public void toRawValue(JBlock block, JVar $var) { // [RESULT] // if([core.hasSetValue]) // $var = [core.toRawValue].getValue(); // else // $var = null; JConditional cond = block._if(acc.hasSetValue()); JVar $v = cond._then().decl(core.getRawType(), "v" + hashCode());// TODO: unique value control acc.toRawValue(cond._then(),$v); cond._then().assign($var,$v.invoke("getValue")); cond._else().assign($var, JExpr._null()); }
public void toRawValue(JBlock block, JVar $var) { // [RESULT] // if([core.hasSetValue]) // $var = [core.toRawValue].getValue(); // else // $var = null; JConditional cond = block._if(acc.hasSetValue()); JVar $v = cond._then().decl(core.getRawType(), "v" + hashCode());// TODO: unique value control acc.toRawValue(cond._then(),$v); cond._then().assign($var,$v.invoke("getValue")); cond._else().assign($var, JExpr._null()); }
public void toRawValue(JBlock block, JVar $var) { // [RESULT] // if([core.hasSetValue]) // $var = [core.toRawValue].getValue(); // else // $var = null; JConditional cond = block._if(acc.hasSetValue()); JVar $v = cond._then().decl(core.getRawType(), "v" + hashCode());// TODO: unique value control acc.toRawValue(cond._then(),$v); cond._then().assign($var,$v.invoke("getValue")); cond._else().assign($var, JExpr._null()); }
public void toRawValue(JBlock block, JVar $var) { // [RESULT] // if([core.hasSetValue]) // $var = [core.toRawValue].getValue(); // else // $var = null; JConditional cond = block._if(acc.hasSetValue()); JVar $v = cond._then().decl(core.getRawType(), "v" + hashCode());// TODO: unique value control acc.toRawValue(cond._then(),$v); cond._then().assign($var,$v.invoke("getValue")); cond._else().assign($var, JExpr._null()); }
public void toRawValue(JBlock block, JVar $var) { // [RESULT] // if([core.hasSetValue]) // $var = [core.toRawValue].getValue(); // else // $var = null; JConditional cond = block._if(acc.hasSetValue()); JVar $v = cond._then().decl(core.getRawType(), "v" + hashCode());// TODO: unique value control acc.toRawValue(cond._then(),$v); cond._then().assign($var,$v.invoke("getValue")); cond._else().assign($var, JExpr._null()); }
private JMethod addWithIfNotNullMethod(JDefinedClass builderClass, FieldOutline field, JMethod unconditionalWithMethod) { if (field.getRawType().isPrimitive()) return null; String fieldName = field.getPropertyInfo().getName(true); JMethod method = builderClass.method(JMod.PUBLIC, builderClass, "with" + fieldName + "IfNotNull"); JVar param = generateMethodParameter(method, field); JBlock block = method.body(); JConditional conditional = block._if(param.eq(JExpr._null())); conditional._then()._return(JExpr.direct("this")); conditional._else()._return(JExpr.invoke(unconditionalWithMethod).arg(param)); return method; }