PAJES 2.3.9

org.pajes.html
Class TraversableElement

java.lang.Object
  extended byorg.pajes.html.Tag
      extended byorg.pajes.html.TraversableElement
All Implemented Interfaces:
java.lang.Cloneable, HTML, java.io.Serializable, Traversable
Direct Known Subclasses:
Container, SingleElementContainer

public abstract class TraversableElement
extends Tag
implements Traversable

This abstract class is extended by all objects that contain other HTML objects.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.pajes.html.Tag
ON_CLICK_ATTRIBUTE, TAG_CLOSE, TAG_LEFT, TAG_RIGHT
 
Constructor Summary
protected TraversableElement(java.lang.String name)
          Creates a new TraversableElement object.
 
Method Summary
 java.lang.String dump()
          Dumps this TraversableElement and all the elements it contains to the specified Writer.
 void dump(java.io.Writer writer)
          Dumps this TraversableElement and all the elements it contains to the specified Writer.
 void getAll(java.util.HashMap ids, java.util.HashMap names)
          Accepts two HashMaps as parameters, and returns them populated with all objects within this container that have ID and NAME attributes.
 Input[] getFieldByName(java.lang.String name)
          Locates Input instances in this container or any containers it contains, using the case-insensitive field name.
 Input getFirstFieldByName(java.lang.String name)
          Locates the first Input instance in this container or any containers it contains, using the case-insensitive field name.
 Tag getFirstTagByAttribute(java.lang.String name, java.lang.String value)
          Locates the first Tag instance in this container or any containers it contains that has the specified attribute name with the specified value.
 Tag getFirstTagByClass(java.lang.Class c)
          Locates the first Tag instance in this container or any containers it contains, that is an instance of the specified Class.
 Tag getFirstTagByID(java.lang.String id)
          Locates the first Tag instance in this container or any containers it contains, using the style sheet id, which is common to all HTML tags.
 Tag getFirstTagByName(java.lang.String name)
          Locates the first Tag instance in this container or any containers it contains, using the tag name (e.g.
 Tag[] getTagByAttribute(java.lang.String name, java.lang.String value)
          Locates Tag instances in this container or any containers it contains that have the specified attribute name and value.
 Tag[] getTagByClass(java.lang.Class c)
          Locates Tag instances in this container or any containers it contains, that are an instance of the specified Class.
 Tag[] getTagByID(java.lang.String id)
          Locates Tag instances in this container or any containers it contains, using the style sheet id, which is common to all HTML tags.
 Tag[] getTagByName(java.lang.String name)
          Locates Tag instances in this container or any containers it contains, using the tag name (e.g.
 Traversable setWritable(boolean visible, boolean cascade)
          Determines if this object and its contents should be returned to the browser.
 
Methods inherited from class org.pajes.html.Tag
addAttribute, addAttributes, addAttributes, addContent, clearAttribute, clearAttributes, clone, destroy, getAttribute, getAttributes, getAttributeSet, getContainer, getContent, getDocument, getId, getOnClickHandler, getOnDBLClickHandler, getOnKeyDownHandler, getOnKeyPressHandler, getOnKeyUpHandler, getOnMouseDownHandler, getOnMouseOutHandler, getOnMouseOverHandler, getOnMouseUpHandler, getStyle, getStyleSheetClass, getTagName, getTitle, getWritePermission, init, initAttributes, isWritable, isWritable, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setAttributes, setContainer, setContent, setContent, setId, setOnClickHandler, setOnDBLClickHandler, setOnKeyDownHandler, setOnKeyPressHandler, setOnKeyUpHandler, setOnMouseDownHandler, setOnMouseOutHandler, setOnMouseOverHandler, setOnMouseUpHandler, setStyle, setStyleSheetClass, setTagName, setTitle, setWritable, setWriteAttributes, setWriteEndTag, setWritelnAfter, setWritelnAfterContent, setWritelnBefore, setWritelnBeforeContent, setWritePermission, toString, write, writeContent
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.pajes.html.Traversable
get, set, size
 

Constructor Detail

TraversableElement

protected TraversableElement(java.lang.String name)
Creates a new TraversableElement object.

Parameters:
name - the tag name.
Method Detail

getAll

public void getAll(java.util.HashMap ids,
                   java.util.HashMap names)
Accepts two HashMaps as parameters, and returns them populated with all objects within this container that have ID and NAME attributes.

Either of the HashMaps may be null.

Parameters:
ids - a HashMap that will be populated with all Tag instances where HTML.getId() returns a non-null value. The key in the HashMap is the String ID, and the value is an array of Tag instances.
names - a HashMap that will be populated with all HTMLinput instances where Input.getName() returns a non-null value. The key in the HashMap is the String NAME, and the value is an array of Input instances.

getFieldByName

public Input[] getFieldByName(java.lang.String name)
                       throws FieldNotFoundException
Locates Input instances in this container or any containers it contains, using the case-insensitive field name.

Parameters:
name - the field name to locate.
Returns:
an array of fields.
Throws:
FieldNotFoundException - if no matching fields were found.

getFirstFieldByName

public Input getFirstFieldByName(java.lang.String name)
                          throws FieldNotFoundException
Locates the first Input instance in this container or any containers it contains, using the case-insensitive field name.

Parameters:
name - the field name to locate.
Returns:
the Input instance with the specified name.
Throws:
FieldNotFoundException - if no matching field was found.

getFirstTagByAttribute

public Tag getFirstTagByAttribute(java.lang.String name,
                                  java.lang.String value)
                           throws TagNotFoundException
Locates the first Tag instance in this container or any containers it contains that has the specified attribute name with the specified value.

Parameters:
name - the case-insensitive name of the attribute.
value - the case-insensitive value of the attribute.
Returns:
an array of Tag instances.
Throws:
TagNotFoundException - of no matching tags were found.

getFirstTagByClass

public Tag getFirstTagByClass(java.lang.Class c)
                       throws TagNotFoundException
Locates the first Tag instance in this container or any containers it contains, that is an instance of the specified Class.

Parameters:
c - the Class of Tag required.
Returns:
the Tag which is an instance of the specified class.
Throws:
TagNotFoundException - of no matching tags were found.

getFirstTagByID

public Tag getFirstTagByID(java.lang.String id)
                    throws TagNotFoundException
Locates the first Tag instance in this container or any containers it contains, using the style sheet id, which is common to all HTML tags.

Parameters:
id - the case-insensitive StyleSheet ID to locate.
Returns:
the Tag instance with the specified id.
Throws:
TagNotFoundException - of no matching id was found.

getFirstTagByName

public Tag getFirstTagByName(java.lang.String name)
                      throws TagNotFoundException
Locates the first Tag instance in this container or any containers it contains, using the tag name (e.g. "script" or "table" or "tr").

Parameters:
name - the case-insensitive name of the tag.
Returns:
the Tag with the specified name.
Throws:
TagNotFoundException - of no matching tags were found.

getTagByAttribute

public Tag[] getTagByAttribute(java.lang.String name,
                               java.lang.String value)
                        throws TagNotFoundException
Locates Tag instances in this container or any containers it contains that have the specified attribute name and value.

Parameters:
name - the case-insensitive name of the attribute.
value - the case-insensitive value of the attribute.
Returns:
an array of Tag instances.
Throws:
TagNotFoundException - of no matching tags were found.

getTagByClass

public Tag[] getTagByClass(java.lang.Class c)
                    throws TagNotFoundException
Locates Tag instances in this container or any containers it contains, that are an instance of the specified Class.

Parameters:
c - the Class of Tag required.
Returns:
an array of Tag instances.
Throws:
TagNotFoundException - of no matching tags were found.

getTagByID

public Tag[] getTagByID(java.lang.String id)
                 throws TagNotFoundException
Locates Tag instances in this container or any containers it contains, using the style sheet id, which is common to all HTML tags.

Parameters:
id - the case-insensitive StyleSheet ID to locate.
Returns:
an array of Tag instances.
Throws:
TagNotFoundException - of no matching ids were found.

getTagByName

public Tag[] getTagByName(java.lang.String name)
                   throws TagNotFoundException
Locates Tag instances in this container or any containers it contains, using the tag name (e.g. "script" or "table" or "tr").

Parameters:
name - the case-insensitive name of the tag.
Returns:
an array of Tag instances.
Throws:
TagNotFoundException - of no matching tags were found.

setWritable

public Traversable setWritable(boolean visible,
                               boolean cascade)
Determines if this object and its contents should be returned to the browser.

Specified by:
setWritable in interface Traversable
Parameters:
visible - true if this element should be returned to the browser, or false if it should not.
cascade - true if the specified visible value should be cascaded to all contained elements.
Returns:
the modified Traversable object
See Also:
Tag.setWritable(boolean)

dump

public java.lang.String dump()
                      throws java.io.IOException
Dumps this TraversableElement and all the elements it contains to the specified Writer.

Returns:
a String showing the container stack.
Throws:
java.io.IOException - if an IO exception occurs

dump

public void dump(java.io.Writer writer)
          throws java.io.IOException
Dumps this TraversableElement and all the elements it contains to the specified Writer.

Parameters:
writer - the Writer to which the elements will be dumped.
Throws:
java.io.IOException - if an IO exception occurs

PAJES 2.3.9

Copyright © 2002-2003 Viridian Pty Limited. All Rights Reserved.