|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wicket.markup.MarkupStream
public final class MarkupStream
A stream of MarkupElement
s, subclases of which are
ComponentTag
and RawMarkup
. A
markup stream has a current index in the list of markup elements. The next
markup element can be retrieved and the index advanced by calling next(). If
the index hits the end, hasMore() will return false.
The current markup element can be accessed with get() and as a ComponentTag with getTag().
The stream can be seeked to a particular location with setCurrentIndex().
Convenience methods also exist to skip component tags (and any potentially nested markup) or raw markup.
Several boolean methods of the form at*() return true if the markup stream is positioned at a tag with a given set of characteristics.
The resource from which the markup was loaded can be retrieved with getResource().
Constructor Summary | |
---|---|
protected |
MarkupStream()
DO NOT YOU THIS CONSTRUCTOR. |
|
MarkupStream(Markup markup)
Constructor |
Method Summary | |
---|---|
boolean |
atCloseTag()
|
boolean |
atOpenCloseTag()
|
boolean |
atOpenCloseTag(java.lang.String componentId)
|
boolean |
atOpenTag()
|
boolean |
atOpenTag(java.lang.String id)
|
boolean |
atTag()
|
java.util.Iterator |
componentTagIterator()
Create an iterator for the component tags in the stream. |
boolean |
equalMarkup(MarkupStream markupStream)
True, if associate markup is the same. |
int |
findComponentIndex(java.lang.String path,
java.lang.String id)
Find the markup element index of the component with 'path' |
MarkupElement |
get()
|
java.lang.Class |
getContainerClass()
Get the component/container's Class which is directly associated with the stream. |
int |
getCurrentIndex()
|
java.lang.String |
getEncoding()
Gets the markup encoding. |
IResourceStream |
getResource()
|
ComponentTag |
getTag()
|
java.lang.String |
getWicketNamespace()
Get the wicket namespace valid for this specific markup |
java.lang.String |
getXmlDeclaration()
Return the XML declaration string, in case if found in the markup. |
boolean |
hasMore()
|
boolean |
isMergedMarkup()
|
MarkupElement |
next()
Note: |
void |
setCurrentIndex(int currentIndex)
|
void |
skipComponent()
Skips this component and all nested components |
void |
skipRawMarkup()
Skips any raw markup at the current position |
void |
skipUntil(java.lang.String wicketTagName)
Skips any markup at the current position until the wicket tag name is found. |
void |
throwMarkupException(java.lang.String message)
Throws a new markup exception |
java.lang.String |
toHtmlDebugString()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected MarkupStream()
public MarkupStream(Markup markup)
markup
- List of markup elementsMethod Detail |
---|
public boolean atCloseTag()
public boolean atOpenCloseTag()
public boolean atOpenCloseTag(java.lang.String componentId)
componentId
- Required component name attribute
public boolean atOpenTag()
public boolean atOpenTag(java.lang.String id)
id
- Required component id attribute
public boolean atTag()
public MarkupElement get()
public int getCurrentIndex()
public IResourceStream getResource()
public ComponentTag getTag()
public boolean hasMore()
public MarkupElement next()
public void setCurrentIndex(int currentIndex)
currentIndex
- New current index in the streampublic final void skipComponent()
public void skipRawMarkup()
public void skipUntil(java.lang.String wicketTagName)
wicketTagName
- wicket tag name to seekpublic void throwMarkupException(java.lang.String message)
message
- The exception message
MarkupException
public java.lang.String toHtmlDebugString()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getXmlDeclaration()
public final java.lang.String getEncoding()
public final java.lang.Class getContainerClass()
public final java.lang.String getWicketNamespace()
public final boolean equalMarkup(MarkupStream markupStream)
markupStream
- The markup stream to compare with.
public final int findComponentIndex(java.lang.String path, java.lang.String id)
path
- The component path expressionid
- The component's id to search for
public final java.util.Iterator componentTagIterator()
Note: it will not modify the current index of the underlying markup stream
public final boolean isMergedMarkup()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |