public class ComponentDefinition
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACTION
Controller name type.
|
protected java.util.Map |
attributes
Attributes defined for the component.
|
protected java.lang.String |
controller
Associated Controller URL or classname, if defined
|
static java.lang.String |
CONTROLLER
Controller name type.
|
protected java.lang.String |
controllerType
Associated Controller typename, if controllerName defined.
|
protected static org.apache.commons.logging.Log |
log
Commons Logging instance.
|
protected java.lang.String |
name
Definition name
|
protected java.lang.String |
path
Component / template path (URL).
|
protected java.lang.String |
role
Role associated to definition.
|
static java.lang.String |
URL
Controller name type.
|
Constructor and Description |
---|
ComponentDefinition()
Constructor.
|
ComponentDefinition(ComponentDefinition definition)
Copy Constructor.
|
ComponentDefinition(java.lang.String name,
java.lang.String path,
java.util.Map attributes)
Constructor.
|
ComponentDefinition(XmlDefinition definition)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static Controller |
createController(java.lang.String name,
java.lang.String controllerType)
Create a new instance of controller named in parameter.
|
static Controller |
createControllerFromClassname(java.lang.String classname)
Create a controller from specified classname
|
java.lang.Object |
getAttribute(java.lang.String key)
Returns the value of the named attribute as an Object, or null if no
attribute of the given name exists.
|
java.util.Map |
getAttributes()
Access method for the attributes property.
|
java.lang.String |
getController()
Get associated controller local URL.
|
Controller |
getControllerInstance()
Get controller instance.
|
java.lang.String |
getControllerType()
Get associated controller type.
|
java.lang.String |
getName()
Access method for the name property.
|
Controller |
getOrCreateController()
Get or create controller.
|
java.lang.String |
getPage()
Access method for the path property.
|
java.lang.String |
getPath()
Access method for the path property.
|
java.lang.String |
getRole()
Access method for the role property.
|
java.lang.String |
getTemplate()
Access method for the template property.
|
void |
put(java.lang.String name,
java.lang.Object content)
Put an attribute in component / template definition.
|
void |
put(java.lang.String name,
java.lang.Object content,
boolean direct)
Put an attribute in template definition.
|
void |
put(java.lang.String name,
java.lang.Object content,
boolean direct,
java.lang.String role)
Put an attribute in template definition.
|
void |
put(java.lang.String name,
java.lang.Object content,
java.lang.String type,
java.lang.String role)
Put an attribute in template definition.
|
void |
putAttribute(java.lang.String key,
java.lang.Object value)
Put a new attribute in this component
|
void |
setController(java.lang.String url)
Set associated controller URL.
|
void |
setControllerClass(java.lang.String controller)
Set associated controller name as a classtype, and controller
type as "classname".
|
void |
setControllerInstance(Controller controller)
Set controller.
|
void |
setControllerType(java.lang.String controllerType)
Set associated controller type.
|
void |
setControllerUrl(java.lang.String controller)
Set associated controller name as an url, and controller
type as "url".
|
void |
setName(java.lang.String aName)
Sets the value of the name property.
|
void |
setPage(java.lang.String page)
Sets the value of the path property.
|
void |
setPath(java.lang.String aPath)
Sets the value of the path property.
|
void |
setRole(java.lang.String role)
Sets the value of the role property.
|
void |
setTemplate(java.lang.String template)
Sets the value of the template property.
|
java.lang.String |
toString()
Returns a description of the attributes.
|
protected static org.apache.commons.logging.Log log
protected java.lang.String name
protected java.lang.String path
protected java.util.Map attributes
protected java.lang.String role
protected java.lang.String controller
protected java.lang.String controllerType
public static final java.lang.String URL
public static final java.lang.String CONTROLLER
public static final java.lang.String ACTION
public ComponentDefinition()
public ComponentDefinition(ComponentDefinition definition)
public ComponentDefinition(XmlDefinition definition)
java.lang.InstantiationException
- if an error occur while instanciating Controller :
(classname can't be instanciated, Illegal access with instanciated class,
Error while instanciating class, classname can't be instanciated.public ComponentDefinition(java.lang.String name, java.lang.String path, java.util.Map attributes)
public java.lang.String getName()
public void setName(java.lang.String aName)
aName
- the new value of the name propertypublic java.lang.String getPage()
public void setPage(java.lang.String page)
page
- the new value of the path propertypublic java.lang.String getPath()
public void setPath(java.lang.String aPath)
aPath
- the new value of the path propertypublic java.lang.String getTemplate()
public void setTemplate(java.lang.String template)
template
- the new value of the path propertypublic java.lang.String getRole()
public void setRole(java.lang.String role)
role
- the new value of the path propertypublic java.util.Map getAttributes()
public java.lang.Object getAttribute(java.lang.String key)
public void putAttribute(java.lang.String key, java.lang.Object value)
key
- String key for attributevalue
- Attibute value.public void put(java.lang.String name, java.lang.Object content)
name
- Attribute namecontent
- Attribute valuepublic void put(java.lang.String name, java.lang.Object content, boolean direct)
name
- Attribute namecontent
- Attribute value �direct
- Determines how content is handled by get tag: true means content is printed directly; false, the default, means content is includedpublic void put(java.lang.String name, java.lang.Object content, boolean direct, java.lang.String role)
name
- Attribute namecontent
- Attribute valuedirect
- Determines how content is handled by get tag: true means content is printed directly; false, the default, means content is includedrole
- Determine if content is used by get tag. If user is in role, content is used.public void put(java.lang.String name, java.lang.Object content, java.lang.String type, java.lang.String role)
name
- Attribute namecontent
- Attribute valuetype
- attribute type: template, string, definitionrole
- Determine if content is used by get tag. If user is in role, content is used.public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getControllerType()
public void setControllerType(java.lang.String controllerType)
controllerType
- Typeof associated controllerpublic void setControllerUrl(java.lang.String controller)
controller
- Controller urlpublic void setControllerClass(java.lang.String controller)
controller
- Controller classname.public java.lang.String getController()
public void setController(java.lang.String url)
url
- Url called locallypublic Controller getControllerInstance()
public Controller getOrCreateController() throws java.lang.InstantiationException
java.lang.InstantiationException
- if an error occur while instanciating Controller :
(classname can't be instanciated, Illegal access with instanciated class,
Error while instanciating class, classname can't be instanciated.public void setControllerInstance(Controller controller)
public static Controller createController(java.lang.String name, java.lang.String controllerType) throws java.lang.InstantiationException
name
- Controller name (classname, url, ...)controllerType
- Expected Controller typejava.lang.InstantiationException
- if an error occur while instanciating Controller :
(classname can't be instanciated, Illegal access with instanciated class,
Error while instanciating class, classname can't be instanciated.public static Controller createControllerFromClassname(java.lang.String classname) throws java.lang.InstantiationException
classname
- Controller classname.java.lang.InstantiationException
- if an error occur while instanciating Controller :
(classname can't be instanciated, Illegal access with instanciated class,
Error while instanciating class, classname can't be instanciated.Copyright © 2000–2019 Apache Software Foundation. All rights reserved.