Mail Archive Home | fractal-commits List | November 2006 Index
| <-- Date Index --> | <-- Thread Index --> |
Date: Tuesday, November 21, 2006 @ 12:09:39
Author: rouvoy
Path: /cvsroot/fractal/fraclet/fraclet-xdoc
Modified: build.xml
src/org/objectweb/fractal/fraclet/CompositeDefinitionPlugin.java
src/org/objectweb/fractal/fraclet/CompositeDefinitionPlugin.jelly
src/org/objectweb/fractal/fraclet/Plugin.java
src/org/objectweb/fractal/fraclet/PrimitiveComponentPlugin.vm
src/org/objectweb/fractal/fraclet/PrimitiveDefinitionPlugin.java
* Minor bug correction (composite arguments, lifecycle exceptions)
* Cosmetic updates
-------------------------------------------------------------------+
build.xml | 2
src/org/objectweb/fractal/fraclet/CompositeDefinitionPlugin.java | 145 +-
src/org/objectweb/fractal/fraclet/CompositeDefinitionPlugin.jelly | 53
src/org/objectweb/fractal/fraclet/Plugin.java | 15
src/org/objectweb/fractal/fraclet/PrimitiveComponentPlugin.vm | 583
+++++-----
src/org/objectweb/fractal/fraclet/PrimitiveDefinitionPlugin.java | 90 +
6 files changed, 498 insertions(+), 390 deletions(-)
Index: fraclet/fraclet-xdoc/build.xml
diff -u fraclet/fraclet-xdoc/build.xml:1.7 fraclet/fraclet-xdoc/build.xml:1.8
--- fraclet/fraclet-xdoc/build.xml:1.7 Tue Oct 17 14:27:18 2006
+++ fraclet/fraclet-xdoc/build.xml Tue Nov 21 12:09:39 2006
@@ -255,7 +255,7 @@
<target name="clean" depends="properties,clean.web" description="removes
all generated files">
<delete dir="${out}"/>
<delete failonerror="no">
- <fileset dir="${basedir}" includes="velocity.log*"/>
+ <fileset dir="${basedir}" includes="*.log*"/>
</delete>
</target>
</project>
Index:
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/CompositeDefinitionPlugin.java
diff -u
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/CompositeDefinitionPlugin.java:1.4
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/CompositeDefinitionPlugin.java:1.5
---
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/CompositeDefinitionPlugin.java:1.4
Tue Oct 17 14:27:17 2006
+++
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/CompositeDefinitionPlugin.java
Tue Nov 21 12:09:39 2006
@@ -17,16 +17,17 @@
Initial developer(s): Romain Rouvoy (romain.rouvoy@xxxxxxx)
Contributor(s): .
--------------------------------------------------------------------------------
- $Id: CompositeDefinitionPlugin.java,v 1.4 2006/10/17 12:27:17 rouvoy Exp $
+ $Id: CompositeDefinitionPlugin.java,v 1.5 2006/11/21 11:09:39 rouvoy Exp $
==============================================================================*/
package org.objectweb.fractal.fraclet;
+import java.util.Collection;
+import java.util.HashSet;
import java.util.Iterator;
import org.generama.JellyTemplateEngine;
import org.generama.QDoxCapableMetadataProvider;
import org.generama.WriterMapper;
-import org.objectweb.fractal.fraclet.doclets.AttributeTag;
import org.objectweb.fractal.fraclet.doclets.ProvidesTag;
import com.thoughtworks.qdox.model.JavaClass;
@@ -35,14 +36,16 @@
/**
* XDoclet plugin applied in conjunction with the FractalAdlPlugin.jelly
* template to generate primitive component descriptor file.
+ *
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
public class CompositeDefinitionPlugin extends PrimitiveDefinitionPlugin {
protected static final String ASSEMBLY_SUFFIX = "Composite";
/**
* Composite definition generator for abstract composite.
+ *
* @param jelly the jelly XML template engine.
* @param qdox the qdox java model provider.
* @param writer the file writer mapper.
@@ -50,19 +53,23 @@
public CompositeDefinitionPlugin(JellyTemplateEngine jelly,
QDoxCapableMetadataProvider qdox, WriterMapper writer) {
super(jelly, qdox, writer);
-// setFilereplace("$1.fractal");
+ // setFilereplace("$1.fractal");
}
/**
* param cls the java class source file parsed.
+ *
* @return true if a FractalADL file should be generated.
*/
public boolean shouldGenerate(final Object obj) {
JavaClass cls = (JavaClass) obj;
setDestination(componentPackage(cls), compositeName(cls), "fractal");
- debug("Parsing "+cls.getFullyQualifiedName()+"
["+compositeFullname(cls)+"]...");
- if (!isComponent(cls) || !hasBindings(cls, true)) return false;
- debug("Generating
"+getDestinationPackage(cls)+"/"+getDestinationFilename(cls)+"...");
+ debug("Parsing " + cls.getFullyQualifiedName() + " ["
+ + compositeFullname(cls) + "]...");
+ if (!isComponent(cls) || !hasBindings(cls, true))
+ return false;
+ debug("Generating " + getDestinationPackage(cls) + "/"
+ + getDestinationFilename(cls) + "...");
return true;
}
@@ -71,20 +78,13 @@
}
public String compositeFullname(final JavaClass cls) {
- return (hasPackage(cls))?
componentPackage(cls)+"."+compositeName(cls):compositeName(cls);
+ return (hasPackage(cls)) ? componentPackage(cls) + "."
+ + compositeName(cls) : compositeName(cls);
}
- /* (non-Javadoc)
- * @see
org.objectweb.fractal.fraclet.PrimitiveDefinitionPlugin#extendsElement(com.thoughtworks.qdox.model.JavaClass)
- */
- protected String extendsElement(final JavaClass cls) {
- if (cls != null && isComponent(cls))
- return DEFINITION_SEP + compositeFullname(cls);
- return super.extendsElement(cls);
- }
-
/**
* Provides the instance of the class element named name.
+ *
* @param name the name of the class to find.
* @return the associated Java model element (null if not found).
*/
@@ -96,9 +96,10 @@
}
return null;
}
-
+
/**
- * Provides the name of a server interface compatible with its
reference.
+ * Provides the name of a server interface compatible with its reference.
+ *
* @param fld the reference of a server interface.
* @return the name of the server interface.
*/
@@ -106,46 +107,98 @@
String name = bindingSignature(fld);
JavaClass itf = interfaceClass(name);
if (itf != null)
- return interfaceName(itf,
(ProvidesTag)itf.getTagByName(PROVIDES, true));
+ return interfaceName(itf, (ProvidesTag)
itf.getTagByName(PROVIDES,
+ true));
int dot = name.lastIndexOf(".");
- return dot < 0 ? name.toLowerCase() : name.substring(dot +
1).toLowerCase();
+ return dot < 0 ? name.toLowerCase() : name.substring(dot + 1)
+ .toLowerCase();
}
-
/**
- * Provides the parameters of the component definition.
- * @param cls the class considered.
- * @return the list of parameters.
- */
- public String componentParameters(final JavaClass cls) {
- JavaField[] attrs = attributes(cls, true);
- StringBuffer args = new StringBuffer();
- for (int i = 0; i < attrs.length; i++) {
- AttributeTag tag = (AttributeTag)
attrs[i].getTagByName(ATTRIBUTE_NAME);
- args.append(DEFINITION_SEP + attributeName(attrs[i]));
- if (tag.getValue_() != null)
args.append("=>${"+attributeName(attrs[i])+"}");
- }
- return args.length() > 0 ?
"("+args.substring(DEFINITION_SEP.length())+")" : "";
- }
-
- /**
* Provides the list of arguments required by the component.
+ *
* @param cls the java class source file parsed.
* @return a comma separated list of argument for the component (null if
no
* arguments).
*/
public String argumentsDefinition(final JavaClass cls) {
String primitiveArguments = super.argumentsDefinition(cls);
- StringBuffer buffer = new StringBuffer(primitiveArguments);
+ StringBuffer buffer = new StringBuffer();
+ if (primitiveArguments != null)
+ buffer.append(primitiveArguments);
+ buffer.append(DEFINITION_SEP + "client=client");
JavaField[] bindings = bindings(cls, true);
- for (int i=0; i<bindings.length;i++)
-
buffer.append(DEFINITION_SEP+bindingName(bindings[i])+"="+bindingName(bindings[i]));
- if (buffer.length()==0) return null;
- if (primitiveArguments.length()==0) return
buffer.substring(DEFINITION_SEP.length());
+ for (int i = 0; i < bindings.length; i++)
+ buffer.append(DEFINITION_SEP + bindingName(bindings[i]) + "="
+ + bindingName(bindings[i]));
+ if (primitiveArguments == null)
+ return buffer.substring(DEFINITION_SEP.length());
return buffer.toString();
}
-
- public String asArgument(final JavaField f) {
- return "${"+bindingName(f)+"}";
+
+ public String primitiveParameters(final JavaClass cls) {
+ return super.definitionParameters(cls);
+ }
+
+ /* (non-Javadoc)
+ * @see
org.objectweb.fractal.fraclet.PrimitiveDefinitionPlugin#extendsElement(com.thoughtworks.qdox.model.JavaClass)
+ */
+ protected String extendsElement(final JavaClass cls) {
+ if (cls == null)
+ return "";
+ if (isComponent(cls) && hasBindings(cls, true))
+ return DEFINITION_SEP + compositeFullname(cls)
+ + definitionParameters(cls);
+ if (isComponent(cls))
+ return "";
+ return super.extendsElement(cls);
+ }
+
+ /* (non-Javadoc)
+ * @see
org.objectweb.fractal.fraclet.PrimitiveDefinitionPlugin#definitionParameters(com.thoughtworks.qdox.model.JavaClass)
+ */
+ public String definitionParameters(final JavaClass cls) {
+ String def = super.definitionParameters(cls);
+ StringBuffer buffer = new StringBuffer();
+ if (def.length() > 0)
+ buffer.append(DEFINITION_SEP + def.substring(1, def.length() -
1));
+ JavaField[] bindings = bindings(cls, true);
+ if (bindings.length > 0)
+ buffer.append(DEFINITION_SEP + "client=>${client}");
+ for (int i = 0; i < bindings.length; i++)
+ buffer.append(DEFINITION_SEP + bindingName(bindings[i]) + "=>${"
+ + bindingName(bindings[i]) + "}");
+ return buffer.length() > 0 ? "("
+ + buffer.substring(DEFINITION_SEP.length()) + ")" : "";
+ }
+
+ public String asArgument(String s) {
+ return "${" + s + "}";
+ }
+
+ protected Collection classTags(final JavaClass cls, final String tag,
+ final boolean itf) {
+ HashSet result = new HashSet();
+ if (cls.getTagByName(tag) != null)
+ result.add(cls);
+ if (cls.getSuperJavaClass() != null)
+ result.addAll(classTags(cls.getSuperJavaClass(), tag, true));
+ if (!itf) return result;
+ JavaClass[] itfs = cls.getImplementedInterfaces();
+ for (int i = 0; i < itfs.length; i++)
+ result.addAll(classTags(itfs[i], tag, true));
+ return result;
+ }
+
+ public JavaClass[] providedInterfaces(final JavaClass cls,
+ final boolean itf) {
+ Collection prov = classTags(cls, PROVIDES, itf);
+ Collection res = new HashSet();
+ for (Iterator i = prov.iterator();i.hasNext();) {
+ JavaClass c = (JavaClass) i.next();
+ if (cls==c || !hasBindings(c, false))
+ res.add(c);
+ }
+ return (JavaClass[]) res.toArray(new JavaClass[res.size()]);
}
}
\ No newline at end of file
Index:
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/CompositeDefinitionPlugin.jelly
diff -u
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/CompositeDefinitionPlugin.jelly:1.5
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/CompositeDefinitionPlugin.jelly:1.6
---
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/CompositeDefinitionPlugin.jelly:1.5
Tue Oct 17 14:27:17 2006
+++
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/CompositeDefinitionPlugin.jelly
Tue Nov 21 12:09:39 2006
@@ -1,39 +1,46 @@
<j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml">
<x:doctype name="definition"
- publicId="-//objectweb.org//DTD Fractal ADL 2.0//EN"
- systemId="classpath://org/objectweb/fractal/adl/xml/standard.dtd"/>
-
+ publicId="-//objectweb.org//DTD Fractal ADL 2.0//EN"
+
systemId="classpath://org/objectweb/fractal/adl/xml/standard.dtd"/>
+
<x:comment text="${dontedit}" trim="true"/>
<definition name="${plugin.compositeFullname(metadata)}"
- extends="${plugin.extendsDefinition(metadata)}"
- arguments="${plugin.argumentsDefinition(metadata)}">
-<j:forEach var="tag" items="${metadata.getTagsByName('provides',false)}">
- <interface name="${plugin.interfaceName(metadata,tag)}" role="server"
- signature="${plugin.interfaceSignature(metadata,tag)}"/>
+ extends="${plugin.extendsDefinition(metadata)}"
+ arguments="${plugin.argumentsDefinition(metadata)}">
+<j:forEach var="itf" items="${plugin.providedInterfaces(metadata,false)}">
+ <j:forEach var="tag" items="${itf.getTagsByName('provides',false)}">
+ <interface name="${plugin.interfaceName(itf,tag)}" role="server"
+ signature="${plugin.interfaceSignature(itf,tag)}"/>
+ </j:forEach>
</j:forEach>
- <component name="client"
definition="${plugin.definitionFullname(metadata)}${plugin.definitionParameters(metadata)}"/>
- <!--
+ <component name="${plugin.asArgument('client')}"
+
definition="${plugin.definitionFullname(metadata)}${plugin.primitiveParameters(metadata)}"/>
+<!--
<j:forEach var="clt" items="${plugin.bindings(metadata,false)}">
- <j:if
test="${clt.getTagByName('requires').cardinality.equals('singleton')}">
- <j:if
test="${clt.getTagByName('requires').contingency.equals('mandatory')}">
- <component name="${plugin.bindingName(clt)}"
definition="${plugin.primitiveDefinition(plugin.interfaceClass(plugin.bindingSignature(clt)))}"/>
+ <j:if
test="${clt.getTagByName('requires').cardinality.equals('singleton')}">
+ <j:if
test="${clt.getTagByName('requires').contingency.equals('mandatory')}">
+ <component name="${plugin.asArgument(plugin.bindingName(clt))}"
+
definition="${plugin.definitionFullname(plugin.interfaceClass(plugin.bindingSignature(clt)))}"/>
+ </j:if>
</j:if>
- </j:if>
</j:forEach>
- -->
-
-<j:forEach var="tag" items="${metadata.getTagsByName('provides',true)}">
- <binding client="this.${plugin.interfaceName(metadata,tag)}"
server="client.${plugin.interfaceName(metadata,tag)}"/>
+-->
+
+<j:forEach var="itf" items="${plugin.providedInterfaces(metadata,true)}">
+ <j:forEach var="tag" items="${itf.getTagsByName('provides',false)}">
+ <binding client="this.${plugin.interfaceName(itf,tag)}"
+
server="${plugin.asArgument('client')}.${plugin.interfaceName(itf,tag)}"/>
+ </j:forEach>
</j:forEach>
<j:forEach var="clt" items="${plugin.bindings(metadata,false)}">
- <j:if
test="${clt.getTagByName('requires').cardinality.equals('singleton')}">
- <j:if
test="${clt.getTagByName('requires').contingency.equals('mandatory')}">
- <binding client="client.${plugin.bindingName(clt)}"
-
server="${plugin.asArgument(clt)}.${plugin.abstractInterfaceName(clt)}"/>
+ <j:if
test="${clt.getTagByName('requires').cardinality.equals('singleton')}">
+ <j:if
test="${clt.getTagByName('requires').contingency.equals('mandatory')}">
+ <binding
client="${plugin.asArgument('client')}.${plugin.bindingName(clt)}"
+
server="${plugin.asArgument(plugin.bindingName(clt))}.${plugin.abstractInterfaceName(clt)}"/>
+ </j:if>
</j:if>
- </j:if>
</j:forEach>
</definition>
</j:jelly>
\ No newline at end of file
Index: fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/Plugin.java
diff -u
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/Plugin.java:1.2
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/Plugin.java:1.3
--- fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/Plugin.java:1.2
Tue Oct 17 14:27:17 2006
+++ fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/Plugin.java Tue
Nov 21 12:09:39 2006
@@ -18,7 +18,7 @@
* Initial developer(s): Romain Rouvoy (romain.rouvoy@xxxxxxx)
* Contributor(s): .
*
-----------------------------------------------------------------------------
- * $Id: Plugin.java,v 1.2 2006/10/17 12:27:17 rouvoy Exp $
+ * $Id: Plugin.java,v 1.3 2006/11/21 11:09:39 rouvoy Exp $
*
=============================================================================
*/
package org.objectweb.fractal.fraclet;
@@ -41,7 +41,7 @@
/**
* Abstract Fractal plugin supporting Jelly and Velocity as template engines.
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class Plugin extends QDoxPlugin {
protected static final String OBJECT = "java.lang.Object";
@@ -132,6 +132,17 @@
return super.getDestinationFilename(metadata);
}
+ protected Collection classes(final JavaClass cls, final String doclet,
final boolean all) {
+ ArrayList result = new ArrayList();
+ if (cls.getTagByName(doclet)!=null) result.add(cls);
+ JavaClass[] itf = cls.getImplementedInterfaces();
+ for (int i=0;i<itf.length;i++)
+ result.addAll(classes(itf[i],doclet,all));
+ if (all && (cls.getSuperJavaClass() != null))
+ result.addAll(classes(cls.getSuperJavaClass(), doclet, all));
+ return result;
+ }
+
/**
* Provides a list of filtered fields.
* @param cls the java class source file parsed.
Index:
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/PrimitiveComponentPlugin.vm
diff -u
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/PrimitiveComponentPlugin.vm:1.5
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/PrimitiveComponentPlugin.vm:1.6
---
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/PrimitiveComponentPlugin.vm:1.5
Wed Oct 4 19:14:23 2006
+++
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/PrimitiveComponentPlugin.vm
Tue Nov 21 12:09:39 2006
@@ -1,289 +1,296 @@
-/*==============================================================================
-Fractal XDoclet Plugin - Copyright (C) 2002-2006 INRIA Futurs / LIFL
-Fractal Component Model (contact: fractal@xxxxxxxxxxxxx)
-
-This library is free software; you can redistribute it and/or modify it
under
-the terms of the GNU Lesser General Public License as published by the Free
-Software Foundation; either version 2.1 of the License, or any later version.
-
-This library is distributed in the hope that it will be useful, but WITHOUT
ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A
-PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.
-
-You should have received a copy of the GNU Lesser General Public License
along
-with this library; if not, write to the Free Software Foundation, Inc.,
-59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-Initial developer(s): Romain Rouvoy (romain.rouvoy@xxxxxxx)
-Contributor(s): .
---------------------------------------------------------------------------------
-$Id: PrimitiveComponentPlugin.vm,v 1.5 2006/10/04 17:14:23 rouvoy Exp $
-==============================================================================*/
-#set( $class = $metadata )
-#if( $plugin.hasPackage($class) )
-package $plugin.componentPackage($class) ;
-#end
-
-#set( $needBindingController = $plugin.hasBindings($class,true) ||
$plugin.hasReflects($class,true) )
-
-#if ( $needBindingController )
-import java.util.HashSet;
-
-#if( $plugin.hasReflects($class,true) )
-import org.objectweb.fractal.api.Component;
-#end
-import org.objectweb.fractal.api.NoSuchInterfaceException;
-import org.objectweb.fractal.api.control.BindingController;
-import org.objectweb.fractal.api.control.IllegalBindingException;
-#end
-#if( $plugin.hasLifecycles($class,true) )
-import org.objectweb.fractal.api.control.LifeCycleController;
-import org.objectweb.fractal.api.control.IllegalLifeCycleException;
-#end
-#if( $plugin.hasLogger($class,true) )
-import org.objectweb.util.monolog.api.Loggable;
-import org.objectweb.util.monolog.api.Logger;
-import org.objectweb.util.monolog.api.LoggerFactory;
-
-#end
-
-#if ($class.getPackage())
-import $class.fullyQualifiedName ;
-#end
-
-#set( $bindings = $plugin.bindings($class,true) )
-#set( $attributes = $plugin.attributes($class,true) )
-/**
- * $dontedit
- */
-public class $plugin.componentName($metadata) extends $class.name
$plugin.implementsClause($class) {
-#if( $plugin.hasLogger($class,true) )
-#set ( $log = $plugin.loggers($class,true) )
- private LoggerFactory loggerFactory ;
-
- /* (non-Javadoc)
- * @see org.objectweb.util.monolog.api.Loggable\#getLogger()
- */
- public Logger getLogger() {
- return null ;
- }
-
- /* (non-Javadoc)
- * @see
org.objectweb.util.monolog.api.Loggable\#setLogger(org.objectweb.util.monolog.api.Logger)
- */
- public void setLogger(Logger log) {
- // nothing to do.
- }
-
- /* (non-Javadoc)
- * @see org.objectweb.util.monolog.api.Loggable\#getLoggerFactory()
- */
- public LoggerFactory getLoggerFactory() {
- return this.loggerFactory;
- }
-
- /* (non-Javadoc)
- * @see
org.objectweb.util.monolog.api.Loggable\#setLoggerFactory(org.objectweb.util.monolog.api.LoggerFactory)
- */
- public void setLoggerFactory(LoggerFactory factory) {
- this.loggerFactory = factory;
-#foreach ($l in $log)
- super.$l.name =
getLoggerFactory().getLogger("$plugin.loggerName($l)");
-#end
- }
-
-#end
-#foreach ( $field in $attributes )
-#set( $name = $plugin.attributeMethod($field) )
- /**
- * Setter for the $name attribute.
- * @param value value for the $name attribute.
- */
- public void set$name(final $field.type value) {
- super.$field.name = value ;
- }
-
- /**
- * Getter for the $name attribute.
- * @return value of the $name attribute.
- */
- public $field.type get$name() {
- return super.$field.name ;
- }
-
-#end
-#if ( $needBindingController )
- /* (non-Javadoc)
- * @see org.objectweb.fractal.api.control.BindingController\#listFc()
- */
- public String[] listFc() {
- HashSet _fcBindings_ = new HashSet();
-#foreach ( $binding in $bindings )
-#if ( $binding.getTagByName('requires').cardinality.equals("singleton") )
- if (this.$binding.name != null)
_fcBindings_.add("$plugin.bindingName($binding)");
-#else
- _fcBindings_.addAll(this.${binding.name}.keySet());
-#end
-#end
- return (String[]) _fcBindings_.toArray(new
String[_fcBindings_.size()]);
- }
-
- /* (non-Javadoc)
- * @see
org.objectweb.fractal.api.control.BindingController\#lookupFc(java.lang.String)
- */
- public Object lookupFc(final String name) throws
NoSuchInterfaceException {
-#foreach ( $binding in $bindings )
-#if ( $binding.getTagByName('requires').cardinality.equals("singleton") )
- if(name.equals("$plugin.bindingName($binding)"))
- return super.$binding.name ;
-#else
- if(name.startsWith("$plugin.bindingName($binding)"))
- return super.${binding.name}.get(name);
-#end
- else
-#end
-#if ( $class.isA('org.objectweb.fractal.api.control.BindingController') )
- return super.lookupFc(name);
-#else
- throw new NoSuchInterfaceException("Client interface
\'"+name+"\' is undefined.");
-#end
- }
-
- /* (non-Javadoc)
- * @see
org.objectweb.fractal.api.control.BindingController\#bindFc(java.lang.String,
java.lang.Object)
- */
- public void bindFc(final String name, final Object binding) throws
NoSuchInterfaceException, IllegalBindingException {
- try {
-#if( $plugin.hasLogger($class,true) )
- if(name.equals("logger"))
- setLogger((Logger)binding);
- else if (name.equals("logger-factory"))
- setLoggerFactory((LoggerFactory)binding);
- else
-#end
-#if( $plugin.hasReflects($class,true) )
- if(name.equals("component")) {
- Component _fcComponent_ = (Component) binding ;
-#foreach ( $reflect in $plugin.reflects($class,true) )
-#set ( $controller = $reflect.getTagByName('control').name_ )
- super.$reflect.name = ($reflect.type.value)
_fcComponent_.getFcInterface("$controller");
-#end
- } else
-#end
-#foreach ( $binding in $bindings )
-#if ( $binding.getTagByName('requires').cardinality.equals("singleton") )
- if(name.equals("$plugin.bindingName($binding)"))
- super.$binding.name = ($binding.type.value) binding;
-#else
- if(name.startsWith("$plugin.bindingName($binding)"))
- super.${binding.name}.put(name, binding);
-#end
- else
-#end
-#if ( $class.isA('org.objectweb.fractal.api.control.BindingController') )
- super.bindFc(name,binding);
-#else
- throw new NoSuchInterfaceException("Client interface
\'"+name+"\' is undefined.");
-#end
- } catch (ClassCastException ex) {
- throw new IllegalBindingException("Failure when binding the
"+name+" client interface: "+ex.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see
org.objectweb.fractal.api.control.BindingController\#unbindFc(java.lang.String)
- */
- public void unbindFc(final String name) throws NoSuchInterfaceException {
-#foreach ( $binding in $bindings )
-#if ( $binding.getTagByName('requires').cardinality.equals("singleton") )
- if(name.equals("$plugin.bindingName($binding)"))
- super.$binding.name = null ;
-#else
- if(name.startsWith("$plugin.bindingName($binding)"))
- super.${binding.name}.remove(name);
-#end
- else
-#end
-#if ( $class.isA('org.objectweb.fractal.api.control.BindingController') )
- super.unbindFc(name);
-#else
- throw new NoSuchInterfaceException("Client interface
\'"+name+"\' is undefined.");
-#end
- }
-#end
-#if( $plugin.hasLifecycles($class,true) )
- /* (non-Javadoc)
- * @see
org.objectweb.fractal.api.control.LifeCycleController\#getFcState()
- */
- public String getFcState() { return null; }
-
-#set ( $cycles = $plugin.lifecycles($class,true) )
- /**
- * Component constructor
- */
- public $plugin.componentName($metadata)() {
- super();
-#foreach ( $cycle in $cycles )
-#foreach ( $lcc in $cycle.getTagsByName('lifecycle') )
-#if ( $lcc.when.equals("create") )
- super.${cycle.name}();
-#end
-#end
-#end
- }
-
- /* (non-Javadoc)
- * @see org.objectweb.fractal.api.control.LifeCycleController\#startFc()
- */
- public void startFc() throws IllegalLifeCycleException {
- try {
-#foreach ( $cycle in $cycles )
-#foreach ( $start in $cycle.getTagsByName('lifecycle') )
-#if ( $start.when.equals("start") )
- super.${cycle.name}();
-#end
-#end
-#end
-#if ( $class.isA('org.objectweb.fractal.api.control.LifeCycleController') )
- super.startFc();
-#end
- } catch(Exception e) {
- throw new IllegalLifeCycleException(e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see org.objectweb.fractal.api.control.LifeCycleController\#stopFc()
- */
- public void stopFc() throws IllegalLifeCycleException {
- try {
-#foreach ( $cycle in $cycles )
-#foreach ( $stop in $cycle.getTagsByName('lifecycle') )
-#if ( $stop.when.equals("stop") )
- super.${cycle.name}();
-#end
-#end
-#end
-#if ( $class.isA('org.objectweb.fractal.api.control.LifeCycleController') )
- super.stopFc();
-#end
- } catch(Exception e) {
- throw new IllegalLifeCycleException(e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object\#finalize()
- */
- public void finalize() throws Throwable {
-#foreach ( $cycle in $cycles )
-#foreach ( $lcc in $cycle.getTagsByName('lifecycle') )
-#if ( $lcc.when.equals("destroy") )
- super.${cycle.name}();
-#end
-#end
-#end
- super.finalize();
- }
-#end
+/*==============================================================================
+Fractal XDoclet Plugin - Copyright (C) 2002-2006 INRIA Futurs / LIFL
+Fractal Component Model (contact: fractal@xxxxxxxxxxxxx)
+
+This library is free software; you can redistribute it and/or modify it
under
+the terms of the GNU Lesser General Public License as published by the Free
+Software Foundation; either version 2.1 of the License, or any later version.
+
+This library is distributed in the hope that it will be useful, but WITHOUT
ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A
+PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.
+
+You should have received a copy of the GNU Lesser General Public License
along
+with this library; if not, write to the Free Software Foundation, Inc.,
+59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Initial developer(s): Romain Rouvoy (romain.rouvoy@xxxxxxx)
+Contributor(s): .
+--------------------------------------------------------------------------------
+$Id: PrimitiveComponentPlugin.vm,v 1.6 2006/11/21 11:09:39 rouvoy Exp $
+==============================================================================*/
+#set( $class = $metadata )
+#if( $plugin.hasPackage($class) )
+package $plugin.componentPackage($class) ;
+#end
+
+#set( $needBindingController = $plugin.hasBindings($class,true) ||
$plugin.hasReflects($class,true) )
+
+#if ( $needBindingController )
+import java.util.HashSet;
+
+#if( $plugin.hasReflects($class,true) )
+import org.objectweb.fractal.api.Component;
+#end
+import org.objectweb.fractal.api.NoSuchInterfaceException;
+import org.objectweb.fractal.api.control.BindingController;
+import org.objectweb.fractal.api.control.IllegalBindingException;
+#end
+#if( $plugin.hasLifecycles($class,true) )
+import org.objectweb.fractal.api.control.LifeCycleController;
+import org.objectweb.fractal.api.control.IllegalLifeCycleException;
+#end
+#if( $plugin.hasLogger($class,true) )
+import org.objectweb.util.monolog.api.Loggable;
+import org.objectweb.util.monolog.api.Logger;
+import org.objectweb.util.monolog.api.LoggerFactory;
+
+#end
+
+#if ($class.getPackage())
+import $class.fullyQualifiedName ;
+#end
+
+#set( $bindings = $plugin.bindings($class,true) )
+#set( $attributes = $plugin.attributes($class,true) )
+/**
+ * $dontedit
+ */
+public class $plugin.componentName($metadata) extends $class.name
$plugin.implementsClause($class) {
+#if( $plugin.hasLogger($class,true) )
+#set ( $log = $plugin.loggers($class,true) )
+ private LoggerFactory loggerFactory ;
+
+ /* (non-Javadoc)
+ * @see org.objectweb.util.monolog.api.Loggable\#getLogger()
+ */
+ public Logger getLogger() {
+ return null ;
+ }
+
+ /* (non-Javadoc)
+ * @see
org.objectweb.util.monolog.api.Loggable\#setLogger(org.objectweb.util.monolog.api.Logger)
+ */
+ public void setLogger(Logger log) {
+ // nothing to do.
+ }
+
+ /* (non-Javadoc)
+ * @see org.objectweb.util.monolog.api.Loggable\#getLoggerFactory()
+ */
+ public LoggerFactory getLoggerFactory() {
+ return this.loggerFactory;
+ }
+
+ /* (non-Javadoc)
+ * @see
org.objectweb.util.monolog.api.Loggable\#setLoggerFactory(org.objectweb.util.monolog.api.LoggerFactory)
+ */
+ public void setLoggerFactory(LoggerFactory factory) {
+ this.loggerFactory = factory;
+#foreach ($l in $log)
+ super.$l.name =
getLoggerFactory().getLogger("$plugin.loggerName($l)");
+#end
+ }
+
+#end
+#foreach ( $field in $attributes )
+#set( $name = $plugin.attributeMethod($field) )
+ /**
+ * Setter for the $name attribute.
+ * @param value value for the $name attribute.
+ */
+ public void set$name(final $field.type value) {
+ super.$field.name = value ;
+ }
+
+ /**
+ * Getter for the $name attribute.
+ * @return value of the $name attribute.
+ */
+ public $field.type get$name() {
+ return super.$field.name ;
+ }
+
+#end
+#if ( $needBindingController )
+ /* (non-Javadoc)
+ * @see org.objectweb.fractal.api.control.BindingController\#listFc()
+ */
+ public String[] listFc() {
+ HashSet _fcBindings_ = new HashSet();
+#foreach ( $binding in $bindings )
+#if ( $binding.getTagByName('requires').cardinality.equals("singleton") )
+ if (this.$binding.name != null)
_fcBindings_.add("$plugin.bindingName($binding)");
+#else
+ _fcBindings_.addAll(this.${binding.name}.keySet());
+#end
+#end
+ return (String[]) _fcBindings_.toArray(new
String[_fcBindings_.size()]);
+ }
+
+ /* (non-Javadoc)
+ * @see
org.objectweb.fractal.api.control.BindingController\#lookupFc(java.lang.String)
+ */
+ public Object lookupFc(final String name) throws
NoSuchInterfaceException {
+#foreach ( $binding in $bindings )
+#if ( $binding.getTagByName('requires').cardinality.equals("singleton") )
+ if(name.equals("$plugin.bindingName($binding)"))
+ return super.$binding.name ;
+#else
+ if(name.startsWith("$plugin.bindingName($binding)"))
+ return super.${binding.name}.get(name);
+#end
+#end
+#if ( $class.isA('org.objectweb.fractal.api.control.BindingController') )
+ return super.lookupFc(name);
+#else
+ throw new NoSuchInterfaceException("Client interface
\'"+name+"\' is undefined.");
+#end
+ }
+
+ /* (non-Javadoc)
+ * @see
org.objectweb.fractal.api.control.BindingController\#bindFc(java.lang.String,
java.lang.Object)
+ */
+ public void bindFc(final String name, final Object binding) throws
NoSuchInterfaceException, IllegalBindingException {
+ try {
+#if( $plugin.hasLogger($class,true) )
+ if(name.equals("logger"))
+ setLogger((Logger)binding);
+ else if (name.equals("logger-factory"))
+ setLoggerFactory((LoggerFactory)binding);
+ else
+#end
+#if( $plugin.hasReflects($class,true) )
+ if(name.equals("component")) {
+ Component _fcComponent_ = (Component) binding ;
+#foreach ( $reflect in $plugin.reflects($class,true) )
+#set ( $controller = $reflect.getTagByName('control').name_ )
+ super.$reflect.name = ($reflect.type.value)
_fcComponent_.getFcInterface("$controller");
+#end
+ } else
+#end
+#foreach ( $binding in $bindings )
+#if ( $binding.getTagByName('requires').cardinality.equals("singleton") )
+ if(name.equals("$plugin.bindingName($binding)"))
+ super.$binding.name = ($binding.type.value) binding;
+#else
+ if(name.startsWith("$plugin.bindingName($binding)"))
+ super.${binding.name}.put(name, binding);
+#end
+ else
+#end
+#if ( $class.isA('org.objectweb.fractal.api.control.BindingController') )
+ super.bindFc(name,binding);
+#else
+ throw new NoSuchInterfaceException("Client interface
\'"+name+"\' is undefined.");
+#end
+ } catch (ClassCastException ex) {
+ throw new IllegalBindingException("Failure when binding the
"+name+" client interface: "+ex.getMessage());
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see
org.objectweb.fractal.api.control.BindingController\#unbindFc(java.lang.String)
+ */
+ public void unbindFc(final String name) throws NoSuchInterfaceException {
+#foreach ( $binding in $bindings )
+#if ( $binding.getTagByName('requires').cardinality.equals("singleton") )
+ if(name.equals("$plugin.bindingName($binding)"))
+ super.$binding.name = null ;
+#else
+ if(name.startsWith("$plugin.bindingName($binding)"))
+ super.${binding.name}.remove(name);
+#end
+ else
+#end
+#if ( $class.isA('org.objectweb.fractal.api.control.BindingController') )
+ super.unbindFc(name);
+#else
+ throw new NoSuchInterfaceException("Client interface
\'"+name+"\' is undefined.");
+#end
+ }
+#end
+#if( $plugin.hasLifecycles($class,true) )
+ /* (non-Javadoc)
+ * @see
org.objectweb.fractal.api.control.LifeCycleController\#getFcState()
+ */
+ public String getFcState() { return null; }
+
+#set ( $cycles = $plugin.lifecycles($class,true) )
+ /**
+ * Component constructor
+ */
+ public $plugin.componentName($metadata)() {
+ super();
+ try {
+#foreach ( $cycle in $cycles )
+#foreach ( $lcc in $cycle.getTagsByName('lifecycle') )
+#if ( $lcc.when.equals("create") )
+ super.${cycle.name}();
+#end
+#end
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+#end
+ }
+
+ /* (non-Javadoc)
+ * @see org.objectweb.fractal.api.control.LifeCycleController\#startFc()
+ */
+ public void startFc() throws IllegalLifeCycleException {
+ try {
+#foreach ( $cycle in $cycles )
+#foreach ( $start in $cycle.getTagsByName('lifecycle') )
+#if ( $start.when.equals("start") )
+ super.${cycle.name}();
+#end
+#end
+#end
+#if ( $class.isA('org.objectweb.fractal.api.control.LifeCycleController') )
+ super.startFc();
+#end
+ } catch(Exception e) {
+ IllegalLifeCycleException illegal = new
IllegalLifeCycleException("Error when component starts: "+e.getMessage());
+ illegal.initCause(e);
+ throw illegal;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.objectweb.fractal.api.control.LifeCycleController\#stopFc()
+ */
+ public void stopFc() throws IllegalLifeCycleException {
+ try {
+#foreach ( $cycle in $cycles )
+#foreach ( $stop in $cycle.getTagsByName('lifecycle') )
+#if ( $stop.when.equals("stop") )
+ super.${cycle.name}();
+#end
+#end
+#end
+#if ( $class.isA('org.objectweb.fractal.api.control.LifeCycleController') )
+ super.stopFc();
+#end
+ } catch(Exception e) {
+ IllegalLifeCycleException illegal = new
IllegalLifeCycleException("Error when component stops: "+e.getMessage());
+ illegal.initCause(e);
+ throw illegal;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object\#finalize()
+ */
+ public void finalize() throws Throwable {
+#foreach ( $cycle in $cycles )
+#foreach ( $lcc in $cycle.getTagsByName('lifecycle') )
+#if ( $lcc.when.equals("destroy") )
+ super.${cycle.name}();
+#end
+#end
+#end
+ super.finalize();
+ }
+#end
}
\ No newline at end of file
Index:
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/PrimitiveDefinitionPlugin.java
diff -u
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/PrimitiveDefinitionPlugin.java:1.4
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/PrimitiveDefinitionPlugin.java:1.5
---
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/PrimitiveDefinitionPlugin.java:1.4
Tue Oct 17 14:27:16 2006
+++
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/PrimitiveDefinitionPlugin.java
Tue Nov 21 12:09:39 2006
@@ -17,7 +17,7 @@
Initial developer(s): Romain Rouvoy (romain.rouvoy@xxxxxxx)
Contributor(s): .
--------------------------------------------------------------------------------
- $Id: PrimitiveDefinitionPlugin.java,v 1.4 2006/10/17 12:27:16 rouvoy Exp $
+ $Id: PrimitiveDefinitionPlugin.java,v 1.5 2006/11/21 11:09:39 rouvoy Exp $
==============================================================================*/
package org.objectweb.fractal.fraclet;
@@ -34,8 +34,9 @@
/**
* XDoclet plugin applied in conjunction with the FractalAdlPlugin.jelly
* template to generate primitive component descriptor file.
+ *
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
public class PrimitiveDefinitionPlugin extends FractalPlugin {
/** Definition list separator. */
@@ -43,6 +44,7 @@
/**
* Composite definition generator for abstract composite.
+ *
* @param jelly the jelly XML template engine.
* @param qdox the qdox java model provider.
* @param writer the file writer mapper.
@@ -50,9 +52,9 @@
public PrimitiveDefinitionPlugin(JellyTemplateEngine jelly,
QDoxCapableMetadataProvider qdox, WriterMapper writer) {
super(jelly, qdox, writer);
-// setFileregex("(.*)(.java)");
+ // setFileregex("(.*)(.java)");
setMultioutput(true);
-// setFilereplace("$1.fractal");
+ // setFilereplace("$1.fractal");
setValidate(false); // FractalADL DOCTYPE is not XML compliant.
}
@@ -60,36 +62,43 @@
* @see org.generama.defaults.QDoxPlugin#shouldGenerate(java.lang.Object)
*/
public boolean shouldGenerate(final Object obj) {
- if (!shouldGenerate) return false;
+ if (!shouldGenerate)
+ return false;
JavaClass cls = (JavaClass) obj;
setDestination(componentPackage(cls), definitionName(cls),
"fractal");
- debug("Parsing "+cls.getFullyQualifiedName()+"
["+definitionFullname(cls)+"]...");
- if(!isComponent((JavaClass) obj) && !isInterface((JavaClass) obj))
return false;
- debug("Generating
"+getDestinationPackage(cls)+"/"+getDestinationFilename(cls)+"...");
+ debug("Parsing " + cls.getFullyQualifiedName() + " ["
+ + definitionFullname(cls) + "]...");
+ if (!isComponent((JavaClass) obj) && !isInterface((JavaClass) obj))
+ return false;
+ debug("Generating " + getDestinationPackage(cls) + "/"
+ + getDestinationFilename(cls) + "...");
return true;
}
/**
* Provides the short name of the component depending on the filename.
+ *
* @param cls the java class source file parsed.
* @return the fully qualified name of the associated definition.
*/
public String definitionName(final JavaClass cls) {
ComponentTag tag = (ComponentTag) cls.getTagByName(COMPONENT, false);
- if (tag == null || tag.getName_() == null) return cls.getName();
- return tag.getName_().substring(tag.getName_().lastIndexOf(".")+1);
+ if (tag == null || tag.getName_() == null)
+ return cls.getName();
+ return tag.getName_().substring(tag.getName_().lastIndexOf(".") + 1);
}
-
+
/**
* Provides the fully qualified name of the component depending on the
* filename.
+ *
* @param cls the java class source file parsed.
* @return the fully qualified name of the associated definition.
*/
public String definitionFullname(final JavaClass cls) {
return packagePrefix(cls) + definitionName(cls);
}
-
+
/**
* Adds a definition extended.
*
@@ -98,12 +107,14 @@
*/
protected String extendsElement(final JavaClass cls) {
if (cls != null && (isComponent(cls) || isInterface(cls)))
- return DEFINITION_SEP + definitionFullname(cls) +
definitionParameters(cls);
+ return DEFINITION_SEP + definitionFullname(cls)
+ + definitionParameters(cls);
return "";
}
/**
* Provides the parameters of the component definition.
+ *
* @param cls the class considered.
* @return the list of parameters.
*/
@@ -111,16 +122,21 @@
JavaField[] attrs = attributes(cls, true);
StringBuffer args = new StringBuffer();
for (int i = 0; i < attrs.length; i++) {
- AttributeTag tag = (AttributeTag)
attrs[i].getTagByName(ATTRIBUTE_NAME);
-// if (tag.getValue_() == null)
-// args.append(DEFINITION_SEP +
attributeName(attrs[i])+"=>"+attributeValue(attrs[i]));
- args.append(DEFINITION_SEP + attributeName(attrs[i]) + "=>${" +
attributeName(attrs[i]) + "}");
+ // AttributeTag tag = (AttributeTag)
+ // attrs[i].getTagByName(ATTRIBUTE_NAME);
+ // if (tag.getValue_() == null)
+ // args.append(DEFINITION_SEP +
+ // attributeName(attrs[i])+"=>"+attributeValue(attrs[i]));
+ args.append(DEFINITION_SEP + attributeName(attrs[i]) + "=>${"
+ + attributeName(attrs[i]) + "}");
}
- return args.length() > 0 ?
"("+args.substring(DEFINITION_SEP.length())+")" : "";
- }
+ return args.length() > 0 ? "("
+ + args.substring(DEFINITION_SEP.length()) + ")" : "";
+ }
/**
* Provides the list of extended definitions.
+ *
* @param cls the java class source file parsed.
* @return a comma separated list of extended component definitions
(null if
* no extended definition).
@@ -130,37 +146,45 @@
JavaClass[] itfs = extend(cls);
for (int i = 0; i < itfs.length; i++)
buffer.append(extendsElement(itfs[i]));
- if (buffer.length() != 0) return
buffer.substring(DEFINITION_SEP.length());
+ if (buffer.length() != 0)
+ return buffer.substring(DEFINITION_SEP.length());
return null;
}
/**
* Provides the name of the associated interface.
+ *
* @param cls the java class source file parsed.
* @param tag the FractalItfTag associated.
* @return the name of the interface.
*/
public String interfaceName(final JavaClass cls, final ProvidesTag tag) {
- if (tag == null) return cls.getName().toLowerCase();
- if (tag.getName_() != null) return tag.getName_();
- String signature = interfaceSignature((JavaClass)tag.getContext(),
tag);
+ if (tag == null)
+ return cls.getName().toLowerCase();
+ if (tag.getName_() != null)
+ return tag.getName_();
+ String signature = interfaceSignature((JavaClass) tag.getContext(),
tag);
int dot = signature.lastIndexOf(".");
- return dot < 0 ? signature.toLowerCase() : signature.substring(dot +
1).toLowerCase();
+ return dot < 0 ? signature.toLowerCase() : signature.substring(dot +
1)
+ .toLowerCase();
}
/**
* Provides the signature of the associated interface.
+ *
* @param cls the java class source file parsed.
* @param tag the FractalItfTag associated.
* @return the signature of the interface.
*/
public String interfaceSignature(final JavaClass cls, final ProvidesTag
tag) {
- if (tag.getSignature() != null) return tag.getSignature();
+ if (tag.getSignature() != null)
+ return tag.getSignature();
return cls.getFullyQualifiedName();
}
/**
* Provides the list of arguments required by the component.
+ *
* @param cls the java class source file parsed.
* @return a comma separated list of argument for the component (null if
no
* arguments).
@@ -169,15 +193,19 @@
JavaField[] attrs = attributes(cls, true);
StringBuffer args = new StringBuffer();
for (int i = 0; i < attrs.length; i++) {
- AttributeTag tag = (AttributeTag)
attrs[i].getTagByName(ATTRIBUTE_NAME);
+ AttributeTag tag = (AttributeTag) attrs[i]
+ .getTagByName(ATTRIBUTE_NAME);
args.append(DEFINITION_SEP + attributeName(attrs[i]));
- if (tag.getValue_() != null)args.append("="+tag.getValue_());
+ if (tag.getValue_() != null)
+ args.append("=" + tag.getValue_());
}
- return args.length() > 0 ? args.substring(DEFINITION_SEP.length()) :
null;
+ return args.length() > 0 ? args.substring(DEFINITION_SEP.length())
+ : null;
}
-
+
/**
* Provides the ADL value of the component attribute.
+ *
* @param fld the java field source file parsed.
* @return the name of the associated attribute.
*/
@@ -187,10 +215,12 @@
/**
* Provides the name of the content class implementing the component.
+ *
* @return the name of the primitive component definition.
*/
public String contentClass(final JavaClass cls) {
- if (hasGlue(cls)) return componentFullname(cls);
+ if (hasGlue(cls))
+ return componentFullname(cls);
return cls.getFullyQualifiedName();
}
}
\ No newline at end of file
| <-- Date Index --> | <-- Thread Index --> |
Powered by MHonArc.
Copyright © 2006-2007, OW2 Consortium | contact | webmaster.