|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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 java.util.Map<java.lang.String,Attribute> |
attributes
Attributes defined for the definition. |
protected java.lang.String |
inherit
Extends attribute value. |
protected java.lang.String |
name
Definition name. |
protected java.lang.String |
preparer
Associated ViewPreparer URL or classname, if defined. |
protected java.util.Set<java.lang.String> |
roles
The roles that can render this definition. |
protected java.lang.String |
template
Template path. |
Constructor Summary | |
---|---|
Definition()
Constructor. |
|
Definition(Definition definition)
Copy Constructor. |
|
Definition(java.lang.String name,
java.lang.String template,
java.util.Map<java.lang.String,Attribute> attributes)
Constructor. |
Method Summary | |
---|---|
void |
addAttribute(Attribute attribute)
Deprecated. Use putAttribute(String, Attribute) . |
Attribute |
getAttribute(java.lang.String key)
Returns the attribute for the given name, or null if no attribute of the given name exists. |
java.util.Map<java.lang.String,Attribute> |
getAttributes()
Access method for the attributes property. |
java.lang.String |
getExtends()
Get extends. |
java.lang.String |
getName()
Access method for the name property. |
java.lang.String |
getPreparer()
Get associated preparerInstance. |
java.lang.String |
getRole()
Access method for the role property. |
java.util.Set<java.lang.String> |
getRoles()
Returns the roles that can render this attribute. |
java.lang.String |
getTemplate()
Access method for the template property. |
boolean |
hasAttributeValue(java.lang.String key)
Checks whether the key attribute has been set. |
int |
hashCode()
|
boolean |
isExtending()
Get extends flag. |
void |
put(java.lang.String name,
java.lang.Object content)
Put an attribute in template definition. |
void |
put(java.lang.String name,
java.lang.Object content,
Attribute.AttributeType type,
java.lang.String role)
Put an attribute in template definition. |
void |
put(java.lang.String name,
java.lang.Object content,
java.lang.String role)
Put an attribute in template definition. |
void |
putAttribute(java.lang.String key,
Attribute value)
Put a new attribute in this definition. |
void |
setExtends(java.lang.String name)
Set extends. |
void |
setName(java.lang.String aName)
Sets the value of the name property. |
void |
setPreparer(java.lang.String url)
Set associated preparerInstance URL. |
void |
setRole(java.lang.String role)
Sets the value of the role property. |
void |
setRoles(java.util.Set<java.lang.String> roles)
Sets the roles that can render this attribute. |
void |
setTemplate(java.lang.String template)
Sets the value of the template property. |
java.lang.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 java.lang.String inherit
protected java.lang.String name
protected java.lang.String template
protected java.util.Map<java.lang.String,Attribute> attributes
protected java.util.Set<java.lang.String> roles
protected java.lang.String preparer
Constructor Detail |
---|
public Definition()
public Definition(Definition definition)
definition
- The definition to copy.public Definition(java.lang.String name, java.lang.String template, java.util.Map<java.lang.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 java.lang.String getName()
public void setName(java.lang.String aName)
aName
- the new value of the name 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 java.util.Set<java.lang.String> getRoles()
public void setRole(java.lang.String role)
role
- the new value of the role propertypublic void setRoles(java.util.Set<java.lang.String> roles)
roles
- The enabled roles.public java.util.Map<java.lang.String,Attribute> getAttributes()
public Attribute getAttribute(java.lang.String key)
key
- name of the attribute
public void putAttribute(java.lang.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(java.lang.String key)
key
attribute has been set.
key
- The attribute key to check.
true
if the attribute has a 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, java.lang.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(java.lang.String name, java.lang.Object content, Attribute.AttributeType 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 getPreparer()
public void setPreparer(java.lang.String url)
url
- Url called locallypublic void setExtends(java.lang.String name)
name
- Name of the extended definition.public java.lang.String getExtends()
public int hashCode()
hashCode
in class java.lang.Object
public boolean isExtending()
true
if this definition extends another.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |