|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.enough.polish.browser.TagHandler
public abstract class TagHandler
This class provides the basic functionality for tag handlers. A tag handler is a responsible for handling domain-specific tags in the browser. E.g. you can support different micro formats in HTML with this.
Browser| Constructor Summary | |
|---|---|
TagHandler()
|
|
| Method Summary | |
|---|---|
void |
addAttributeCommand(String tagName,
String attributeName,
String attributeValue,
Command command)
Adds a command to a specific tag/attribute combination. |
protected void |
addCommands(String tagName,
Item item)
Adds registered commands to the given item. |
protected void |
addCommands(String tagName,
String attributeName,
String attributeValue,
Item item)
Adds registered commands to the given item. |
void |
addTagCommand(String tagName,
Command command)
Adds a command to a specific tag. |
protected Command[] |
getCommandsForTag(String tag)
Retrieves registered commands for the specified tag. |
boolean |
handleCommand(Command command)
Handles all commands this tag handler is responsible for. |
abstract boolean |
handleTag(Container parentItem,
SimplePullParser parser,
String tagName,
boolean opening,
HashMap attributeMap,
Style style)
|
abstract void |
register(Browser browser)
Register a given browser object for this TagHandler. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TagHandler()
| Method Detail |
|---|
public abstract void register(Browser browser)
browser - the browser to register.
public abstract boolean handleTag(Container parentItem,
SimplePullParser parser,
String tagName,
boolean opening,
HashMap attributeMap,
Style style)
parentItem - the container item the put the browser items intoparser - the parsertagName - the name of the tag to handleopening - true if this is an opening tag, false otherwiseattributeMap - all attributes for the tagstyle - the style for the next item, can be null
true if the tag was handled, false otherwisepublic boolean handleCommand(Command command)
command - the command to handle
true if the command was handled, false otherwise
public void addTagCommand(String tagName,
Command command)
tagName - the tag to add the command tocommand - the command to add
public void addAttributeCommand(String tagName,
String attributeName,
String attributeValue,
Command command)
tagName - the tag to add the command toattributeName - the attribute name to add the command toattributeValue - the attribute value to add the command tocommand - the command to add
protected void addCommands(String tagName,
Item item)
tagName - the name of the tag, e.g. divitem - the item used for visualising the tag
protected void addCommands(String tagName,
String attributeName,
String attributeValue,
Item item)
tagName - the name of the tag, e.g. div (can be null)attributeName - the name of the attribute, e.g. class (can be null)attributeValue - the value of the attribute, e.g. address (can be null)item - the item used for visualising the tagprotected Command[] getCommandsForTag(String tag)
tag - the name of the tag
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||