org.apache.wicket.markup
Class Markup

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

public class Markup
extends java.lang.Object

A list of markup elements associated with a Markup. Might be all elements of a markup resource, might be just the elements associated with a specific tag.

Author:
Juergen Donnerstag
See Also:
MarkupResourceData, MarkupElement, ComponentTag, RawMarkup

Field Summary
static Markup NO_MARKUP
          Placeholder that indicates no markup
 
Method Summary
 void addMarkupElement(int pos, MarkupElement markupElement)
          Add a MarkupElement
 void addMarkupElement(MarkupElement markupElement)
          Add a MarkupElement
 boolean equalTo(Markup that)
           
 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.
 MarkupResourceData getMarkupResourceData()
          Gets the associate markup
protected  void initialize()
          Initialize the index where wicket tags can be found
 java.lang.String locationAsString()
          Allowing the markup to return its own location allows special types of Markup (i.e.
 int size()
          For Wicket it would be sufficient for this method to be package protected.
 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

get

public final 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

getMarkupResourceData

public final MarkupResourceData getMarkupResourceData()
Gets the associate markup

Returns:
The associated markup

locationAsString

public java.lang.String locationAsString()
Allowing the markup to return its own location allows special types of Markup (i.e. MergedMarkup) to override their location, as they are composed of multiple Markups in different locations. SEE WICKET-1507 (Jeremy Thomerson)

Returns:
the location of this markup

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

addMarkupElement

public final void addMarkupElement(MarkupElement markupElement)
Add a MarkupElement

Parameters:
markupElement -

addMarkupElement

public final void addMarkupElement(int pos,
                                   MarkupElement markupElement)
Add a MarkupElement

Parameters:
pos -
markupElement -

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

equalTo

public boolean equalTo(Markup that)
Parameters:
that - The markup to compare with
Returns:
True if the two markups are equal

initialize

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


toString

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


Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.