|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fu_berlin.ties.xml.TagContainer
de.fu_berlin.ties.xml.OpenTags
A container used to manage the currently open start tags during XML
adjustment. Adds stack-like push and pop functionality to the superclass
and allows checking specifically for
tentative
tag.
Field Summary | |
protected static Object |
DUMMY
A dummy object stored as map value where no value is required. |
Constructor Summary | |
OpenTags()
Creates a new instance. |
Method Summary | |
boolean |
containsNonTentative(String tagname)
Checks whether this instance contains at least one appearance of the specified tag that is not TagVariety.TENTATIVE . |
TagConstituent |
findTentativeTag(String tagname)
Finds a tentative appearance of a tag, if any exists. |
boolean |
isRoot(TagConstituent tag)
Checks whether a tag is the root tag (the first tag inserted into this container). |
TagConstituent |
peek()
Returns the last tag appearance that was push ed into this container. |
protected TagConstituent |
peekFirst()
Returns the first tag appearance that was initially push ed into this container. |
TagConstituent |
pop()
Removes and returns the last tag appearance that was push ed into this container. |
boolean |
popAndRegularize()
Removes and returns the last tag appearance that was push ed into this container. |
void |
push(TagConstituent tag,
boolean appendAtEnd)
Inserts an appearance of a tag into the container. |
boolean |
remove(TagConstituent tag)
Removes a single appearance of a tag from the container. |
Methods inherited from class de.fu_berlin.ties.xml.TagContainer |
contains, findFirst, findInSeries, forceRemove, getTagMap, isEmpty, push, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static final Object DUMMY
Constructor Detail |
public OpenTags()
Method Detail |
public boolean containsNonTentative(String tagname)
TagVariety.TENTATIVE
.
tagname
- the name of the tag to check
true
iff the container contains one or more
non-tenatative (at insertion time) appearances of the specified tagpublic TagConstituent findTentativeTag(String tagname)
tagname
- the name of the tag to check
null
if no
matching appearance was foundpublic boolean isRoot(TagConstituent tag)
tag
- the tag to check
true
if the tag is the root tagprotected TagConstituent peekFirst()
push
ed into this container.
null
if the container is emptypublic TagConstituent peek()
push
ed into this container.
null
if the container is emptypublic TagConstituent pop() throws NullPointerException
push
ed into this container.
NullPointerException
- if the container is empty (i.e. a
call to peek()
would return null
)public boolean popAndRegularize() throws NullPointerException
push
ed into this container. The variety of
the removed tag is set to TagVariety.REGULAR
(independently of
its previous value).
true
if the tag was irregular and thus had to be
regularized; false
if it was a regular tag
NullPointerException
- if the container is empty (i.e. a
call to peek()
would return null
)public void push(TagConstituent tag, boolean appendAtEnd) throws IllegalArgumentException, UnsupportedOperationException
push
in class TagContainer
tag
- the tag to insertappendAtEnd
- must always be true
IllegalArgumentException
- if the specified tag is not a start tag
UnsupportedOperationException
- if appendAtEnd
is
false
(prepending is not supported)public boolean remove(TagConstituent tag)
remove
in class TagContainer
tag
- the tag to remove
true
if the specified TagConstituent was
removed successfully; false
otherwise (the specified
constituent wasn't found in the container)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |