java.lang.Object
org.apache.wicket.markup.AbstractMarkupFragment
org.apache.wicket.markup.Markup
- All Implemented Interfaces:
Iterable<MarkupElement>
,IMarkupFragment
- Direct Known Subclasses:
MergedMarkup
The content of a markup file, consisting of a list of markup elements.
- Author:
- Juergen Donnerstag
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
addMarkupElement
(int pos, MarkupElement markupElement) Add a MarkupElementfinal void
addMarkupElement
(MarkupElement markupElement) Add a MarkupElementfinal IMarkupFragment
Finds a markup fragment that spans a tagfinal MarkupElement
get
(int index) Get the MarkupElement at the index provided.final MarkupResourceStream
Get the underlying markup resource stream, which might contain more than just the markup portion represented by the IMarkupFragment.final Iterator<MarkupElement>
iterator()
final Iterator<MarkupElement>
iterator
(int startIndex, int size) final void
Make all tags immutable and the list of elements unmodifiable.static Markup
Take the markup string, parse it and return the Markup (list of MarkupElements).static Markup
Take the markup string, parse it and return the Markup (list of MarkupElements).final void
replace
(int index, MarkupElement elem) final int
size()
The number of markup elements.final String
toString()
final String
toString
(boolean markupOnly) Methods inherited from class org.apache.wicket.markup.AbstractMarkupFragment
find
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
NO_MARKUP
Placeholder that indicates no markup
-
-
Constructor Details
-
Markup
Constructor- Parameters:
markupResourceStream
- The associated Markup
-
-
Method Details
-
of
Take the markup string, parse it and return the Markup (list of MarkupElements).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.
- Parameters:
markup
- the string to use as markup- Returns:
- Markup The parsed markup
-
of
Take the markup string, parse it and return the Markup (list of MarkupElements).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.
- Parameters:
markup
- the string to use as markupwicketNamespace
- the namespace for Wicket elements and attributes- Returns:
- Markup The parsed markup
-
get
Description copied from interface:IMarkupFragment
Get the MarkupElement at the index provided.- Parameters:
index
- Index into markup list- Returns:
- Markup element
-
getMarkupResourceStream
Description copied from interface:IMarkupFragment
Get the underlying markup resource stream, which might contain more than just the markup portion represented by the IMarkupFragment.- Returns:
- The underlying markup resource stream
-
replace
- Parameters:
index
-elem
-
-
locationAsString
- Returns:
- The fixed location as a string, e.g. the file name or the URL. Return null to avoid caching the markup.
-
size
Description copied from interface:IMarkupFragment
The number of markup elements.- Returns:
- Number of markup elements
-
addMarkupElement
Add a MarkupElement- Parameters:
markupElement
-
-
addMarkupElement
Add a MarkupElement- Parameters:
pos
-markupElement
-
-
makeImmutable
Make all tags immutable and the list of elements unmodifiable. -
find
Description copied from interface:IMarkupFragment
Finds a markup fragment that spans a tag- Parameters:
id
- the wicket:id attribute in the tag- Returns:
- the markup fragment that spans the complete found tag
-
toString
- Overrides:
toString
in classAbstractMarkupFragment
-
toString
- Parameters:
markupOnly
- True, if only the markup shall be returned- Returns:
- String
-
iterator
- See Also:
-
iterator
- Parameters:
startIndex
-size
-- Returns:
- Iterator
-