|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object org.thymeleaf.dom.Attribute
public final class Attribute
Models an element attribute.
Field Summary | |
---|---|
static String |
XMLNS_PREFIX
Prefix for namespace-definition attributes (like xmlns:th). |
Constructor Summary | |
---|---|
Attribute(String name,
String value)
|
Method Summary | |
---|---|
String |
getNormalizedName()
Returns the normalized name of the attribute. |
String |
getNormalizedPrefix()
Returns the normalized prefix of this attribute (part of its name), if it exists, or null if the element is unprefixed. |
String |
getOriginalName()
Returns the original name of the attribute. |
String |
getUnprefixedNormalizedName()
Returns the normalized version of the attribute name, without its prefix (if it has one). |
String |
getValue()
Returns the value of the attribute. |
String |
getXmlnsPrefix()
If this is a namespace declaration attribute (like "xmlns:x"), this method returns the prefix (the "x"). |
boolean |
hasPrefix()
Returns whether the attribute name has a prefix or not. |
boolean |
isXmlnsAttribute()
Returns whether this attribute is a namespace declaration (xmlns:*) or not. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String XMLNS_PREFIX
Prefix for namespace-definition attributes (like xmlns:th).
Constructor Detail |
---|
public Attribute(String name, String value)
Method Detail |
---|
public String getOriginalName()
Returns the original name of the attribute. Given the fact that the engine works using the normalized versions of attribute names (in order to be case-insensitive), it is necessary to make a distinction between the 'original' name of an attribute (as it is written in the template file) and its 'normalized' name.
If the attribute name has a prefix, this 'original name' includes such prefix.
public String getNormalizedName()
Returns the normalized name of the attribute. Attribute names are normalized by
means of the Node.normalizeName(String)
method so that the engine
can work in a case-insensitive way.
If the attribute name has a prefix, this 'normalized name' includes such prefix.
public String getNormalizedPrefix()
Returns the normalized prefix of this attribute (part of its name), if it exists, or null if the element is unprefixed.
Prefixes are normalized in the same way as element names, using the
Node.normalizeName(String)
method.
public String getUnprefixedNormalizedName()
Returns the normalized version of the attribute name, without its prefix (if it has one).
public boolean hasPrefix()
Returns whether the attribute name has a prefix or not.
public String getValue()
Returns the value of the attribute.
public boolean isXmlnsAttribute()
Returns whether this attribute is a namespace declaration (xmlns:*) or not.
public String getXmlnsPrefix()
If this is a namespace declaration attribute (like "xmlns:x"), this method returns the prefix (the "x").
If this is not a namespace declaration attribute, this method will return null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |