public class Markup extends AbstractMarkupFragment
MarkupResourceStream
,
MarkupElement
,
ComponentTag
,
RawMarkup
Modifier and Type | Field and Description |
---|---|
static Markup |
NO_MARKUP
Placeholder that indicates no markup
|
Constructor and Description |
---|
Markup(MarkupResourceStream markupResourceStream)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addMarkupElement(int pos,
MarkupElement markupElement)
Add a MarkupElement
|
void |
addMarkupElement(MarkupElement markupElement)
Add a MarkupElement
|
IMarkupFragment |
find(String id)
Finds a markup fragment that spans a tag
|
MarkupElement |
get(int index)
Get the MarkupElement at the index provided.
|
MarkupResourceStream |
getMarkupResourceStream()
Get the underlying markup resource stream, which might contain more than just the markup
portion represented by the IMarkupFragment.
|
Iterator<MarkupElement> |
iterator() |
Iterator<MarkupElement> |
iterator(int startIndex,
int size) |
String |
locationAsString() |
void |
makeImmutable()
Make all tags immutable and the list of elements unmodifiable.
|
static Markup |
of(String markup)
Take the markup string, parse it and return the Markup (list of MarkupElements).
|
static Markup |
of(String markup,
String wicketNamespace)
Take the markup string, parse it and return the Markup (list of MarkupElements).
|
void |
replace(int index,
MarkupElement elem) |
int |
size()
The number of markup elements.
|
String |
toString() |
String |
toString(boolean markupOnly) |
find
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public static final Markup NO_MARKUP
public Markup(MarkupResourceStream markupResourceStream)
markupResourceStream
- The associated Markuppublic static Markup of(String markup)
Limitation: Please note that MarkupFactory is NOT used and thus no caching is used (which doesn't matter for Strings anyway), but what might matter is that your own MarkupFilters are not applied, which you might have registered with MarkupFactory.
markup
- the string to use as markuppublic static Markup of(String markup, String wicketNamespace)
Limitation: Please note that MarkupFactory is NOT used and thus no caching is used (which doesn't matter for Strings anyway), but what might matter is that your own MarkupFilters are not applied, which you might have registered with MarkupFactory.
markup
- the string to use as markupwicketNamespace
- the namespace for Wicket elements and attributespublic final MarkupElement get(int index)
IMarkupFragment
index
- Index into markup listpublic final MarkupResourceStream getMarkupResourceStream()
IMarkupFragment
public final void replace(int index, MarkupElement elem)
index
- elem
- public String locationAsString()
public final int size()
IMarkupFragment
public final void addMarkupElement(MarkupElement markupElement)
markupElement
- public final void addMarkupElement(int pos, MarkupElement markupElement)
pos
- markupElement
- public final void makeImmutable()
public final IMarkupFragment find(String id)
IMarkupFragment
public final String toString()
toString
in class AbstractMarkupFragment
public final String toString(boolean markupOnly)
markupOnly
- True, if only the markup shall be returnedpublic final Iterator<MarkupElement> iterator()
Iterable.iterator()
public final Iterator<MarkupElement> iterator(int startIndex, int size)
startIndex
- size
- Copyright © 2006–2022 Apache Software Foundation. All rights reserved.