From: Robert L. <rle...@us...> - 2007-02-26 15:49:46
|
Update of /cvsroot/ccmtools/ccmtools/src/ccmtools/generator/java/templates In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv18212/src/ccmtools/generator/java/templates Modified Files: ComponentDefApplicationClassTemplate.java ComponentDefAssemblyClassTemplate.java Log Message: component implementation class: *) throws CCMException *) assembly: creates all inner components Index: ComponentDefAssemblyClassTemplate.java =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/ccmtools/generator/java/templates/ComponentDefAssemblyClassTemplate.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ComponentDefAssemblyClassTemplate.java 20 Feb 2007 07:23:53 -0000 1.6 --- ComponentDefAssemblyClassTemplate.java 26 Feb 2007 15:49:42 -0000 1.7 *************** *** 31,46 **** protected final String TEXT_14 = " " + NL + "" + NL + " public "; protected final String TEXT_15 = "_Context ctx;" + NL + " " + NL + " " + NL + " public "; ! protected final String TEXT_16 = "Impl()" + NL + " {" + NL + " }" + NL + "" + NL + "" + NL + " /* " + NL + " * Supported interface methods " + NL + " */" + NL + "" + NL + " /** Supported interface attributes */" + NL; protected final String TEXT_17 = NL; ! protected final String TEXT_18 = " " + NL + " " + NL + " " + NL + " /** Supported interface methods */" + NL + " "; protected final String TEXT_19 = NL; ! protected final String TEXT_20 = " " + NL + "" + NL + "" + NL + " /** Component attribute accessor methods */" + NL; protected final String TEXT_21 = NL; ! protected final String TEXT_22 = " " + NL + "" + NL + "" + NL + " /** Facet implementation factory methods */" + NL + " "; protected final String TEXT_23 = NL; ! protected final String TEXT_24 = " " + NL + "" + NL + " /** Component callback methods */" + NL + " " + NL + " public void set_session_context(SessionContext ctx) " + NL + " throws CCMException" + NL + " {" + NL + " this.ctx = ("; ! protected final String TEXT_25 = "_Context)ctx; " + NL + " }" + NL + "" + NL + " public void ccm_activate() " + NL + " throws CCMException" + NL + " {" + NL + " \ttry {" + NL + "\t\t\t// create inner components \t"; ! protected final String TEXT_26 = NL; ! protected final String TEXT_27 = " " + NL + "" + NL + "\t\t\t// setup inner components \t"; protected final String TEXT_28 = NL; protected final String TEXT_29 = " " + NL + "" + NL + "\t\t\t// finish configuration \t"; --- 31,46 ---- protected final String TEXT_14 = " " + NL + "" + NL + " public "; protected final String TEXT_15 = "_Context ctx;" + NL + " " + NL + " " + NL + " public "; ! protected final String TEXT_16 = "Impl()" + NL + " throws CCMException" + NL + " {" + NL + " \ttry {" + NL + "\t\t\t// create inner components \t"; protected final String TEXT_17 = NL; ! protected final String TEXT_18 = " " + NL + " \t} catch(Exception e) {" + NL + " \t\tthrow new CCMException(e.getMessage(), CCMExceptionReason.CREATE_ERROR);" + NL + " \t}" + NL + " }" + NL + "" + NL + "" + NL + " /* " + NL + " * Supported interface methods " + NL + " */" + NL + "" + NL + " /** Supported interface attributes */" + NL; protected final String TEXT_19 = NL; ! protected final String TEXT_20 = " " + NL + " " + NL + " " + NL + " /** Supported interface methods */" + NL + " "; protected final String TEXT_21 = NL; ! protected final String TEXT_22 = " " + NL + "" + NL + "" + NL + " /** Component attribute accessor methods */" + NL; protected final String TEXT_23 = NL; ! protected final String TEXT_24 = " " + NL + "" + NL + "" + NL + " /** Facet implementation factory methods */" + NL + " "; ! protected final String TEXT_25 = NL; ! protected final String TEXT_26 = " " + NL + "" + NL + " /** Component callback methods */" + NL + " " + NL + " public void set_session_context(SessionContext ctx) " + NL + " throws CCMException" + NL + " {" + NL + " this.ctx = ("; ! protected final String TEXT_27 = "_Context)ctx; " + NL + " }" + NL + "" + NL + " public void ccm_activate() " + NL + " throws CCMException" + NL + " {" + NL + " \ttry {" + NL + "\t\t\t// setup inner components \t"; protected final String TEXT_28 = NL; protected final String TEXT_29 = " " + NL + "" + NL + "\t\t\t// finish configuration \t"; *************** *** 112,115 **** --- 112,125 ---- stringBuffer.append(TEXT_16); + for(Iterator i=component.getAssemblyAttributeInitialisation(); i.hasNext();) + { + + stringBuffer.append(TEXT_17); + stringBuffer.append(i.next().toString()); + + } + + stringBuffer.append(TEXT_18); + for(Iterator i = component.getSupports().iterator(); i.hasNext();) { *************** *** 119,123 **** AttributeDef attr = (AttributeDef)j.next(); ! stringBuffer.append(TEXT_17); stringBuffer.append(attr.generateApplicationImplementation()); --- 129,133 ---- AttributeDef attr = (AttributeDef)j.next(); ! stringBuffer.append(TEXT_19); stringBuffer.append(attr.generateApplicationImplementation()); *************** *** 125,129 **** } ! stringBuffer.append(TEXT_18); for(Iterator i = component.getSupports().iterator(); i.hasNext();) --- 135,139 ---- } ! stringBuffer.append(TEXT_20); for(Iterator i = component.getSupports().iterator(); i.hasNext();) *************** *** 134,138 **** OperationDef op = (OperationDef)j.next(); ! stringBuffer.append(TEXT_19); stringBuffer.append(op.generateApplicationImplementation()); --- 144,148 ---- OperationDef op = (OperationDef)j.next(); ! stringBuffer.append(TEXT_21); stringBuffer.append(op.generateApplicationImplementation()); *************** *** 140,144 **** } ! stringBuffer.append(TEXT_20); for(Iterator i = component.getAttributes().iterator(); i.hasNext();) --- 150,154 ---- } ! stringBuffer.append(TEXT_22); for(Iterator i = component.getAttributes().iterator(); i.hasNext();) *************** *** 146,155 **** AttributeDef attr = (AttributeDef)i.next(); ! stringBuffer.append(TEXT_21); stringBuffer.append(attr.generateApplicationImplementation()); } ! stringBuffer.append(TEXT_22); for(Iterator i = component.getFacet().iterator(); i.hasNext();) --- 156,165 ---- AttributeDef attr = (AttributeDef)i.next(); ! stringBuffer.append(TEXT_23); stringBuffer.append(attr.generateApplicationImplementation()); } ! stringBuffer.append(TEXT_24); for(Iterator i = component.getFacet().iterator(); i.hasNext();) *************** *** 157,177 **** ProvidesDef provides = (ProvidesDef)i.next(); ! stringBuffer.append(TEXT_23); stringBuffer.append(provides.generateGetMethodAssemblyImplementation()); } - stringBuffer.append(TEXT_24); - stringBuffer.append(component.generateCcmIdentifier()); - stringBuffer.append(TEXT_25); - - for(Iterator i=component.getAssemblyAttributeInitialisation(); i.hasNext();) - { - stringBuffer.append(TEXT_26); ! stringBuffer.append(i.next().toString()); ! ! } ! stringBuffer.append(TEXT_27); --- 167,177 ---- ProvidesDef provides = (ProvidesDef)i.next(); ! stringBuffer.append(TEXT_25); stringBuffer.append(provides.generateGetMethodAssemblyImplementation()); } stringBuffer.append(TEXT_26); ! stringBuffer.append(component.generateCcmIdentifier()); stringBuffer.append(TEXT_27); Index: ComponentDefApplicationClassTemplate.java =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/ccmtools/generator/java/templates/ComponentDefApplicationClassTemplate.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ComponentDefApplicationClassTemplate.java 10 Jan 2007 16:19:13 -0000 1.12 --- ComponentDefApplicationClassTemplate.java 26 Feb 2007 15:49:42 -0000 1.13 *************** *** 29,33 **** protected final String TEXT_12 = " " + NL + "" + NL + " public "; protected final String TEXT_13 = "_Context ctx;" + NL + " " + NL + " " + NL + " public "; ! protected final String TEXT_14 = "Impl()" + NL + " {" + NL + " // OPTIONAL: IMPLEMENT ME HERE !" + NL + " }" + NL + "" + NL + "" + NL + " /* " + NL + " * Supported interface methods " + NL + " */" + NL + "" + NL + " /** Supported interface attributes */" + NL; protected final String TEXT_15 = NL; protected final String TEXT_16 = " " + NL + " " + NL + " " + NL + " /** Supported interface methods */" + NL + " "; --- 29,33 ---- protected final String TEXT_12 = " " + NL + "" + NL + " public "; protected final String TEXT_13 = "_Context ctx;" + NL + " " + NL + " " + NL + " public "; ! protected final String TEXT_14 = "Impl()" + NL + " throws CCMException" + NL + " {" + NL + " // OPTIONAL: IMPLEMENT ME HERE !" + NL + " }" + NL + "" + NL + "" + NL + " /* " + NL + " * Supported interface methods " + NL + " */" + NL + "" + NL + " /** Supported interface attributes */" + NL; protected final String TEXT_15 = NL; protected final String TEXT_16 = " " + NL + " " + NL + " " + NL + " /** Supported interface methods */" + NL + " "; |