Package org.simpleframework.xml.stream
Class StreamReader.Entry
java.lang.Object
org.simpleframework.xml.stream.EventAttribute
org.simpleframework.xml.stream.StreamReader.Entry
- All Implemented Interfaces:
Attribute
- Enclosing class:
StreamReader
The
Entry
object is used to represent an attribute
within a start element. This holds the name and value of the
attribute as well as the namespace prefix and reference. These
details can be used to represent the attribute so that should
the core reader require these details they can be acquired.-
Field Summary
Fields -
Constructor Summary
Constructors -
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 node for the attribute.getValue()
This returns the value of the event.boolean
This returns true if the attribute is reserved.
-
Field Details
-
entry
This is the attribute object representing this attribute.
-
-
Constructor Details
-
Entry
Constructor for theEntry
object. This creates an attribute object that is used to extract the name, value namespace prefix, and namespace reference from the provided node. This is used to populate any start events created.- Parameters:
entry
- this is the node that represents the attribute
-
-
Method Details
-
getName
This provides the name of the attribute. This will 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
-
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.- Specified by:
getPrefix
in interfaceAttribute
- Overrides:
getPrefix
in classEventAttribute
- Returns:
- this returns the namespace prefix for the attribute
-
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.- Specified by:
getReference
in interfaceAttribute
- Overrides:
getReference
in classEventAttribute
- Returns:
- this provides the associated namespace reference
-
getValue
This returns the value of the event. This will be the value that the attribute contains. If the attribute does not have a value then this returns null or an empty string.- Returns:
- this returns the value represented by this object
-
isReserved
public 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.- Specified by:
isReserved
in interfaceAttribute
- Overrides:
isReserved
in classEventAttribute
- Returns:
- this returns true if the attribute is reserved
-
getSource
This is used to return the node for the attribute. Because this represents a StAX attribute the StAX object is returned. Returning the node helps with certain debugging issues.- Specified by:
getSource
in interfaceAttribute
- Overrides:
getSource
in classEventAttribute
- Returns:
- this will return the source object for this
-