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:
org.apache.hivemind.Locatable

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
Author:
Howard Lewis Ship
See Also:
TokenType.OPEN

Constructor Summary
OpenToken(String tag, String id, String componentType, org.apache.hivemind.Location location)
          Creates a new token with the given tag, id and type.
 
Method Summary
 void addAttribute(String name, String value)
           
protected  void extendDescription(org.apache.hivemind.util.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,
                 org.apache.hivemind.Location 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,
                         String value)

getAttributesMap

public Map getAttributesMap()
Returns a Map of attributes. Keys and values are strings.


extendDescription

protected void extendDescription(org.apache.hivemind.util.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


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.