PAJES 3.0.21

org.pajes.html
Interface Traversable

All Superinterfaces:
HTML
All Known Implementing Classes:
Anchor, AnchorButton, Applet, Big, Body, Bold, Center, Cite, Code, Container, DefinitionDescription, DefinitionList, DefinitionTerm, Dfn, Div, Em, FieldSet, FileUploadForm, Font, Form, FormattedText, FrameSet, Head, Heading, IFrame, Italic, Kbd, Label, Legend, ListContainer, ListItem, NoBreak, NoFrames, NoScript, OptionGroup, OrderedList, Paje, Paragraph, PreFormatted, Samp, Script, SelectList, SingleElementContainer, Small, Span, Strike, Strong, StyleSheet, Subscript, Superscript, Table, Table.Body, Table.Cell, Table.ColumnGroup, Table.Foot, Table.Head, Table.HeadingCell, Table.Row, Table.RowContainer, TableContainer, Teletype, TraversableElement, TreePaje, Underline, UnOrderedList, Var

public interface Traversable
extends HTML

This interface is implemented by all objects that contain other HTML objects.


Method Summary
 Traversable add(HTML htmlObject)
          Adds an HTML object to the current container
 Traversable delete(java.lang.Object htmlObject)
          Deletes the specified HTML object from the container.
 HTML get(int position)
          Gets the HTML object from the specified position in the container.
 void getAll(java.util.Map<java.lang.String,Tag[]> ids, java.util.Map<java.lang.String,Input[]> names)
          Accepts two Maps 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<? extends Tag> 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.
 boolean isWritable()
          Determines whether this object should be displayed or not.
 Traversable set(HTML htmlObject, int position)
          Sets an HTML object at a specified position in the container.
 Traversable setWritable(boolean visible, boolean cascade)
          Determines if this object and its contents should be returned to the browser.
 int size()
          Returns the number of HTML objects in the current container.
 
Methods inherited from interface org.pajes.html.HTML
addContent, clone, destroy, getContainer, getDocument, getId, getParent, getWritePermission, isChildOf, isChildOf, setContainer, setContent, setParent, setWritePermission, write
 

Method Detail

add

Traversable add(HTML htmlObject)
Adds an HTML object to the current container

Parameters:
htmlObject - - the Object to add (eg. doc.add(new htmlBody);)
Returns:
the modified Container object;
Throws:
TagException - if an attempt is made to add an invalid object to the container.

delete

Traversable delete(java.lang.Object htmlObject)
Deletes the specified HTML object from the container.

Parameters:
htmlObject - the object to be deleted.
Returns:
the modified Container object.

get

HTML get(int position)
Gets the HTML object from the specified position in the container.

Parameters:
position - the position to get the html object
Returns:
the object at the specified location

getAll

void getAll(java.util.Map<java.lang.String,Tag[]> ids,
            java.util.Map<java.lang.String,Input[]> names)
Accepts two Maps as parameters, and returns them populated with all objects within this container that have ID and NAME attributes.

Either of the Maps may be null.

Parameters:
ids - a Map 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 Map that will be populated with all Input 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

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

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

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

Tag getFirstTagByClass(java.lang.Class<? extends Tag> 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

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

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

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

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

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

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.

isWritable

boolean isWritable()
Determines whether this object should be displayed or not.

Returns:
true if this element should be displayed.

set

Traversable set(HTML htmlObject,
                int position)
Sets an HTML object at a specified position in the container.

Parameters:
htmlObject - the Object to add.
position - the position at which to place the html object.
Returns:
the modified Traversable object.

setWritable

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

Parameters:
visible - true if this element should be returned to the browser, or false if it should not.
cascade - true if any contained elements should be returned to the browser, or false if they should not. Note that this option does not affect any tags that would not normally return their contents if they themselves are not writable (e.g. Table tags).
Returns:
the modified Traversable object
See Also:
Tag.setWritable(boolean)

size

int size()
Returns the number of HTML objects in the current container.

Returns:
the number of HTML objects in the current container.

PAJES 3.0.21

Copyright © 1998-2007 Viridian Pty Limited. All Rights Reserved.