|
|||||||||||
| 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 | |
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 componentId)
|
boolean |
atTag()
|
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. |
int |
getHeaderIndex()
Get the current index pointing to the start element of the header section. |
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()
|
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 |
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 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 skipUntil(java.lang.String wicketTagName)
wicketTagName - wicket tag name to seekpublic 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()
public java.lang.Class getContainerClass()
public final int getHeaderIndex()
public java.lang.String getWicketNamespace()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||