From: Robert L. <rle...@us...> - 2007-02-15 13:18:42
|
Update of /cvsroot/ccmtools/ccmtools/src/ccmtools/generator/java/templates/jet In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv15719/src/ccmtools/generator/java/templates/jet Added Files: ComponentDefAssemblyClass.jet Log Message: Java assemblies --- NEW FILE: ComponentDefAssemblyClass.jet --- <%@ jet package="ccmtools.generator.java.templates" class="ComponentDefAssemblyClassTemplate" imports="java.util.Iterator ccmtools.generator.java.metamodel.* " %> <% ComponentDef component = (ComponentDef) argument; %> /** * This file was automatically generated by <%=component.generateCcmtoolsVersion()%> * <http://ccmtools.sourceforge.net> * * <%=component.generateCcmIdentifier()%> component business logic. * */ package <%=component.generateJavaNamespace()%>; import Components.CCMException; import Components.SessionContext; <%=component.generateJavaImportStatements()%> /** * This class implements component equivalent and supported interfaces * as well as component attributes. * Additionally, session component callback methods must be implemented. * * // TODO: WRITE YOUR DESCRIPTION HERE ! * * @author * @version */ public class <%=component.getIdentifier()%>Impl implements <%=component.generateCcmIdentifier()%> { /** Supported interface attribute variables */ <% for(Iterator i = component.getSupports().iterator(); i.hasNext();) { SupportsDef supports = (SupportsDef)i.next(); for(Iterator j = supports.getInterface().getAllAttributes().iterator(); j.hasNext();) { AttributeDef attr = (AttributeDef)j.next(); %> <%=attr.generateApplicationDeclaration()%> <% } } %> /** Component attribute variables */ <% for(Iterator i=component.getAttributes().iterator(); i.hasNext();) { AttributeDef attr = (AttributeDef)i.next(); %> <%=attr.generateApplicationDeclaration()%> <% } %> public <%=component.generateCcmIdentifier()%>_Context ctx; public <%=component.getIdentifier()%>Impl() { // OPTIONAL: IMPLEMENT ME HERE ! } /* * Supported interface methods */ /** Supported interface attributes */ <% for(Iterator i = component.getSupports().iterator(); i.hasNext();) { SupportsDef supports = (SupportsDef)i.next(); for(Iterator j = supports.getInterface().getAllAttributes().iterator(); j.hasNext();) { AttributeDef attr = (AttributeDef)j.next(); %> <%=attr.generateApplicationImplementation()%> <% } } %> /** Supported interface methods */ <% for(Iterator i = component.getSupports().iterator(); i.hasNext();) { SupportsDef supports = (SupportsDef)i.next(); for(Iterator j = supports.getInterface().getAllOperations().iterator(); j.hasNext();) { OperationDef op = (OperationDef)j.next(); %> <%=op.generateApplicationImplementation()%> <% } } %> /** Component attribute accessor methods */ <% for(Iterator i = component.getAttributes().iterator(); i.hasNext();) { AttributeDef attr = (AttributeDef)i.next(); %> <%=attr.generateApplicationImplementation()%> <% } %> /** Facet implementation factory methods */ <% for(Iterator i = component.getFacet().iterator(); i.hasNext();) { ProvidesDef provides = (ProvidesDef)i.next(); %> <%=provides.generateGetMethodImplementation()%> <% } %> /** Component callback methods */ public void set_session_context(SessionContext ctx) throws CCMException { this.ctx = (<%=component.generateCcmIdentifier()%>_Context)ctx; } public void ccm_activate() throws CCMException { // OPTIONAL: IMPLEMENT ME HERE ! } public void ccm_passivate() throws CCMException { // OPTIONAL: IMPLEMENT ME HERE ! } public void ccm_remove() throws CCMException { // OPTIONAL: IMPLEMENT ME HERE ! } } |