From: Robert L. <rle...@us...> - 2007-02-15 16:47:35
|
Update of /cvsroot/ccmtools/ccmtools/src/ccmtools/generator/java/templates In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv1748/src/ccmtools/generator/java/templates Modified Files: ComponentDefAssemblyClassTemplate.java Log Message: Java assemblies Index: ComponentDefAssemblyClassTemplate.java =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/ccmtools/generator/java/templates/ComponentDefAssemblyClassTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ComponentDefAssemblyClassTemplate.java 15 Feb 2007 13:18:37 -0000 1.1 --- ComponentDefAssemblyClassTemplate.java 15 Feb 2007 16:46:41 -0000 1.2 *************** *** 19,25 **** protected final String TEXT_2 = NL + " * <http://ccmtools.sourceforge.net>" + NL + " * " + NL + " * "; protected final String TEXT_3 = " component business logic." + NL + " *" + NL + " */" + NL + "" + NL + "package "; ! protected final String TEXT_4 = ";" + NL + " " + NL + "import Components.CCMException; " + NL + "import Components.SessionContext; " + NL; protected final String TEXT_5 = NL; ! protected final String TEXT_6 = " " + NL + " " + NL + "/**" + NL + " * This class implements component equivalent and supported interfaces" + NL + " * as well as component attributes." + NL + " * Additionally, session component callback methods must be implemented." + NL + " *" + NL + " * // TODO: WRITE YOUR DESCRIPTION HERE !" + NL + " *" + NL + " * @author" + NL + " * @version" + NL + " */ " + NL + "public class "; protected final String TEXT_7 = "Impl " + NL + " implements "; protected final String TEXT_8 = NL + "{" + NL + " /** Supported interface attribute variables */" + NL; --- 19,25 ---- protected final String TEXT_2 = NL + " * <http://ccmtools.sourceforge.net>" + NL + " * " + NL + " * "; protected final String TEXT_3 = " component business logic." + NL + " *" + NL + " */" + NL + "" + NL + "package "; ! protected final String TEXT_4 = ";" + NL + " " + NL + "import Components.CCMException; " + NL + "import Components.CCMExceptionReason;" + NL + "import Components.SessionContext; " + NL; protected final String TEXT_5 = NL; ! protected final String TEXT_6 = " " + NL + " " + NL + "/**" + NL + " * This class implements component equivalent and supported interfaces" + NL + " * as well as component attributes." + NL + " * Additionally, session component callback methods must be implemented." + NL + " *" + NL + " */ " + NL + "public class "; protected final String TEXT_7 = "Impl " + NL + " implements "; protected final String TEXT_8 = NL + "{" + NL + " /** Supported interface attribute variables */" + NL; *************** *** 27,43 **** protected final String TEXT_10 = " " + NL + " " + NL + "" + NL + " /** Component attribute variables */" + NL + " "; protected final String TEXT_11 = NL; ! 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 + " "; protected final String TEXT_17 = NL; ! protected final String TEXT_18 = " " + NL + "" + NL + "" + NL + " /** Component attribute accessor methods */" + NL; protected final String TEXT_19 = NL; ! protected final String TEXT_20 = " " + NL + "" + NL + "" + NL + " /** Facet implementation factory methods */" + NL + " "; protected final String TEXT_21 = NL; ! protected final String TEXT_22 = " " + 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_23 = "_Context)ctx; " + NL + " }" + NL + "" + NL + " public void ccm_activate() " + NL + " throws CCMException" + NL + " {" + NL + " // OPTIONAL: IMPLEMENT ME HERE !" + NL + " }" + NL + "" + NL + " public void ccm_passivate() " + NL + " throws CCMException" + NL + " {" + NL + " // OPTIONAL: IMPLEMENT ME HERE !" + NL + " }" + NL + "" + NL + " public void ccm_remove() " + NL + " throws CCMException" + NL + " {" + NL + " // OPTIONAL: IMPLEMENT ME HERE !" + NL + " }" + NL + "}"; ! protected final String TEXT_24 = NL; public String generate(Object argument) --- 27,45 ---- protected final String TEXT_10 = " " + NL + " " + NL + "" + NL + " /** Component attribute variables */" + NL + " "; protected final String TEXT_11 = NL; ! protected final String TEXT_12 = " " + NL + " "; ! protected final String TEXT_13 = NL; ! 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 + " // OPTIONAL: IMPLEMENT ME HERE !" + 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 + " // OPTIONAL: IMPLEMENT ME HERE !" + NL + " }" + NL + "" + NL + " public void ccm_passivate() " + NL + " throws CCMException" + NL + " {" + NL + " // OPTIONAL: IMPLEMENT ME HERE !" + NL + " }" + NL + "" + NL + " public void ccm_remove() " + NL + " throws CCMException" + NL + " {" + NL + " // OPTIONAL: IMPLEMENT ME HERE !" + NL + " }" + NL + "}"; ! protected final String TEXT_26 = NL; public String generate(Object argument) *************** *** 85,92 **** stringBuffer.append(TEXT_12); ! stringBuffer.append(component.generateCcmIdentifier()); stringBuffer.append(TEXT_13); ! stringBuffer.append(component.getIdentifier()); stringBuffer.append(TEXT_14); for(Iterator i = component.getSupports().iterator(); i.hasNext();) --- 87,104 ---- stringBuffer.append(TEXT_12); ! ! for(Iterator i=component.getAssemblyAttributeDeclarations(); i.hasNext();) ! { ! stringBuffer.append(TEXT_13); ! stringBuffer.append(i.next().toString()); ! ! } ! stringBuffer.append(TEXT_14); + stringBuffer.append(component.generateCcmIdentifier()); + stringBuffer.append(TEXT_15); + stringBuffer.append(component.getIdentifier()); + stringBuffer.append(TEXT_16); for(Iterator i = component.getSupports().iterator(); i.hasNext();) *************** *** 97,101 **** AttributeDef attr = (AttributeDef)j.next(); ! stringBuffer.append(TEXT_15); stringBuffer.append(attr.generateApplicationImplementation()); --- 109,113 ---- AttributeDef attr = (AttributeDef)j.next(); ! stringBuffer.append(TEXT_17); stringBuffer.append(attr.generateApplicationImplementation()); *************** *** 103,107 **** } ! stringBuffer.append(TEXT_16); for(Iterator i = component.getSupports().iterator(); i.hasNext();) --- 115,119 ---- } ! stringBuffer.append(TEXT_18); for(Iterator i = component.getSupports().iterator(); i.hasNext();) *************** *** 112,116 **** OperationDef op = (OperationDef)j.next(); ! stringBuffer.append(TEXT_17); stringBuffer.append(op.generateApplicationImplementation()); --- 124,128 ---- OperationDef op = (OperationDef)j.next(); ! stringBuffer.append(TEXT_19); stringBuffer.append(op.generateApplicationImplementation()); *************** *** 118,122 **** } ! stringBuffer.append(TEXT_18); for(Iterator i = component.getAttributes().iterator(); i.hasNext();) --- 130,134 ---- } ! stringBuffer.append(TEXT_20); for(Iterator i = component.getAttributes().iterator(); i.hasNext();) *************** *** 124,133 **** AttributeDef attr = (AttributeDef)i.next(); ! stringBuffer.append(TEXT_19); stringBuffer.append(attr.generateApplicationImplementation()); } ! stringBuffer.append(TEXT_20); for(Iterator i = component.getFacet().iterator(); i.hasNext();) --- 136,145 ---- 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();) *************** *** 135,147 **** ProvidesDef provides = (ProvidesDef)i.next(); ! stringBuffer.append(TEXT_21); stringBuffer.append(provides.generateGetMethodImplementation()); } - stringBuffer.append(TEXT_22); - stringBuffer.append(component.generateCcmIdentifier()); - stringBuffer.append(TEXT_23); stringBuffer.append(TEXT_24); return stringBuffer.toString(); } --- 147,159 ---- ProvidesDef provides = (ProvidesDef)i.next(); ! stringBuffer.append(TEXT_23); stringBuffer.append(provides.generateGetMethodImplementation()); } stringBuffer.append(TEXT_24); + stringBuffer.append(component.generateCcmIdentifier()); + stringBuffer.append(TEXT_25); + stringBuffer.append(TEXT_26); return stringBuffer.toString(); } |