You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by ce...@apache.org on 2003/02/27 20:19:54 UTC
cvs commit: jakarta-struts/src/share/org/apache/struts/tiles/definition ReloadableDefinitionsFactory.java ComponentDefinitionsFactoryWrapper.java
cedric 2003/02/27 11:19:54
Modified: src/share/org/apache/struts/tiles/definition
ReloadableDefinitionsFactory.java
ComponentDefinitionsFactoryWrapper.java
Log:
Documentation corrections and updates.
No code change.
Patches from Yann Cebron
Revision Changes Path
1.6 +26 -22 jakarta-struts/src/share/org/apache/struts/tiles/definition/ReloadableDefinitionsFactory.java
Index: ReloadableDefinitionsFactory.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/tiles/definition/ReloadableDefinitionsFactory.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ReloadableDefinitionsFactory.java 17 Dec 2002 00:59:47 -0000 1.5
+++ ReloadableDefinitionsFactory.java 27 Feb 2003 19:19:54 -0000 1.6
@@ -81,7 +81,7 @@
/**
* A reloadable factory.
* This factory is the main entrance to any factory implementation. It takes in
- * charge real implementation instance, and allows reload of it by creating a new
+ * charge real implementation instance, and allows reloading by creating a new
* instance.
*
* @author Cedric Dumoulin
@@ -101,6 +101,8 @@
/**
* Constructor.
* Create a factory according to servlet settings.
+ * @param servletContext Our servlet context.
+ * @param servletConfig Our servlet config.
* @throws DefinitionsFactoryException If factory creation fail.
*/
public ReloadableDefinitionsFactory( ServletContext servletContext, ServletConfig servletConfig )
@@ -113,6 +115,8 @@
/**
* Constructor.
* Create a factory according to servlet settings.
+ * @param servletContext Our servlet context.
+ * @param properties Map containing all properties.
* @throws DefinitionsFactoryException If factory creation fail.
*/
public ReloadableDefinitionsFactory( ServletContext servletContext, Map properties )
@@ -126,7 +130,7 @@
/**
* Create Definition factory from provided classname.
* If a factory class name is provided, a factory of this class is created. Otherwise,
- * default factory is created.
+ * a default factory is created.
* Factory must have a constructor taking ServletContext and Map as parameter.
* @param classname Class name of the factory to create.
* @param servletContext Servlet Context passed to newly created factory.
@@ -191,7 +195,7 @@
* of init parameters. Factory classname is also retrieved, as well as debug level.
* Finally, approriate createDefinitionsFactory() is called.
* @param servletContext Servlet Context passed to newly created factory.
- * @param servletConfig Servlet config containing parameters to be passed to newly created factory.
+ * @param properties Map containing all properties.
*/
public ComponentDefinitionsFactory createFactory(ServletContext servletContext, Map properties)
throws DefinitionsFactoryException
@@ -208,12 +212,11 @@
* Get a definition by its name.
* Call appropriate method on underlying factory instance.
* Throw appropriate exception if definition or definition factory is not found.
- * @param name Name of requested definition.
- * @param request Current servelet request
- * @param servletContext current servlet context
+ * @param definitionName Name of requested definition.
+ * @param request Current servlet request.
+ * @param servletContext Current servlet context.
* @throws FactoryNotFoundException Can't find definition factory.
* @throws DefinitionsFactoryException General error in factory while getting definition.
- * @throws NoSuchDefinitionException No definition found for specified name
*/
public ComponentDefinition getDefinition(String definitionName, ServletRequest request, ServletContext servletContext)
throws FactoryNotFoundException, DefinitionsFactoryException
@@ -223,11 +226,10 @@
/**
* Reload underlying factory.
- * Reload is done creating a new factory instance, and replacing old instance
- * by the new one.
- * @param request Current servelet request
- * @param servletContext current servlet context
- * @throws DefinitionsFactoryException If factory creation fail.
+ * Reload is done by creating a new factory instance, and replacing the old instance
+ * with the new one.
+ * @param servletContext Current servlet context.
+ * @throws DefinitionsFactoryException If factory creation fails.
*/
public void reload(ServletContext servletContext)
throws DefinitionsFactoryException
@@ -238,6 +240,7 @@
/**
* Get underlying factory instance.
+ * @return ComponentDefinitionsFactory
*/
public ComponentDefinitionsFactory getFactory()
{
@@ -247,11 +250,11 @@
/**
* Init factory.
* This method is required by interface ComponentDefinitionsFactory. It is
- * not used in this implementation, as it manage itself underlying creation
+ * not used in this implementation, as it manages itself the underlying creation
* and initialization.
* @param servletContext Servlet Context passed to newly created factory.
* @param properties Map of name/property passed to newly created factory.
- * Map can contains more properties than requested.
+ * Map can contain more properties than requested.
* @throws DefinitionsFactoryException An error occur during initialization.
*/
public void initFactory(ServletContext servletContext, Map properties) throws DefinitionsFactoryException
@@ -259,7 +262,8 @@
}
/**
- * Get this object as a String
+ * Return String representation.
+ * @return String representation.
*/
public String toString()
{
@@ -269,7 +273,7 @@
/**
* Inner class.
* Wrapper for ServletContext init parameters.
- * Object of this class is an hashmap containing parameters and values
+ * Object of this class is an HashMap containing parameters and values
* defined in the servlet config file (web.xml).
*/
class ServletPropertiesMap extends HashMap {
@@ -279,8 +283,8 @@
ServletPropertiesMap( ServletConfig config )
{
// This implementation is very simple.
- // It is possible to avoid creation of a new structure, but this need
- // imply writing all Map interface.
+ // It is possible to avoid creation of a new structure, but this would
+ // imply writing all of the Map interface.
Enumeration enum = config.getInitParameterNames();
while( enum.hasMoreElements() )
{
1.4 +23 -10 jakarta-struts/src/share/org/apache/struts/tiles/definition/ComponentDefinitionsFactoryWrapper.java
Index: ComponentDefinitionsFactoryWrapper.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/tiles/definition/ComponentDefinitionsFactoryWrapper.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ComponentDefinitionsFactoryWrapper.java 17 Dec 2002 00:59:47 -0000 1.3
+++ ComponentDefinitionsFactoryWrapper.java 27 Feb 2003 19:19:54 -0000 1.4
@@ -94,6 +94,7 @@
/**
* Constructor.
* Create new wrapper for specified factory.
+ * @param factory The factory to create a wrapper for.
*/
public ComponentDefinitionsFactoryWrapper( ComponentDefinitionsFactory factory )
{
@@ -104,7 +105,7 @@
* Constructor.
* Create new wrapper.
* The config object passed to init method should reference a factory implementing
- * ComponentDefinitionsFactory.
+ * {@link ComponentDefinitionsFactory}.
*/
public ComponentDefinitionsFactoryWrapper()
{
@@ -112,6 +113,10 @@
/**
* Get requested definition.
+ * @param name Name of the definition.
+ * @param request The request we are processing.
+ * @param servletContext Our servlet context.
+ * @return ComponentDefition
*/
public ComponentDefinition getDefinition(String name, ServletRequest request, ServletContext servletContext)
throws NoSuchDefinitionException, DefinitionsFactoryException
@@ -121,6 +126,8 @@
/**
* Call underlying factory init method.
+ * @param config DefinitionsFactoryConfig.
+ * @param servletContext Our servlet context.
*/
public void init(DefinitionsFactoryConfig config, ServletContext servletContext)
throws DefinitionsFactoryException
@@ -142,6 +149,8 @@
/**
* Set underlying factory configuration.
+ * @param config DefinitionsFactoryConfig to use.
+ * @param servletContext Our servlet context.
*
*/
public void setConfig(DefinitionsFactoryConfig config, ServletContext servletContext)
@@ -155,6 +164,7 @@
/**
* Get underlying factory configuration.
+ * @return DefinitionsFactoryConfig.
*/
public DefinitionsFactoryConfig getConfig()
{
@@ -162,7 +172,8 @@
}
/**
- * Get internal factory
+ * Get internal factory.
+ * @return The internal ComponentDefitionsFactory.
*/
public ComponentDefinitionsFactory getInternalFactory()
{
@@ -170,8 +181,8 @@
}
/**
- * Create Definition factory from provided classname which must implements ComponentDefinitionsFactory.
- * Factory class must extends TilesDefinitionsFactory.
+ * Create Definition factory from provided classname which must implement {@link ComponentDefinitionsFactory}.
+ * Factory class must extend {@link DefinitionsFactory}.
* @param classname Class name of the factory to create.
* @return newly created factory.
* @throws DefinitionsFactoryException If an error occur while initializing factory
@@ -188,7 +199,7 @@
catch( ClassCastException ex )
{ // Bad classname
throw new DefinitionsFactoryException( "Error - createDefinitionsFactory : Factory class '"
- + classname +" must implements 'TilesDefinitionsFactory'.", ex );
+ + classname +" must implement 'DefinitionsFactory'.", ex );
}
catch( ClassNotFoundException ex )
{ // Bad classname
@@ -207,8 +218,9 @@
}
/**
- * ToString method.
- * Call toString on underlying factory.
+ * Return String representation.
+ * Calls toString() on underlying factory.
+ * @return String representation.
*/
public String toString()
{
@@ -218,6 +230,7 @@
/**
* Create map of configuration attributes from configuration object.
* Mapping is done between old names and new names.
+ * @param config The DefinitionsFactoryConfig to use.
* @return Map Map of name/value pairs.
*/
public static Map createConfigMap( DefinitionsFactoryConfig config )
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org