|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectwicket.markup.MarkupStream
A stream of MarkupElements, 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 | |
MarkupStream(Markup markup)
Constructor |
|
| Method Summary | |
boolean |
atCloseTag()
|
boolean |
atOpenCloseTag()
|
boolean |
atOpenCloseTag(java.lang.String componentId)
|
boolean |
atOpenTag()
|
boolean |
atOpenTag(java.lang.String componentId)
|
boolean |
atTag()
|
MarkupElement |
get()
|
int |
getCurrentIndex()
|
java.lang.String |
getEncoding()
Gets the markup encoding. |
IResourceStream |
getResource()
|
ComponentTag |
getTag()
|
java.lang.String |
getXmlDeclaration()
Return the XML declaration string, in case if found in the markup. |
boolean |
hasMore()
|
MarkupElement |
next()
|
void |
setCurrentIndex(int currentIndex)
|
void |
skipComponent()
Skips this component and all nested components |
void |
skipRawMarkup()
Skips any raw markup at the current position |
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 |
public MarkupStream(Markup markup)
markup - List of markup elements| Method 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 componentId)
componentId - Required component name 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 throwMarkupException(java.lang.String message)
message - The exception message
MarkupExceptionpublic java.lang.String toHtmlDebugString()
public java.lang.String toString()
public java.lang.String getXmlDeclaration()
public java.lang.String getEncoding()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||