|
HTML Parser Home Page | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.htmlparser.PrototypicalNodeFactory
A node factory based on the prototype pattern. This factory uses the prototype pattern to generate new Tag nodes. Prototype tags, in the form of undifferentiated tags are held in a hash table. On a
| Field Summary | |
protected Map |
mBlastocyst
The list of tags to return at the top level. |
| Constructor Summary | |
PrototypicalNodeFactory()
Create a new factory with all but DOM tags registered. |
|
PrototypicalNodeFactory(boolean empty)
Create a new factory with no registered tags. |
|
PrototypicalNodeFactory(Tag tag)
Create a new factory with the given tag as the only one registered. |
|
PrototypicalNodeFactory(Tag[] tags)
Create a new factory with the given tags registered. |
|
| Method Summary | |
void |
clear()
Clean out the registry. |
Node |
createRemarkNode(Page page,
int start,
int end)
Create a new remark node. |
Node |
createStringNode(Page page,
int start,
int end)
Create a new string node. |
Node |
createTagNode(Page page,
int start,
int end,
Vector attributes)
Create a new tag node. |
Tag |
get(String id)
Gets a tag from the registry. |
Tag |
put(String id,
Tag tag)
Adds a tag to the registry. |
void |
registerTag(Tag tag)
|
PrototypicalNodeFactory |
registerTags()
|
Tag |
remove(String id)
Remove a tag from the registry. |
void |
unregisterTag(Tag tag)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Map mBlastocyst
| Constructor Detail |
public PrototypicalNodeFactory()
public PrototypicalNodeFactory(boolean empty)
public PrototypicalNodeFactory(Tag tag)
public PrototypicalNodeFactory(Tag[] tags)
| Method Detail |
public Tag put(String id,
Tag tag)
id - The name under which to register the tag.tag - The tag to be returned from a createTag(id) call.
null if none.public Tag get(String id)
id - The name of the tag to return.
null if none.public Tag remove(String id)
id - The name of the tag to remove.
public void clear()
public void registerTag(Tag tag)
public void unregisterTag(Tag tag)
public PrototypicalNodeFactory registerTags()
public Node createStringNode(Page page,
int start,
int end)
createStringNode in interface NodeFactorypage - The page the node is on.start - The beginning position of the string.end - The ending positiong of the string.
public Node createRemarkNode(Page page,
int start,
int end)
createRemarkNode in interface NodeFactorypage - The page the node is on.start - The beginning position of the remark.end - The ending positiong of the remark.
public Node createTagNode(Page page,
int start,
int end,
Vector attributes)
throws ParserException
createTagNode in interface NodeFactorypage - The page the node is on.start - The beginning position of the tag.end - The ending positiong of the tag.attributes - The attributes contained in this tag.
ParserException
|
© 2004 Somik Raha Mar 14, 2004
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||