|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tiles.Definition
public class Definition
A definition, i.e. a template with (completely or not) filled attributes.
Attributes of a template can be defined with the help of this class.
It can be used as a data transfer object used for registering new
definitions with the Container.
Field Summary | |
---|---|
protected Map<String,Attribute> |
attributes
Attributes defined for the definition. |
protected String |
inherit
Extends attribute value. |
protected String |
name
Definition name. |
protected String |
preparer
Associated ViewPreparer URL or classname, if defined. |
protected Set<String> |
roles
The roles that can render this definition. |
protected String |
template
Template path. |
Constructor Summary | |
---|---|
Definition()
Constructor. |
|
Definition(Definition definition)
Copy Constructor. |
|
Definition(String name,
String template,
Map<String,Attribute> attributes)
Constructor. |
Method Summary | |
---|---|
void |
addAttribute(Attribute attribute)
Deprecated. Use putAttribute(String, Attribute) . |
Attribute |
getAttribute(String key)
Returns the attribute for the given name, or null if no attribute of the given name exists. |
Map<String,Attribute> |
getAttributes()
Access method for the attributes property. |
String |
getExtends()
Get extends. |
String |
getName()
Access method for the name property. |
String |
getPreparer()
Get associated preparerInstance. |
String |
getRole()
Access method for the role property. |
Set<String> |
getRoles()
Returns the roles that can render this attribute. |
String |
getTemplate()
Access method for the template property. |
boolean |
hasAttributeValue(String key)
Checks whether the key attribute has been set. |
int |
hashCode()
|
boolean |
isExtending()
Get extends flag. |
void |
put(String name,
Object content)
Put an attribute in template definition. |
void |
put(String name,
Object content,
Attribute.AttributeType type,
String role)
Put an attribute in template definition. |
void |
put(String name,
Object content,
String role)
Put an attribute in template definition. |
void |
putAttribute(String key,
Attribute value)
Put a new attribute in this definition. |
void |
setExtends(String name)
Set extends. |
void |
setName(String aName)
Sets the value of the name property. |
void |
setPreparer(String url)
Set associated preparerInstance URL. |
void |
setRole(String role)
Sets the value of the role property. |
void |
setRoles(Set<String> roles)
Sets the roles that can render this attribute. |
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, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected String inherit
protected String name
protected String template
protected Map<String,Attribute> attributes
protected Set<String> roles
protected String preparer
Constructor Detail |
---|
public Definition()
public Definition(Definition definition)
definition
- The definition to copy.public Definition(String name, String template, Map<String,Attribute> attributes)
name
- The name of the definition.template
- The template of the definition.attributes
- The attribute map of the definition.Method Detail |
---|
public String getName()
public void setName(String aName)
aName
- the new value of the name propertypublic String getTemplate()
public void setTemplate(String template)
template
- the new value of the path propertypublic String getRole()
public Set<String> getRoles()
public void setRole(String role)
role
- the new value of the role propertypublic void setRoles(Set<String> roles)
roles
- The enabled roles.public Map<String,Attribute> getAttributes()
public Attribute getAttribute(String key)
key
- name of the attribute
public void putAttribute(String key, Attribute value)
key
- String key for attributevalue
- Attibute value.@Deprecated public void addAttribute(Attribute attribute)
putAttribute(String, Attribute)
.
attribute
- Attribute to add.public boolean hasAttributeValue(String key)
key
attribute has been set.
key
- The attribute key to check.
true
if the attribute has a value.public void put(String name, Object content)
name
- Attribute namecontent
- Attribute valuepublic void put(String name, Object content, String role)
name
- Attribute namecontent
- Attribute valuerole
- Determine if content is used by get tag. If user is in role, content is used.public void put(String name, Object content, Attribute.AttributeType 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 getPreparer()
public void setPreparer(String url)
url
- Url called locallypublic void setExtends(String name)
name
- Name of the extended definition.public String getExtends()
public int hashCode()
hashCode
in class Object
public boolean isExtending()
true
if this definition extends another.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |