protected void writeGetterSetterPairs() throws IOException { for (int i = 0, len = props.length; i < len; ++i) { writeGetterSetterPair( props[i], propertyTypes[i] ); if ( i != len - 1) iw.println(); } }
protected void generateDelegateCode( Class intfcl, String genclass, Method method, IndentedWriter iw ) throws IOException { Class retType = method.getReturnType(); iw.println( (retType == void.class ? "" : "return " ) + "inner." + CodegenUtils.methodCall( method ) + ";" ); }
protected void writeStoreObject( Property prop, Class propType, IndentedWriter iw ) throws IOException { iw.println("oos.writeObject( " + prop.getName() + " );"); }
protected void writeOtherVariables() throws IOException { iw.println( CodegenUtils.getModifierString( inner_bean_member_modifiers ) + ' ' + findInnerBeanClassName() + " innerBean = " + findInnerBeanInitializationExpression() + ';'); iw.println(); iw.println( CodegenUtils.getModifierString( inner_bean_accessor_modifiers ) + ' ' + findInnerBeanClassName() + " accessInnerBean()"); iw.println("{ return innerBean; }"); }
protected void writeGetterSetterPair( Property prop, Class propType ) throws IOException { writePropertyGetter( prop, propType ); if (! prop.isReadOnly() && ! force_unmodifiable) { iw.println(); writePropertySetter( prop, propType ); } }
protected void writeGetterSetterPair( Property prop, Class propType ) throws IOException { writePropertyGetter( prop, propType ); if (! prop.isReadOnly() && ! force_unmodifiable) { iw.println(); writePropertySetter( prop, propType ); } }
public static void writePropertyGetter( Property prop, String defensiveCopyExpression, IndentedWriter iw ) throws IOException { String pfx = ("boolean".equals( prop.getSimpleTypeName() ) ? "is" : "get" ); iw.print( CodegenUtils.getModifierString( prop.getGetterModifiers() ) ); iw.println(' ' + prop.getSimpleTypeName() + ' ' + pfx + BeangenUtils.capitalize( prop.getName() ) + "()"); String retVal = defensiveCopyExpression; if (retVal == null) retVal = prop.getName(); iw.println("{ return " + retVal + "; }"); }
public static void writePropertyVariable( Property prop, String defaultValueExpression, IndentedWriter iw ) throws IOException { iw.print( CodegenUtils.getModifierString( prop.getVariableModifiers() ) ); iw.print( ' ' + prop.getSimpleTypeName() + ' ' + prop.getName()); String dflt = defaultValueExpression; if (dflt != null) iw.print( " = " + dflt ); iw.println(';'); }
public static void writePropertyVariable( Property prop, String defaultValueExpression, IndentedWriter iw ) throws IOException { iw.print( CodegenUtils.getModifierString( prop.getVariableModifiers() ) ); iw.print( ' ' + prop.getSimpleTypeName() + ' ' + prop.getName()); String dflt = defaultValueExpression; if (dflt != null) iw.print( " = " + dflt ); iw.println(';'); }
public static void writePropertyVariable( Property prop, String defaultValueExpression, IndentedWriter iw ) throws IOException { iw.print( CodegenUtils.getModifierString( prop.getVariableModifiers() ) ); iw.print( ' ' + prop.getSimpleTypeName() + ' ' + prop.getName()); String dflt = defaultValueExpression; if (dflt != null) iw.print( " = " + dflt ); iw.println(';'); }