Package org.simpleframework.xml.stream
Interface Attribute
- All Known Implementing Classes:
DocumentReader.Entry
,EventAttribute
,PullReader.Entry
,StreamReader.Entry
interface Attribute
The
Attribute
interface represents an attribute that
is associated with an event node. An attribute is required to
provide the name and value for the attribute, and optionally the
namespace reference and prefix. For debugging purposes the source
object from the internal XML provider can be returned also.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetName()
This provides the name of the attribute.This is used to acquire the namespace prefix associated with this attribute.This is used to acquire the namespace reference that this attribute is in.This is used to return the source of the attribute.getValue()
This returns the value of the event.boolean
This returns true if the attribute is reserved.
-
Method Details
-
getName
String getName()This provides the name of the attribute. This should be the name of the XML attribute without any namespace prefix. If the name begins with "xml" then this attribute is reserved. according to the namespaces for XML 1.0 specification.- Returns:
- this returns the name of this attribute object
-
getValue
String getValue()This returns the value of the event. Typically this will be the text value that the attribute contains. If the attribute does not contain a value then this returns null.- Returns:
- this returns the value represented by this attribute
-
getReference
String getReference()This is used to acquire the namespace reference that this attribute is in. A namespace is normally associated with an attribute if that attribute is prefixed with a known token. If there is no prefix then this will return null.- Returns:
- this provides the associated namespace reference
-
getPrefix
String getPrefix()This is used to acquire the namespace prefix associated with this attribute. A prefix is used to qualify the attribute within a namespace. So, if this has a prefix then it should have a reference associated with it.- Returns:
- this returns the namespace prefix for the attribute
-
getSource
Object getSource()This is used to return the source of the attribute. Depending on which provider was selected to parse the XML document an object for the internal parsers representation of this will be returned. This is useful for debugging purposes.- Returns:
- this will return the source object for this event
-
isReserved
boolean isReserved()This returns true if the attribute is reserved. An attribute is considered reserved if it begins with "xml" according to the namespaces in XML 1.0 specification. Such attributes are used for namespaces and other such details.- Returns:
- this returns true if the attribute is reserved
-