package org.apache.wicket.markup.parser;
A subclass of MarkupElement which represents a tag including namespace and its optional
attributes. XmlTags are returned by the XML parser.
A close tag, like </TAG>.
An open tag, like <TAG componentId = "xyz">.
An open/close tag, like <TAG componentId = "xyz"/>.
Length of this tag in characters.
Name of tag, such as "img" or "input".
Namespace of the tag, if available, such as <wicket:link ...>
Position of this tag in the input that was parsed.
The tag type (OPEN, CLOSE or OPEN_CLOSE).
Any component tag that this tag closes.
If mutable, the immutable tag that this tag is a mutable copy of.
True if this tag is mutable, false otherwise.
True if the name of this tag was changed.
Enumerated type for different kinds of component tags.
Construct.
- Parameters:
name
name of type
Gets whether this tag closes the provided open tag.
- Parameters:
open
The open tag- Returns:
- True if this tag closes the given open tag
if (element instanceof XmlTag)
Gets a hashmap of this tag's attributes.
- Returns:
- The tag's attributes
- Returns:
- true if there 1 or more attributes.
Get the column number.
- Returns:
- Returns the columnNumber.
Gets the length of the tag in characters.
Get the line number.
- Returns:
- Returns the lineNumber.
Gets the name of the tag, for example the tag
<b>'s name would be 'b'.
Get whether the name of this component tag was changed.
- Returns:
- Returns true if the name of this component tag was changed
Namespace of the tag, if available. For example, <wicket:link>.
- Returns:
- The tag's namespace
Assuming this is a close tag, return the corresponding open tag
- Returns:
- The open tag. Null, if no open tag available
Gets the location of the tag in the input string.
- Returns:
- Tag location (index in input string)
Get a string attribute.
- Parameters:
key
The key- Returns:
- The string value
Get the tag type.
- Returns:
- the tag type (OPEN, CLOSE or OPEN_CLOSE).
Gets whether this is a close tag.
- Returns:
- True if this tag is a close tag
- Returns:
- True, if tag is mutable
Gets whether this is an open tag.
- Returns:
- True if this tag is an open tag
Gets whether this tag is an open/ close tag.
- Returns:
- True if this tag is an open and a close tag
Compare tag name including namespace
- Parameters:
tag- Returns:
- true if name and namespace are equal
Makes this tag object immutable by making the attribute map unmodifiable. Immutable tags
cannot be made mutable again. They can only be copied into new mutable tag objects.
Gets this tag if it is already mutable, or a mutable copy of this tag if it is immutable.
- Returns:
- This tag if it is already mutable, or a mutable copy of this tag if it is immutable.
Copies all internal properties from this tag to
dest. This is basically
cloning without instance creation.
- Parameters:
dest
tag whose properties will be set
Puts a boolean attribute.
- Parameters:
key
The keyvalue
The value- Returns:
- previous value associated with specified key, or null if there was no mapping for
key. A null return can also indicate that the map previously associated null with the
specified key, if the implementation supports null values.
Puts an int attribute.
- Parameters:
key
The keyvalue
The value- Returns:
- previous value associated with specified key, or null if there was no mapping for
key. A null return can also indicate that the map previously associated null with the
specified key, if the implementation supports null values.
Puts a string attribute.
- Parameters:
key
The keyvalue
The value- Returns:
- previous value associated with specified key, or null if there was no mapping for
key. A null return can also indicate that the map previously associated null with the
specified key, if the implementation supports null values.
Puts a
org.apache.wicket.util.string.StringValueattribute.
- Parameters:
key
The keyvalue
The value- Returns:
- previous value associated with specified key, or null if there was no mapping for
key. A null return can also indicate that the map previously associated null with the
specified key, if the implementation supports null values.
Puts all attributes in map
- Parameters:
map
A key/value map
Removes an attribute.
- Parameters:
key
The key to remove
Sets the tag name.
- Parameters:
name
New tag name
Sets the tag namespace.
- Parameters:
namespace
New tag name
Assuming this is a close tag, assign it's corresponding open tag.
Sets type of this tag if it is not immutable.
- Parameters:
type
The new type
Converts this object to a string representation.
- Returns:
- String version of this object
return "[Tag name = " + name + ", pos = " + pos + ", line = " + lineNumber + ", length = " +
Converts this object to a string representation.
- Returns:
- String version of this object
Converts this object to a string representation.
- Returns:
- String version of this object
Assuming some attributes have been changed, toXmlString() rebuilds the String on based on the
tags informations.
- Parameters:
attributeToBeIgnored- Returns:
- A xml string matching the tag
if (attributes.size() > 0)
((attributeToBeIgnored == null) || !key