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 IndentedWriter toIndentedWriter( Writer w ) { return (w instanceof IndentedWriter ? (IndentedWriter) w : new IndentedWriter(w)); }
protected void writeInternalUtilityFunctions() throws IOException { iw.println("private boolean eqOrBothNull( Object a, Object b )"); iw.println("{"); iw.upIndent(); iw.println("return"); iw.upIndent(); iw.println("a == b ||"); iw.println("(a != null && a.equals(b));"); iw.downIndent(); iw.downIndent(); iw.println("}"); }
public synchronized void generate( ClassInfo info, Property[] props, Writer w) throws IOException { this.info = info; this.props = props; Arrays.sort( props, BeangenUtils.PROPERTY_COMPARATOR ); this.iw = ( w instanceof IndentedWriter ? (IndentedWriter) w : new IndentedWriter(w)); this.generalImports = new TreeSet(); if ( info.getGeneralImports() != null ) generalImports.addAll( Arrays.asList( info.getGeneralImports() ) ); this.specificImports = new TreeSet(); if ( info.getSpecificImports() != null ) specificImports.addAll( Arrays.asList( info.getSpecificImports() ) ); this.interfaceNames = new TreeSet(); if ( info.getInterfaceNames() != null ) interfaceNames.addAll( Arrays.asList( info.getInterfaceNames() ) ); addInternalImports(); addInternalInterfaces(); resolveTypes(); if (! inner ) { writeHeader(); iw.println(); } writeClassDeclaration(); iw.println('{'); iw.upIndent(); writeCoreBody(); iw.downIndent(); iw.println('}'); }
protected void generatePostDelegateCode( Class intfcl, String genclass, Method method, IndentedWriter iw ) throws IOException { if ("setClientInfo".equals(method.getName())) { super.generatePostDelegateCode( intfcl, genclass, method, iw ); iw.downIndent(); iw.println("}"); iw.println("catch (Exception e)"); iw.println("{ throw SqlUtils.toSQLClientInfoException( e ); }"); } else super.generatePostDelegateCode( intfcl, genclass, method, iw ); } }
protected void writeInternalUtilityFunctions() throws IOException { iw.println("private boolean eqOrBothNull( Object a, Object b )"); iw.println("{"); iw.upIndent(); iw.println("return"); iw.upIndent(); iw.println("a == b ||"); iw.println("(a != null && a.equals(b));"); iw.downIndent(); iw.downIndent(); iw.println("}"); }
public synchronized void generate( ClassInfo info, Property[] props, Writer w) throws IOException { this.info = info; this.props = props; Arrays.sort( props, BeangenUtils.PROPERTY_COMPARATOR ); this.iw = ( w instanceof IndentedWriter ? (IndentedWriter) w : new IndentedWriter(w)); this.generalImports = new TreeSet(); if ( info.getGeneralImports() != null ) generalImports.addAll( Arrays.asList( info.getGeneralImports() ) ); this.specificImports = new TreeSet(); if ( info.getSpecificImports() != null ) specificImports.addAll( Arrays.asList( info.getSpecificImports() ) ); this.interfaceNames = new TreeSet(); if ( info.getInterfaceNames() != null ) interfaceNames.addAll( Arrays.asList( info.getInterfaceNames() ) ); addInternalImports(); addInternalInterfaces(); resolveTypes(); if (! inner ) { writeHeader(); iw.println(); } writeClassDeclaration(); iw.println('{'); iw.upIndent(); writeCoreBody(); iw.downIndent(); iw.println('}'); }
protected void generatePostDelegateCode( Class intfcl, String genclass, Method method, IndentedWriter iw ) throws IOException { if ("setClientInfo".equals(method.getName())) { super.generatePostDelegateCode( intfcl, genclass, method, iw ); iw.downIndent(); iw.println("}"); iw.println("catch (Exception e)"); iw.println("{ throw SqlUtils.toSQLClientInfoException( e ); }"); } else super.generatePostDelegateCode( intfcl, genclass, method, iw ); } }
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 writeInternalUtilityFunctions() throws IOException { iw.println("private boolean eqOrBothNull( Object a, Object b )"); iw.println("{"); iw.upIndent(); iw.println("return"); iw.upIndent(); iw.println("a == b ||"); iw.println("(a != null && a.equals(b));"); iw.downIndent(); iw.downIndent(); iw.println("}"); }
this.props = props; Arrays.sort( props, BeangenUtils.PROPERTY_COMPARATOR ); this.iw = ( w instanceof IndentedWriter ? (IndentedWriter) w : new IndentedWriter(w)); iw.println(); iw.println('{'); iw.upIndent(); iw.downIndent(); iw.println('}');