org.apache.tapestry.parse
Class OpenToken

java.lang.Object
  extended by org.apache.tapestry.parse.TemplateToken
      extended by 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 243791 2004-02-19 17:38:13Z hlship $
Author:
Howard Lewis Ship
See Also:
TokenType.OPEN

Constructor Summary
OpenToken(String tag, String id, String componentType, ILocation location)
          Creates a new token with the given tag, id and type
 
Method Summary
 void addAttribute(String name, AttributeType type, String value)
           
protected  void extendDescription(org.apache.commons.lang.builder.ToStringBuilder builder)
          Overridden in subclasses to append additional fields (defined in the subclass) to the description.
 Map getAttributesMap()
          Returns a Map of attributes.
 String getComponentType()
          Returns the specified component type, or null for a component where the type is not defined in the template.
 String getId()
          Returns the id for the component.
 String getTag()
          Returns the tag used to represent the component within the template.
 
Methods inherited from class org.apache.tapestry.parse.TemplateToken
getLocation, getType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 components
componentType - the type of component, if an implicit component, or null for a specified component
location - location of tag represented by this token
Method Detail

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