|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object 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. |
|
XmlTag(org.apache.wicket.markup.parser.XmlTag.TextSegment text,
XmlTag.TagType type)
Construct. |
Method Summary | |
---|---|
boolean |
closes(XmlTag open)
Gets whether this tag closes the provided open tag. |
boolean |
equalTo(XmlTag element)
|
CharSequence |
getAttribute(String key)
Get a string attribute. |
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'. |
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. |
XmlTag.TagType |
getType()
Get the tag type. |
boolean |
hasAttributes()
|
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. |
XmlTag |
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()
String representation with line and column number |
CharSequence |
toXmlString(String attributeToBeIgnored)
Assuming some attributes have been changed, toXmlString() rebuilds the String on based on the tags informations. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public XmlTag()
public XmlTag(org.apache.wicket.markup.parser.XmlTag.TextSegment text, XmlTag.TagType type)
text
- type
- Method Detail |
---|
public final boolean closes(XmlTag open)
open
- The open tag
public final boolean equalTo(XmlTag element)
element
-
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 String getNamespace()
public final XmlTag getOpenTag()
public int getPos()
public CharSequence getAttribute(String key)
key
- The key
public XmlTag.TagType getType()
public boolean isClose()
public final boolean isMutable()
public boolean isOpen()
public boolean isOpenClose()
public XmlTag 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()
public String toUserDebugString()
public CharSequence toXmlString(String attributeToBeIgnored)
attributeToBeIgnored
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |