public class AttributeBase
extends java.lang.Object
implements javax.xml.stream.events.Attribute, javax.xml.stream.Location
An implementation of the Attribute class.
| Constructor and Description |
|---|
AttributeBase(javax.xml.namespace.QName name,
java.lang.String value) |
AttributeBase(java.lang.String prefix,
java.lang.String localName,
java.lang.String value) |
AttributeBase(java.lang.String prefix,
java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String value,
java.lang.String attributeType) |
| Modifier and Type | Method and Description |
|---|---|
javax.xml.stream.events.Characters |
asCharacters()
Returns this event as Characters, may result in
a class cast exception if this event is not Characters.
|
javax.xml.stream.events.EndElement |
asEndElement()
Returns this event as an end element event, may result in
a class cast exception if this event is not a end element.
|
javax.xml.stream.events.StartElement |
asStartElement()
Returns this event as a start element event, may result in
a class cast exception if this event is not a start element.
|
int |
getCharacterOffset()
Return the byte or character offset into the input source this location
is pointing to.
|
int |
getColumnNumber()
Return the column number where the current event ends,
returns -1 if none is available.
|
java.lang.String |
getDTDType()
Gets the type of this attribute, default is
the String "CDATA"
|
int |
getEventType()
Returns an integer code for this event.
|
int |
getLineNumber()
Return the line number where the current event ends,
returns -1 if none is available.
|
java.lang.String |
getLocalName() |
javax.xml.stream.Location |
getLocation()
Return the location of this event.
|
java.lang.String |
getLocationURI() |
javax.xml.namespace.QName |
getName()
Returns the QName for this attribute
|
java.lang.String |
getNamespaceURI() |
java.lang.String |
getPublicId()
Returns the public ID of the XML
|
javax.xml.namespace.QName |
getSchemaType()
This method is provided for implementations to provide
optional type information about the associated event.
|
java.lang.String |
getSourceName() |
java.lang.String |
getSystemId()
Returns the system ID of the XML
|
java.lang.String |
getValue()
Gets the normalized value of this attribute
|
boolean |
hasName() |
boolean |
isAttribute()
A utility function to check if this event is an Attribute.
|
boolean |
isCharacters()
A utility function to check if this event is Characters.
|
boolean |
isDefault() |
boolean |
isEndDocument()
A utility function to check if this event is an EndDocument.
|
boolean |
isEndElement()
A utility function to check if this event is a EndElement.
|
boolean |
isEndEntity() |
boolean |
isEntityReference()
A utility function to check if this event is an EntityReference.
|
boolean |
isNamespace()
A utility function to check if this event is a Namespace.
|
boolean |
isNamespaceDeclaration() |
boolean |
isProcessingInstruction()
A utility function to check if this event is a ProcessingInstruction.
|
boolean |
isSpecified()
By default, all attributes are created as specified since RI doesn't
handle attribute defaulting.
|
boolean |
isStartDocument()
A utility function to check if this event is a StartDocument.
|
boolean |
isStartElement()
A utility function to check if this event is a StartElement.
|
boolean |
isStartEntity() |
void |
recycle() |
void |
setCharacterOffset(int c) |
void |
setColumnNumber(int col) |
void |
setLineNumber(int line) |
void |
setLocationURI(java.lang.String uri) |
void |
setNamespaceURI(java.lang.String uri) |
java.lang.String |
toString() |
void |
writeAsEncodedUnicode(java.io.Writer writer)
This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters.
|
static void |
writeEncodedChar(java.io.Writer writer,
char c) |
public AttributeBase(java.lang.String prefix,
java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String value,
java.lang.String attributeType)
public AttributeBase(java.lang.String prefix,
java.lang.String localName,
java.lang.String value)
public AttributeBase(javax.xml.namespace.QName name,
java.lang.String value)
public java.lang.String toString()
toString in class java.lang.Objectpublic int getLineNumber()
javax.xml.stream.LocationgetLineNumber in interface javax.xml.stream.Locationpublic void setLineNumber(int line)
public int getColumnNumber()
javax.xml.stream.LocationgetColumnNumber in interface javax.xml.stream.Locationpublic void setColumnNumber(int col)
public int getCharacterOffset()
javax.xml.stream.LocationgetCharacterOffset in interface javax.xml.stream.Locationpublic void setCharacterOffset(int c)
public java.lang.String getLocationURI()
public void setLocationURI(java.lang.String uri)
public int getEventType()
javax.xml.stream.events.XMLEventgetEventType in interface javax.xml.stream.events.XMLEventXMLStreamConstants.START_ELEMENT,
XMLStreamConstants.END_ELEMENT,
XMLStreamConstants.CHARACTERS,
XMLStreamConstants.ATTRIBUTE,
XMLStreamConstants.NAMESPACE,
XMLStreamConstants.PROCESSING_INSTRUCTION,
XMLStreamConstants.COMMENT,
XMLStreamConstants.START_DOCUMENT,
XMLStreamConstants.END_DOCUMENT,
XMLStreamConstants.DTDpublic boolean hasName()
public javax.xml.namespace.QName getName()
javax.xml.stream.events.AttributegetName in interface javax.xml.stream.events.Attributepublic boolean isNamespaceDeclaration()
public java.lang.String getLocalName()
public java.lang.String getValue()
javax.xml.stream.events.AttributegetValue in interface javax.xml.stream.events.Attributepublic java.lang.String getDTDType()
javax.xml.stream.events.AttributegetDTDType in interface javax.xml.stream.events.Attributepublic java.lang.String getNamespaceURI()
public void setNamespaceURI(java.lang.String uri)
public boolean isSpecified()
isSpecified in interface javax.xml.stream.events.Attributepublic boolean isStartElement()
javax.xml.stream.events.XMLEventisStartElement in interface javax.xml.stream.events.XMLEventStartElementpublic boolean isEndElement()
javax.xml.stream.events.XMLEventisEndElement in interface javax.xml.stream.events.XMLEventEndElementpublic boolean isEntityReference()
javax.xml.stream.events.XMLEventisEntityReference in interface javax.xml.stream.events.XMLEventEntityReferencepublic boolean isProcessingInstruction()
javax.xml.stream.events.XMLEventisProcessingInstruction in interface javax.xml.stream.events.XMLEventProcessingInstructionpublic boolean isCharacters()
javax.xml.stream.events.XMLEventisCharacters in interface javax.xml.stream.events.XMLEventCharacterspublic boolean isAttribute()
javax.xml.stream.events.XMLEventisAttribute in interface javax.xml.stream.events.XMLEventAttributepublic boolean isNamespace()
javax.xml.stream.events.XMLEventisNamespace in interface javax.xml.stream.events.XMLEventNamespacepublic boolean isStartDocument()
javax.xml.stream.events.XMLEventisStartDocument in interface javax.xml.stream.events.XMLEventStartDocumentpublic boolean isEndDocument()
javax.xml.stream.events.XMLEventisEndDocument in interface javax.xml.stream.events.XMLEventEndDocumentpublic boolean isEndEntity()
public boolean isStartEntity()
public java.lang.String getPublicId()
javax.xml.stream.LocationgetPublicId in interface javax.xml.stream.Locationpublic java.lang.String getSystemId()
javax.xml.stream.LocationgetSystemId in interface javax.xml.stream.Locationpublic javax.xml.stream.Location getLocation()
javax.xml.stream.events.XMLEventgetLocation in interface javax.xml.stream.events.XMLEventLocationpublic javax.xml.stream.events.StartElement asStartElement()
javax.xml.stream.events.XMLEventasStartElement in interface javax.xml.stream.events.XMLEventpublic javax.xml.stream.events.EndElement asEndElement()
javax.xml.stream.events.XMLEventasEndElement in interface javax.xml.stream.events.XMLEventpublic javax.xml.stream.events.Characters asCharacters()
javax.xml.stream.events.XMLEventasCharacters in interface javax.xml.stream.events.XMLEventpublic void recycle()
public boolean isDefault()
public java.lang.String getSourceName()
public javax.xml.namespace.QName getSchemaType()
javax.xml.stream.events.XMLEventgetSchemaType in interface javax.xml.stream.events.XMLEventpublic void writeAsEncodedUnicode(java.io.Writer writer)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.events.XMLEventwriteAsEncodedUnicode in interface javax.xml.stream.events.XMLEventwriter - The writer that will output the dataXMLStreamException - if there is a fatal error writing the eventpublic static void writeEncodedChar(java.io.Writer writer,
char c)
throws java.io.IOException
java.io.IOException