org.apache.tapestry.parse
Class OpenToken
java.lang.Object
|
+--org.apache.tapestry.parse.TemplateToken
|
+--org.apache.tapestry.parse.OpenToken
- All Implemented Interfaces:
- ILocatable
- public class OpenToken
- extends TemplateToken
Token representing the open tag for a component. Components may be either
specified or implicit. Specified components (the traditional type, dating
back to the origin of Tapestry) are matched by an entry in the
containing component's specification. Implicit components specify their
type in the component template and must not have an entry in
the containing component's specification.
- Since:
- 3.0
- Version:
- $Id: OpenToken.java,v 1.4 2003/04/21 13:15:28 glongman Exp $
- Author:
- Howard Lewis Ship
- See Also:
TokenType.OPEN
OpenToken
public OpenToken(String tag,
String id,
String componentType,
ILocation location)
- Creates a new token with the given tag, id and type
- Parameters:
tag
- the template tag which represents the component, typically "span"id
- the id for the component, which may be assigned by the template
parser for implicit componentscomponentType
- the type of component, if an implicit component, or null for
a specified componentlocation
- location of tag represented by this token
getId
public String getId()
- Returns the id for the component.
getTag
public String getTag()
- Returns the tag used to represent the component within the template.
getComponentType
public String getComponentType()
- Returns the specified component type, or null for a component where the type
is not defined in the template. The type may include a library id prefix.
addAttribute
public void addAttribute(String name,
AttributeType type,
String value)
getAttributesMap
public Map getAttributesMap()
- Returns a Map of attributes. Key is the attribute name, value
is an instance of
TemplateAttribute
.
The caller should not modify the Map. Returns null if
this OpenToken contains no attributes.
extendDescription
protected void extendDescription(org.apache.commons.lang.builder.ToStringBuilder builder)
- Description copied from class:
TemplateToken
- Overridden in subclasses to append additional fields (defined in the subclass)
to the description. Subclasses may override this method without invoking
this implementation, which is empty.
- Overrides:
extendDescription
in class TemplateToken