org.apache.struts.tiles
Class DefinitionsFactoryConfig

java.lang.Object
  |
  +--org.apache.struts.tiles.DefinitionsFactoryConfig
All Implemented Interfaces:
java.io.Serializable

public class DefinitionsFactoryConfig
extends java.lang.Object
implements java.io.Serializable

A TilesFactoryConfig object hold configuration attributes for a tile definition factory.

Since:
1.1
Version:
$Revision: 1.2 $ $Date: 2002/07/24 09:37:32 $
Author:
Cedric Dumoulin
See Also:
Serialized Form

Field Summary
protected  int debugLevel
          Deprecated. Use commons-logging mechanism.
protected  java.lang.String definitionConfigFiles
          Definition configuration file specofied by user
static java.lang.String DEFINITIONS_CONFIG_PARAMETER_NAME
          Alternate name for definition files properties in configuration file
private  java.util.Map extraAttributes
          Map of extra attribute available.
static java.lang.String FACTORY_CLASSNAME_PARAMETER_NAME
          Alternate name for factory classname properties in configuration file
protected  java.lang.String factoryClassname
          Fully qualfied classname of the factory to create.
protected  java.lang.String factoryName
          The name associated to this factory.
protected  boolean moduleAware
          Does the factory is module aware ?
static java.lang.String PARSER_DETAILS_PARAMETER_NAME
          Alternate name for parser debug details properties in configuration file
static java.lang.String PARSER_VALIDATE_PARAMETER_NAME
          Alternate name for parser validate properties in configuration file
protected  int parserDebugLevel
          Deprecated. Use commons-logging mechanism.
protected  boolean parserValidate
          Do we want the parser to validate configuration file ?
static java.lang.String TILES_DETAILS_PARAMETER_NAME
          Alternate name for definition debug details properties in configuration file
 
Constructor Summary
DefinitionsFactoryConfig()
          Default constructor.
DefinitionsFactoryConfig(java.util.Map initParameters)
          Constructor.
 
Method Summary
 java.lang.Object getAttribute(java.lang.String name)
          Get extra attribute value.
 java.util.Map getAttributes()
          Get extra attributes as a Map.
 int getDebugLevel()
          Access method for the debugLevel property.
 java.lang.String getDefinitionConfigFiles()
          Access method for the definitionConfigFiles property.
 java.lang.String getFactoryClassname()
          Access method for the factoryClassname property.
 java.lang.String getFactoryName()
          Get the factory name.
 int getParserDebugLevel()
          Access method for the parserDebugLevel property.
 boolean getParserValidate()
          Determines if the parserValidate property is true.
 boolean isModuleAware()
          Get the module aware flag.
static void linkOldPropertyNames(java.util.Map properties)
          Link old property names to new property names.
 void populate(java.util.Map properties)
          Populate this config object from properties map, based on the specified name/value pairs.
 void setAttribute(java.lang.String name, java.lang.Object value)
          Set a new extra attribute value.
 void setDebugLevel(int aDebugLevel)
          Sets the value of the debugLevel property.
 void setDefinitionConfigFiles(java.lang.String aDefinitionConfigFiles)
          Sets the value of the definitionConfigFiles property.
 void setFactoryClassname(java.lang.String aFactoryClassname)
          Sets the value of the factoryClassname property.
 void setFactoryName(java.lang.String factoryName)
          Set the factory name.
 void setModuleAware(boolean moduleAware)
          Set the module aware flag.
 void setParserDebugLevel(int aParserDebugLevel)
          Sets the value of the parserDebugLevel property.
 void setParserValidate(boolean aParserValidate)
          Sets the value of the parserValidate property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factoryClassname

protected java.lang.String factoryClassname
Fully qualfied classname of the factory to create. If no classname is set, a default factory is created (of class "org.apache.struts.tiles.xmlDefinition.I18nFactorySet").


debugLevel

protected int debugLevel
Deprecated. Use commons-logging mechanism.

Debug level value. 0=no debug info >0 = debug info.


parserDebugLevel

protected int parserDebugLevel
Deprecated. Use commons-logging mechanism.

Debug level value used when parsing configuration file. . 0=no debug info >0 = debug info.


parserValidate

protected boolean parserValidate
Do we want the parser to validate configuration file ? Default value is true.


definitionConfigFiles

protected java.lang.String definitionConfigFiles
Definition configuration file specofied by user


moduleAware

protected boolean moduleAware
Does the factory is module aware ?


factoryName

protected java.lang.String factoryName
The name associated to this factory.
With Struts > 1.1b3, this name is the module name to which this factory belong. It is set by the system.
In other versions, this properties is not used.


PARSER_DETAILS_PARAMETER_NAME

public static final java.lang.String PARSER_DETAILS_PARAMETER_NAME
Alternate name for parser debug details properties in configuration file

See Also:
Constant Field Values

PARSER_VALIDATE_PARAMETER_NAME

public static final java.lang.String PARSER_VALIDATE_PARAMETER_NAME
Alternate name for parser validate properties in configuration file

See Also:
Constant Field Values

FACTORY_CLASSNAME_PARAMETER_NAME

public static final java.lang.String FACTORY_CLASSNAME_PARAMETER_NAME
Alternate name for factory classname properties in configuration file

See Also:
Constant Field Values

DEFINITIONS_CONFIG_PARAMETER_NAME

public static final java.lang.String DEFINITIONS_CONFIG_PARAMETER_NAME
Alternate name for definition files properties in configuration file

See Also:
Constant Field Values

TILES_DETAILS_PARAMETER_NAME

public static final java.lang.String TILES_DETAILS_PARAMETER_NAME
Alternate name for definition debug details properties in configuration file

See Also:
Constant Field Values

extraAttributes

private java.util.Map extraAttributes
Map of extra attribute available.

Constructor Detail

DefinitionsFactoryConfig

public DefinitionsFactoryConfig()
Default constructor.


DefinitionsFactoryConfig

public DefinitionsFactoryConfig(java.util.Map initParameters)
Constructor. Create configuration object, and initialize it with parameters from Map. Parameters corresponding to an attribute are filtered and stored in appropriate attribute.

Parameters:
initParameters -
Method Detail

isModuleAware

public boolean isModuleAware()
Get the module aware flag. true: user want a single factory instance false: user want multiple factory instance (one per module with Struts)


setModuleAware

public void setModuleAware(boolean moduleAware)
Set the module aware flag. true: user want a single factory instance false: user want multiple factory instance (one per module with Struts)


getFactoryClassname

public java.lang.String getFactoryClassname()
Access method for the factoryClassname property.

Returns:
the current value of the factoryClassname property

setFactoryClassname

public void setFactoryClassname(java.lang.String aFactoryClassname)
Sets the value of the factoryClassname property.

Parameters:
aFactoryClassname - the new value of the factoryClassname property

getDebugLevel

public int getDebugLevel()
Access method for the debugLevel property.

Returns:
the current value of the debugLevel property

setDebugLevel

public void setDebugLevel(int aDebugLevel)
Sets the value of the debugLevel property.

Parameters:
aDebugLevel - the new value of the debugLevel property

getParserDebugLevel

public int getParserDebugLevel()
Access method for the parserDebugLevel property.

Returns:
the current value of the parserDebugLevel property

setParserDebugLevel

public void setParserDebugLevel(int aParserDebugLevel)
Sets the value of the parserDebugLevel property.

Parameters:
aParserDebugLevel - the new value of the parserDebugLevel property

getParserValidate

public boolean getParserValidate()
Determines if the parserValidate property is true.

Returns:
true if the parserValidate property is true

setParserValidate

public void setParserValidate(boolean aParserValidate)
Sets the value of the parserValidate property.

Parameters:
aParserValidate - the new value of the parserValidate property

getDefinitionConfigFiles

public java.lang.String getDefinitionConfigFiles()
Access method for the definitionConfigFiles property.

Returns:
the current value of the definitionConfigFiles property

setDefinitionConfigFiles

public void setDefinitionConfigFiles(java.lang.String aDefinitionConfigFiles)
Sets the value of the definitionConfigFiles property.

Parameters:
aDefinitionConfigFiles - the new value of the definitionConfigFiles property

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Set a new extra attribute value.

Parameters:
name - Name of the attribute.
value - Value of the attribute.

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Get extra attribute value.

Parameters:
name - Name of the attribute.
Returns:
Value of the attribute, or null if not found.

getAttributes

public java.util.Map getAttributes()
Get extra attributes as a Map.

Returns:
Map A Map containing attribute name - value pair.

populate

public void populate(java.util.Map properties)
              throws java.lang.IllegalAccessException,
                     java.lang.reflect.InvocationTargetException
Populate this config object from properties map, based on the specified name/value pairs. This method uses the populate() method from org.apache.commons.beanutils.BeanUtil.

Properties keys are scanned for old property names, and linked to new name if necessary. This modify the properties map.

The particular setter method to be called for each property is determined using the usual JavaBeans introspection mechanisms. Thus, you may identify custom setter methods using a BeanInfo class that is associated with the class of the bean itself. If no such BeanInfo class is available, the standard method name conversion ("set" plus the capitalized name of the property in question) is used.

NOTE: It is contrary to the JavaBeans Specification to have more than one setter method (with different argument signatures) for the same property.

Parameters:
properties - Map keyed by property name, with the corresponding (String or String[]) value(s) to be set
Throws:
java.lang.IllegalAccessException - if the caller does not have access to the property accessor method
InvocationTargetException - if the property accessor method throws an exception
See Also:
BeanUtils

linkOldPropertyNames

public static void linkOldPropertyNames(java.util.Map properties)
Link old property names to new property names. This modify the map.

Parameters:
properties - Map keyed by property name, with the corresponding (String or String[]) value(s) to be set

getFactoryName

public java.lang.String getFactoryName()
Get the factory name.


setFactoryName

public void setFactoryName(java.lang.String factoryName)
Set the factory name.



Copyright 2000-2002 - Cedric Dumoulin and Apache Software Foundation