Package org.apache.struts.tiles
Class DefinitionsFactoryConfig
java.lang.Object
org.apache.struts.tiles.DefinitionsFactoryConfig
- All Implemented Interfaces:
Serializable
A TilesFactoryConfig object hold configuration attributes for a tile
definition factory.
- Since:
- Struts 1.1
- Version:
- $Rev$ $Date$
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
Definition configuration file specified by user.static final String
Alternate name for definition files properties in configuration file.static final String
Alternate name for factory classname properties in configuration file.protected String
Fully qualified classname of the factory to create.protected String
The name associated to this factory.protected boolean
Specifies whether the factory is "module-aware".static final String
Deprecated.This will be removed in a release after Struts 1.2.static final String
Alternate name for parser validate properties in configuration file.protected boolean
Specifies whether the parser will validate configuration files.static final String
Deprecated.This will be removed in a release after Struts 1.2. -
Constructor Summary
ConstructorDescriptionDefault constructor.DefinitionsFactoryConfig
(Map<String, Object> initParameters) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetAttribute
(String name) Get value of an additional attribute.Get additional attributes as a Map.Get the definition config files.Get the classname of the factory.Get the factory name.boolean
Determines if the parser is validating.boolean
Get the module aware flag.static void
linkOldPropertyNames
(Map<String, Object> properties) Link old property names to new property names.void
Populate this config object from properties map, based on the specified name/value pairs.void
setAttribute
(String name, Object value) Set value of an additional attribute.void
setDefinitionConfigFiles
(String aDefinitionConfigFiles) Set the definition config files.void
setFactoryClassname
(String aFactoryClassname) Set the classname of the factory..void
setFactoryName
(String factoryName) Set the factory name.void
setModuleAware
(boolean moduleAware) Set the module aware flag.void
setParserValidate
(boolean aParserValidate) Set the validating mode for the parser.
-
Field Details
-
factoryClassname
Fully qualified classname of the factory to create. If no classname is set, a default factory is created (of class "org.apache.struts.tiles.xmlDefinition.I18nFactorySet"). -
parserValidate
protected boolean parserValidateSpecifies whether the parser will validate configuration files. Default value is true. -
definitionConfigFiles
Definition configuration file specified by user. -
moduleAware
protected boolean moduleAwareSpecifies whether the factory is "module-aware". -
factoryName
The name associated to this factory.
With Struts 1.1, this name is the module name to which this factory belong. It is set by the system.
In prior versions, this property is not used. -
PARSER_DETAILS_PARAMETER_NAME
Deprecated.This will be removed in a release after Struts 1.2.Alternate name for parser debug details properties in configuration file.- See Also:
-
PARSER_VALIDATE_PARAMETER_NAME
Alternate name for parser validate properties in configuration file.- See Also:
-
FACTORY_CLASSNAME_PARAMETER_NAME
Alternate name for factory classname properties in configuration file.- See Also:
-
DEFINITIONS_CONFIG_PARAMETER_NAME
Alternate name for definition files properties in configuration file.- See Also:
-
TILES_DETAILS_PARAMETER_NAME
Deprecated.This will be removed in a release after Struts 1.2.Alternate name for definition debug details properties in configuration file.- See Also:
-
-
Constructor Details
-
DefinitionsFactoryConfig
public DefinitionsFactoryConfig()Default constructor. -
DefinitionsFactoryConfig
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
- Map.
-
-
Method Details
-
isModuleAware
public boolean isModuleAware()Get the module aware flag.- Returns:
true
: user wants a single factory instance,false
: user wants multiple factory instances (one per module with Struts)
-
setModuleAware
public void setModuleAware(boolean moduleAware) Set the module aware flag.- Parameters:
moduleAware
-true
: user wants a single factory instance,false
: user wants multiple factory instances (one per module with Struts)
-
getFactoryClassname
Get the classname of the factory.- Returns:
- Classname.
-
setFactoryClassname
Set the classname of the factory..- Parameters:
aFactoryClassname
- Classname of the factory.
-
getParserValidate
public boolean getParserValidate()Determines if the parser is validating.- Returns:
true
when in validating mode.
-
setParserValidate
public void setParserValidate(boolean aParserValidate) Set the validating mode for the parser.- Parameters:
aParserValidate
-true
for validation,false
otherwise
-
getDefinitionConfigFiles
Get the definition config files.- Returns:
- Defition config files.
-
setDefinitionConfigFiles
Set the definition config files.- Parameters:
aDefinitionConfigFiles
- Definition config files.
-
setAttribute
Set value of an additional attribute.- Parameters:
name
- Name of the attribute.value
- Value of the attribute.
-
getAttribute
Get value of an additional attribute.- Parameters:
name
- Name of the attribute.- Returns:
- Value of the attribute, or null if not found.
-
getAttributes
Get additional attributes as a Map.- Returns:
- Map A Map containing attribute name - value pairs.
-
populate
public void populate(Map<String, Object> properties) throws IllegalAccessException, InvocationTargetExceptionPopulate 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 the new name if necessary. This modifies 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:
IllegalAccessException
- if the caller does not have access to the property accessor method.InvocationTargetException
- if the property accessor method throws an exception.- See Also:
-
linkOldPropertyNames
Link old property names to new property names. This modifies the map.- Parameters:
properties
- Map keyed by property name, with the corresponding (String or String[]) value(s) to be set.
-
getFactoryName
Get the factory name. -
setFactoryName
Set the factory name.- Parameters:
factoryName
- Name of the factory.
-