|
||||||||||
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.Type
Enumerated type for different kinds of component tags. |
Field Summary | |
---|---|
static XmlTag.Type |
CLOSE
A close tag, like </TAG>. |
static XmlTag.Type |
OPEN
An open tag, like <TAG componentId = "xyz">. |
static XmlTag.Type |
OPEN_CLOSE
An open/close tag, like <TAG componentId = "xyz"/>. |
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. |
java.lang.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. |
java.lang.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. |
java.lang.CharSequence |
getString(java.lang.String key)
Get a string attribute. |
XmlTag.Type |
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. |
java.lang.Object |
put(java.lang.String key,
boolean value)
Puts a boolean attribute. |
java.lang.Object |
put(java.lang.String key,
java.lang.CharSequence value)
Puts a string attribute. |
java.lang.Object |
put(java.lang.String key,
int value)
Puts an int attribute. |
java.lang.Object |
put(java.lang.String key,
StringValue value)
Puts a StringValue attribute. |
void |
putAll(java.util.Map map)
Puts all attributes in map |
void |
remove(java.lang.String key)
Removes an attribute. |
void |
setName(java.lang.String name)
Sets the tag name. |
void |
setNamespace(java.lang.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.Type type)
Sets type of this tag if it is not immutable. |
java.lang.CharSequence |
toCharSequence()
|
java.lang.String |
toDebugString()
Converts this object to a string representation. |
java.lang.String |
toString()
Converts this object to a string representation. |
java.lang.String |
toUserDebugString()
Converts this object to a string representation. |
java.lang.CharSequence |
toXmlString(java.lang.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 |
Field Detail |
---|
public static final XmlTag.Type CLOSE
public static final XmlTag.Type OPEN
public static final XmlTag.Type OPEN_CLOSE
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
MarkupElement.equalTo(org.apache.wicket.markup.MarkupElement)
public IValueMap getAttributes()
public boolean hasAttributes()
public int getColumnNumber()
public int getLength()
public int getLineNumber()
public java.lang.String getName()
<b>
's name would be 'b'.
public boolean getNameChanged()
public java.lang.String getNamespace()
public final XmlTag getOpenTag()
public int getPos()
public java.lang.CharSequence getString(java.lang.String key)
key
- The key
public XmlTag.Type 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 java.lang.Object put(java.lang.String key, boolean value)
key
- The keyvalue
- The value
public java.lang.Object put(java.lang.String key, int value)
key
- The keyvalue
- The value
public java.lang.Object put(java.lang.String key, java.lang.CharSequence value)
key
- The keyvalue
- The value
public java.lang.Object put(java.lang.String key, StringValue value)
StringValue
attribute.
key
- The keyvalue
- The value
public void putAll(java.util.Map map)
map
- A key/value mappublic void remove(java.lang.String key)
key
- The key to removepublic void setName(java.lang.String name)
name
- New tag namepublic void setNamespace(java.lang.String namespace)
namespace
- New tag namepublic void setOpenTag(XmlTag tag)
tag
- the open-tag
java.lang.RuntimeException
- if 'this' is not a close tagpublic void setType(XmlTag.Type type)
type
- The new typepublic java.lang.String toDebugString()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.CharSequence toCharSequence()
toCharSequence
in class MarkupElement
MarkupElement.toCharSequence()
public java.lang.String toUserDebugString()
toUserDebugString
in class MarkupElement
public java.lang.CharSequence toXmlString(java.lang.String attributeToBeIgnored)
attributeToBeIgnored
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |