@Override public String getDefaultGeneratedPropertyName(ProcessModel context, CPropertyInfo propertyInfo) { // TODO Allow for customization return propertyInfo.getName(true) + "Object"; }
@Override public String getDefaultGeneratedPropertyName(ProcessModel context, CPropertyInfo propertyInfo) { return propertyInfo.getName(true) + "Item"; }
/** * Gets a propery by name. */ public CPropertyInfo getProperty(String name) { // TODO: does this method need to be fast? for( CPropertyInfo p : properties ) if(p.getName(false).equals(name)) return p; return null; }
/** * Generates the field declaration. */ protected final JFieldVar generateField( JType type ) { return outline.implClass.field( JMod.PROTECTED, type, prop.getName(false) ); }
/** * Reads fields of the super class and includes them * to name collision tests. */ void readSuperClass( CClassInfo base ) { for( ; base!=null; base=base.getBaseClass() ) { for( CPropertyInfo p : base.getProperties() ) occupiedLabels.put(p.getName(true),p); } } }
public SingleMarshallingReferenceField(ClassOutlineImpl context, CPropertyInfo prop, CPropertyInfo core, String contextPath, boolean _final) { super(context, prop, core); this.contextPath = context.implClass.field(JMod.PUBLIC | JMod.STATIC | (_final ? JMod.FINAL : JMod.NONE), String.class, prop .getName(true) + "ContextPath", JExpr.lit(contextPath)); }
public JExpression getCore() { if (coreField != null) { return coreField; } else { return JExpr._this().invoke("get" + core.getName(true)); } }
public static JFieldVar field(FieldOutline fieldOutline) { final JDefinedClass theClass = fieldOutline.parent().implClass; return theClass.fields().get( fieldOutline.getPropertyInfo().getName(false)); }
/** * Gets the name of the getter method. * * <p> * This encapsulation is necessary because sometimes we use * {@code isXXXX} as the method name. */ protected String getGetterMethod() { return (getFieldType().boxify().getPrimitiveType()==codeModel.BOOLEAN?"is":"get")+prop.getName(true); }
public void setCore(JBlock block, JExpression value) { if (coreField != null) { block.assign(coreField, value); } else { block.invoke("set" + core.getName(true)).arg(value); } }
protected JFieldRef createField() { final JFieldVar field = outline.implClass.field(JMod.PROTECTED + JMod.TRANSIENT, propertyListType, property.getName(false)); // field.annotate(XmlTransient.class); return JExpr._this().ref(field); }
protected final void generateArray() { field = outline.implClass.field( JMod.PROTECTED, getCoreListType(), prop.getName(false) ); annotate(field); // generate the rest of accessors generateAccessors(); }
protected final void generateArray() { field = outline.implClass.field( JMod.PROTECTED, getCoreListType(), prop.getName(false) ); annotate(field); // generate the rest of accessors generateAccessors(); }
protected final void generate() { // for the collectionType customization to take effect, the field needs to be strongly typed, // not just List<Foo>. field = outline.implClass.field( JMod.PROTECTED, listT, prop.getName(false) ); if(eagerInstanciation) field.init(newCoreList()); annotate(field); // generate the rest of accessors generateAccessors(); }
private void generateInternalGetter() { internalGetter = outline.implClass.method(JMod.PROTECTED,listT,"_get"+prop.getName(true)); if(!eagerInstanciation) { // if eagerly instanciated, the field can't be null fixNullRef(internalGetter.body()); } internalGetter.body()._return(field); }
public static JMethod setter(FieldOutline fieldOutline) { final JMethod getter = getter(fieldOutline); assert getter != null : "Getter is required."; final JType type = getter.type(); final JDefinedClass theClass = fieldOutline.parent().implClass; final String publicName = fieldOutline.getPropertyInfo().getName(true); final String name = "set" + publicName; return theClass.getMethod(name, new JType[] { type }); }
private void generateInternalGetter() { internalGetter = outline.implClass.method(JMod.PROTECTED,listT,"_get"+prop.getName(true)); if(!eagerInstanciation) { // if eagerly instanciated, the field can't be null fixNullRef(internalGetter.body()); } internalGetter.body()._return(field); }
private void generateInternalGetter() { internalGetter = outline.implClass.method(JMod.PROTECTED,listT,"_get"+prop.getName(true)); if(!eagerInstanciation) { // if eagerly instanciated, the field can't be null fixNullRef(internalGetter.body()); } internalGetter.body()._return(field); }
private void generateInternalGetter() { internalGetter = outline.implClass.method(JMod.PROTECTED,listT,"_get"+prop.getName(true)); if(!eagerInstanciation) { // if eagerly instanciated, the field can't be null fixNullRef(internalGetter.body()); } internalGetter.body()._return(field); }
public static JMethod setter(FieldOutline fieldOutline) { final JMethod getter = getter(fieldOutline); assert getter != null : "Getter is required."; final JType type = getter.type(); final JDefinedClass theClass = fieldOutline.parent().implClass; final String publicName = fieldOutline.getPropertyInfo().getName(true); final String name = "set" + publicName; return theClass.getMethod(name, new JType[] { type }); }