public static void writeExplicitDefaultConstructor( int ctor_modifiers, ClassInfo info, IndentedWriter iw) throws IOException { iw.print( CodegenUtils.getModifierString( ctor_modifiers ) ); iw.println(' ' + info.getClassName() + "()"); iw.println("{}"); }
public static void writeExplicitDefaultConstructor( int ctor_modifiers, ClassInfo info, IndentedWriter iw) throws IOException { iw.print( CodegenUtils.getModifierString( ctor_modifiers ) ); iw.println(' ' + info.getClassName() + "()"); iw.println("{}"); }
public static void writeExplicitDefaultConstructor( int ctor_modifiers, ClassInfo info, IndentedWriter iw) throws IOException { iw.print( CodegenUtils.getModifierString( ctor_modifiers ) ); iw.println(' ' + info.getClassName() + "()"); iw.println("{}"); }
protected void generateExtraDeclarations( Class intfcl, String genclass, IndentedWriter iw ) throws IOException { super.generateExtraDeclarations( intfcl, genclass, iw ); iw.println(); iw.println("Object creator;"); iw.println("Object creatorProxy;"); iw.println("NewProxyConnection proxyConn;"); iw.println(); iw.print( CodegenUtils.fqcnLastElement( genclass ) ); iw.println("( " + CodegenUtils.simpleClassName( intfcl ) + " inner, NewPooledConnection parentPooledConnection, Object c, Object cProxy )"); iw.println("{"); iw.upIndent(); iw.println("this( inner, parentPooledConnection );"); iw.println("this.creator = c;"); iw.println("this.creatorProxy = cProxy;"); iw.println("if (creatorProxy instanceof NewProxyConnection) this.proxyConn = (NewProxyConnection) cProxy;"); iw.downIndent(); iw.println("}"); }
protected void generateExtraDeclarations( Class intfcl, String genclass, IndentedWriter iw ) throws IOException { super.generateExtraDeclarations( intfcl, genclass, iw ); iw.println(); iw.println("NewProxyConnection proxyCon;"); iw.println(); iw.print( CodegenUtils.fqcnLastElement( genclass ) ); iw.println("( " + CodegenUtils.simpleClassName( intfcl ) + " inner, NewPooledConnection parentPooledConnection, NewProxyConnection proxyCon )"); iw.println("{"); iw.upIndent(); iw.println("this( inner, parentPooledConnection );"); iw.println("this.proxyCon = proxyCon;"); iw.downIndent(); iw.println("}"); } }
protected void generateExtraDeclarations( Class intfcl, String genclass, IndentedWriter iw ) throws IOException { super.generateExtraDeclarations( intfcl, genclass, iw ); iw.println(); iw.println("NewProxyConnection proxyCon;"); iw.println(); iw.print( CodegenUtils.fqcnLastElement( genclass ) ); iw.println("( " + CodegenUtils.simpleClassName( intfcl ) + " inner, NewPooledConnection parentPooledConnection, NewProxyConnection proxyCon )"); iw.println("{"); iw.upIndent(); iw.println("this( inner, parentPooledConnection );"); iw.println("this.proxyCon = proxyCon;"); iw.downIndent(); 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(';'); }
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(';'); }
protected void writeClassDeclaration() throws IOException { iw.print( CodegenUtils.getModifierString( info.getModifiers() ) + " class " + info.getClassName() ); String superclassName = info.getSuperclassName(); if (superclassName != null) iw.print( " extends " + superclassName ); if (interfaceNames.size() > 0) { iw.print(" implements "); boolean first = true; for (Iterator ii = interfaceNames.iterator(); ii.hasNext(); ) { if (first) first = false; else iw.print(", "); iw.print( (String) ii.next() ); } } iw.println(); }
public void generate(ClassInfo info, Class superclassType, Property[] props, Class[] propTypes, IndentedWriter iw) throws IOException { iw.print( CodegenUtils.getModifierString( ctor_modifiers ) ); iw.print( info.getClassName() + "( "); BeangenUtils.writeArgList(props, true, iw); iw.println(" )"); iw.println("{"); iw.upIndent(); for (int i = 0, len = props.length; i < len; ++i) { iw.print("this." + props[i].getName() + " = "); String setExp = props[i].getDefensiveCopyExpression(); if (setExp == null) setExp = props[i].getName(); iw.println(setExp + ';'); } iw.downIndent(); iw.println("}"); } }
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 + "; }"); }
protected void writePropertyGetter( Property prop, Class propType ) throws IOException { String stn = prop.getSimpleTypeName(); String pfx = ("boolean".equals( stn ) ? "is" : "get" ); String methodName = pfx + BeangenUtils.capitalize( prop.getName() ); iw.print( CodegenUtils.getModifierString( prop.getGetterModifiers() ) ); iw.println(' ' + prop.getSimpleTypeName() + ' ' + methodName + "()"); iw.println('{'); iw.upIndent(); iw.println( stn + ' ' + prop.getName() + " = innerBean." + methodName + "();"); String retVal = this.getGetterDefensiveCopyExpression( prop, propType ); if (retVal == null) retVal = prop.getName(); iw.println("return " + retVal + ';'); iw.downIndent(); iw.println('}'); }
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 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 + "; }"); }
protected void writePropertyGetter( Property prop, Class propType ) throws IOException { String stn = prop.getSimpleTypeName(); String pfx = ("boolean".equals( stn ) ? "is" : "get" ); String methodName = pfx + BeangenUtils.capitalize( prop.getName() ); iw.print( CodegenUtils.getModifierString( prop.getGetterModifiers() ) ); iw.println(' ' + prop.getSimpleTypeName() + ' ' + methodName + "()"); iw.println('{'); iw.upIndent(); iw.println( stn + ' ' + prop.getName() + " = innerBean." + methodName + "();"); String retVal = this.getGetterDefensiveCopyExpression( prop, propType ); if (retVal == null) retVal = prop.getName(); iw.println("return " + retVal + ';'); iw.downIndent(); iw.println('}'); }
protected void writePropertyGetter( Property prop, Class propType ) throws IOException { String stn = prop.getSimpleTypeName(); String pfx = ("boolean".equals( stn ) ? "is" : "get" ); String methodName = pfx + BeangenUtils.capitalize( prop.getName() ); iw.print( CodegenUtils.getModifierString( prop.getGetterModifiers() ) ); iw.println(' ' + prop.getSimpleTypeName() + ' ' + methodName + "()"); iw.println('{'); iw.upIndent(); iw.println( stn + ' ' + prop.getName() + " = innerBean." + methodName + "();"); String retVal = this.getGetterDefensiveCopyExpression( prop, propType ); if (retVal == null) retVal = prop.getName(); iw.println("return " + retVal + ';'); iw.downIndent(); iw.println('}'); }