|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.markup.MarkupElement org.apache.wicket.markup.parser.XmlTag
public class XmlTag
A subclass of MarkupElement which represents a tag including namespace and its optional attributes. XmlTags are returned by the XML parser.
Nested Class Summary | |
---|---|
static class |
XmlTag.TagType
Enumerated type for different kinds of component tags. |
Constructor Summary | |
---|---|
XmlTag()
Construct. |
Method Summary | |
---|---|
boolean |
closes(XmlTag open)
Gets whether this tag closes the provided open tag. |
boolean |
equalTo(MarkupElement element)
This is not an implementation of equals because we don't care about hashCodes for MarkupElements yet. |
IValueMap |
getAttributes()
Gets a hashmap of this tag's attributes. |
int |
getColumnNumber()
Get the column number. |
int |
getLength()
Gets the length of the tag in characters. |
int |
getLineNumber()
Get the line number. |
String |
getName()
Gets the name of the tag, for example the tag <b> 's name would be 'b'. |
boolean |
getNameChanged()
Get whether the name of this component tag was changed. |
String |
getNamespace()
Namespace of the tag, if available. |
XmlTag |
getOpenTag()
Assuming this is a close tag, return the corresponding open tag |
int |
getPos()
Gets the location of the tag in the input string. |
CharSequence |
getString(String key)
Get a string attribute. |
XmlTag.TagType |
getType()
Get the tag type. |
boolean |
hasAttributes()
|
boolean |
hasEqualTagName(XmlTag tag)
Compare tag name including namespace |
boolean |
isClose()
Gets whether this is a close tag. |
boolean |
isMutable()
|
boolean |
isOpen()
Gets whether this is an open tag. |
boolean |
isOpenClose()
Gets whether this tag is an open/ close tag. |
void |
makeImmutable()
Makes this tag object immutable by making the attribute map unmodifiable. |
XmlTag |
mutable()
Gets this tag if it is already mutable, or a mutable copy of this tag if it is immutable. |
Object |
put(String key,
boolean value)
Puts a boolean attribute. |
Object |
put(String key,
CharSequence value)
Puts a string attribute. |
Object |
put(String key,
int value)
Puts an int attribute. |
Object |
put(String key,
StringValue value)
Puts a StringValue attribute. |
void |
putAll(Map<String,Object> map)
Puts all attributes in map |
void |
remove(String key)
Removes an attribute. |
void |
setName(String name)
Sets the tag name. |
void |
setNamespace(String namespace)
Sets the tag namespace. |
void |
setOpenTag(XmlTag tag)
Assuming this is a close tag, assign it's corresponding open tag. |
void |
setType(XmlTag.TagType type)
Sets type of this tag if it is not immutable. |
CharSequence |
toCharSequence()
|
String |
toDebugString()
Converts this object to a string representation. |
String |
toString()
Converts this object to a string representation. |
String |
toUserDebugString()
Converts this object to a string representation. |
CharSequence |
toXmlString(String attributeToBeIgnored)
Assuming some attributes have been changed, toXmlString() rebuilds the String on based on the tags informations. |
Methods inherited from class org.apache.wicket.markup.MarkupElement |
---|
closes |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public XmlTag()
Method Detail |
---|
public final boolean closes(XmlTag open)
open
- The open tag
public final boolean equalTo(MarkupElement element)
MarkupElement
equalTo
in class MarkupElement
element
- The markup element to compare with
public IValueMap getAttributes()
public boolean hasAttributes()
public int getColumnNumber()
public int getLength()
public int getLineNumber()
public String getName()
<b>
's name would be 'b'.
public boolean getNameChanged()
public String getNamespace()
public final XmlTag getOpenTag()
public int getPos()
public CharSequence getString(String key)
key
- The key
public XmlTag.TagType getType()
public boolean isClose()
public final boolean isMutable()
public boolean isOpen()
public boolean isOpenClose()
public boolean hasEqualTagName(XmlTag tag)
tag
-
public void makeImmutable()
public XmlTag mutable()
public Object put(String key, boolean value)
key
- The keyvalue
- The value
public Object put(String key, int value)
key
- The keyvalue
- The value
public Object put(String key, CharSequence value)
key
- The keyvalue
- The value
public Object put(String key, StringValue value)
StringValue
attribute.
key
- The keyvalue
- The value
public void putAll(Map<String,Object> map)
map
- A key/value mappublic void remove(String key)
key
- The key to removepublic void setName(String name)
name
- New tag namepublic void setNamespace(String namespace)
namespace
- New tag namepublic void setOpenTag(XmlTag tag)
tag
- the open-tag
RuntimeException
- if 'this' is not a close tagpublic void setType(XmlTag.TagType type)
type
- The new typepublic String toDebugString()
public String toString()
toString
in class Object
public CharSequence toCharSequence()
toCharSequence
in class MarkupElement
public String toUserDebugString()
toUserDebugString
in class MarkupElement
public CharSequence toXmlString(String attributeToBeIgnored)
attributeToBeIgnored
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |