org.apache.wicket.protocol.http.documentvalidation
Class Tag

java.lang.Object
  extended by org.apache.wicket.protocol.http.documentvalidation.Tag
All Implemented Interfaces:
DocumentElement

public class Tag
extends Object
implements DocumentElement

Class representing an element in a document.

Author:
Chris Turner

Constructor Summary
Tag(String tag)
          Create the tag element.
 
Method Summary
 void addExpectedAttribute(String name, String pattern)
          Add an expected attribute to this tag.
 Tag addExpectedChild(DocumentElement e)
          Add an expected child to this tag.
 void addIllegalAttribute(String name)
          Add the name of an attribute that is NOT expected for this tag.
 Map<String,String> getExpectedAttributes()
          Get the map of expected attributes.
 List<DocumentElement> getExpectedChildren()
          Get the list of expected children.
 Set<String> getIllegalAttributes()
          Get the set of illegal attributes.
 String getTag()
          Get the tag that this element represents.
 String toString()
          Output a descriptive string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Tag

public Tag(String tag)
Create the tag element.

Parameters:
tag - The tag name
Method Detail

addExpectedAttribute

public void addExpectedAttribute(String name,
                                 String pattern)
Add an expected attribute to this tag. The second parameter is a regexp pattern on which to match the value of the tag.

Parameters:
name - The name of the attribute
pattern - The pattern to match

addExpectedChild

public Tag addExpectedChild(DocumentElement e)
Add an expected child to this tag. Children must be added in the order they are expected to appear.

Parameters:
e - The element to add
Returns:
This

addIllegalAttribute

public void addIllegalAttribute(String name)
Add the name of an attribute that is NOT expected for this tag.

Parameters:
name - The name of the attribute

getExpectedAttributes

public Map<String,String> getExpectedAttributes()
Get the map of expected attributes.

Returns:
The expected attribute map

getExpectedChildren

public List<DocumentElement> getExpectedChildren()
Get the list of expected children.

Returns:
The expected children

getIllegalAttributes

public Set<String> getIllegalAttributes()
Get the set of illegal attributes.

Returns:
The illegal attributes

getTag

public String getTag()
Get the tag that this element represents.

Returns:
The tag

toString

public String toString()
Output a descriptive string.

Overrides:
toString in class Object
Returns:
The string


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