wicket.markup
Class Markup

java.lang.Object
  extended by wicket.markup.Markup
Direct Known Subclasses:
MergedMarkup

public class Markup
extends java.lang.Object

Holds markup as a resource (the stream that the markup came from) and a list of MarkupElements (the markup itself).

Author:
Jonathan Locke, Juergen Donnerstag
See Also:
MarkupElement, ComponentTag, RawMarkup

Field Summary
static Markup NO_MARKUP
          Placeholder that indicates no markup
 
Method Summary
 void addMarkupElement(MarkupElement markupElement)
          Add a MarkupElement
 java.util.Iterator componentTagIterator(int startIndex, java.lang.Class matchClass)
          Create an iterator for the component tags in the markup.
 int findComponentIndex(java.lang.String path, java.lang.String id)
          Find the markup element index of the component with 'path'
 MarkupElement get(int index)
          For Wicket it would be sufficient for this method to be package protected.
 java.lang.String getEncoding()
          Gets the markup encoding.
 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.
protected  void initialize()
          Initialize the index where can be found.
 void setWicketNamespace(java.lang.String wicketNamespace)
          Sets wicketNamespace.
 int size()
          For Wicket it would be sufficient for this method to be package protected.
 java.lang.String toDebugString()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_MARKUP

public static final Markup NO_MARKUP
Placeholder that indicates no markup

Method Detail

initialize

protected void initialize()
Initialize the index where can be found.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
String representation of markup list

toDebugString

public java.lang.String toDebugString()
Returns:
String representation of markup list

get

public MarkupElement get(int index)
For Wicket it would be sufficient for this method to be package protected. However to allow wicket-bench easy access to the information ...

Parameters:
index - Index into markup list
Returns:
Markup element

size

public int size()
For Wicket it would be sufficient for this method to be package protected. However to allow wicket-bench easy access to the information ...

Returns:
Number of markup elements

getXmlDeclaration

public java.lang.String getXmlDeclaration()
Return the XML declaration string, in case if found in the markup.

Returns:
Null, if not found.

getEncoding

public java.lang.String getEncoding()
Gets the markup encoding. A markup encoding may be specified in a markup file with an XML encoding specifier of the form <?xml ... encoding="..." ?>.

Returns:
Encoding, or null if not found.

getWicketNamespace

public java.lang.String getWicketNamespace()
Get the wicket namespace valid for this specific markup

Returns:
wicket namespace

findComponentIndex

public int findComponentIndex(java.lang.String path,
                              java.lang.String id)
Find the markup element index of the component with 'path'

Parameters:
path - The component path expression
id - The component's id to search for
Returns:
-1, if not found

setWicketNamespace

public final void setWicketNamespace(java.lang.String wicketNamespace)
Sets wicketNamespace.

Parameters:
wicketNamespace - wicketNamespace

addMarkupElement

public final void addMarkupElement(MarkupElement markupElement)
Add a MarkupElement

Parameters:
markupElement -

componentTagIterator

public java.util.Iterator componentTagIterator(int startIndex,
                                               java.lang.Class matchClass)
Create an iterator for the component tags in the markup.

Parameters:
startIndex - The index to start with
matchClass - Iterate over elements matching the class
Returns:
ComponentTagIterator


Copyright © 2004-2007 Wicket developers. All Rights Reserved.