|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.struts.tiles.ComponentDefinition
public class ComponentDefinition
Definition of a template / component attributes. Attributes of a component can be defined with the help of this class. An instance of this class can be used as a bean, and passed to 'insert' tag.
Field Summary | |
---|---|
static String |
ACTION
Controller name type. |
protected Map |
attributes
Attributes defined for the component. |
protected String |
controller
Associated Controller URL or classname, if defined |
static String |
CONTROLLER
Controller name type. |
protected String |
controllerType
Associated Controller typename, if controllerName defined. |
protected static Log |
log
Commons Logging instance. |
protected String |
name
Definition name |
protected String |
path
Component / template path (URL). |
protected String |
role
Role associated to definition. |
static String |
URL
Controller name type. |
Constructor Summary | |
---|---|
ComponentDefinition()
Constructor. |
|
ComponentDefinition(ComponentDefinition definition)
Copy Constructor. |
|
ComponentDefinition(String name,
String path,
Map attributes)
Constructor. |
|
ComponentDefinition(XmlDefinition definition)
Constructor. |
Method Summary | |
---|---|
static Controller |
createController(String name,
String controllerType)
Create a new instance of controller named in parameter. |
static Controller |
createControllerFromClassname(String classname)
Create a controller from specified classname |
Object |
getAttribute(String key)
Returns the value of the named attribute as an Object, or null if no attribute of the given name exists. |
Map |
getAttributes()
Access method for the attributes property. |
String |
getController()
Get associated controller local URL. |
Controller |
getControllerInstance()
Get controller instance. |
String |
getControllerType()
Get associated controller type. |
String |
getName()
Access method for the name property. |
Controller |
getOrCreateController()
Get or create controller. |
String |
getPage()
Access method for the path property. |
String |
getPath()
Access method for the path property. |
String |
getRole()
Access method for the role property. |
String |
getTemplate()
Access method for the template property. |
void |
put(String name,
Object content)
Put an attribute in component / template definition. |
void |
put(String name,
Object content,
boolean direct)
Put an attribute in template definition. |
void |
put(String name,
Object content,
boolean direct,
String role)
Put an attribute in template definition. |
void |
put(String name,
Object content,
String type,
String role)
Put an attribute in template definition. |
void |
putAttribute(String key,
Object value)
Put a new attribute in this component |
void |
setController(String url)
Set associated controller URL. |
void |
setControllerClass(String controller)
Set associated controller name as a classtype, and controller type as "classname". |
void |
setControllerInstance(Controller controller)
Set controller. |
void |
setControllerType(String controllerType)
Set associated controller type. |
void |
setControllerUrl(String controller)
Set associated controller name as an url, and controller type as "url". |
void |
setName(String aName)
Sets the value of the name property. |
void |
setPage(String page)
Sets the value of the path property. |
void |
setPath(String aPath)
Sets the value of the path property. |
void |
setRole(String role)
Sets the value of the role property. |
void |
setTemplate(String template)
Sets the value of the template property. |
String |
toString()
Returns a description of the attributes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static Log log
protected String name
protected String path
protected Map attributes
protected String role
protected String controller
protected String controllerType
public static final String URL
public static final String CONTROLLER
public static final String ACTION
Constructor Detail |
---|
public ComponentDefinition()
public ComponentDefinition(ComponentDefinition definition)
public ComponentDefinition(XmlDefinition definition)
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(String name, String path, Map attributes)
Method Detail |
---|
public String getName()
public void setName(String aName)
aName
- the new value of the name propertypublic String getPage()
public void setPage(String page)
page
- the new value of the path propertypublic String getPath()
public void setPath(String aPath)
aPath
- the new value of the path propertypublic String getTemplate()
public void setTemplate(String template)
template
- the new value of the path propertypublic String getRole()
public void setRole(String role)
role
- the new value of the path propertypublic Map getAttributes()
public Object getAttribute(String key)
public void putAttribute(String key, Object value)
key
- String key for attributevalue
- Attibute value.public void put(String name, Object content)
name
- Attribute namecontent
- Attribute valuepublic void put(String name, 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(String name, Object content, boolean direct, 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(String name, Object content, String type, 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 String toString()
toString
in class Object
public String getControllerType()
public void setControllerType(String controllerType)
controllerType
- Typeof associated controllerpublic void setControllerUrl(String controller)
controller
- Controller urlpublic void setControllerClass(String controller)
controller
- Controller classname.public String getController()
public void setController(String url)
url
- Url called locallypublic Controller getControllerInstance()
public Controller getOrCreateController() throws InstantiationException
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(String name, String controllerType) throws InstantiationException
name
- Controller name (classname, url, ...)controllerType
- Expected Controller type
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(String classname) throws InstantiationException
classname
- Controller classname.
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |