Top Fields Constructors Methods
org.apache.xerces.stax.events

public Class AttributeImpl

extends XMLEventImpl
implements Attribute
Class Inheritance
All Implemented Interfaces
javax.xml.stream.events.Attribute, javax.xml.stream.events.XMLEvent, javax.xml.stream.XMLStreamConstants
Known Direct Subclasses
org.apache.xerces.stax.events.NamespaceImpl
Imports
java.io.IOException, .Writer, javax.xml.namespace.QName, javax.xml.stream.Location, .XMLStreamException, javax.xml.stream.events.Attribute

Author
Lucian Holland
Version
$Id: AttributeImpl.java 730471 2008-12-31 20:45:32Z mrglavas $

Field Summary

Modifier and TypeField and Description
private final String
private final boolean
private final QName
private final String

Constructor Summary

AccessConstructor and Description
public
AttributeImpl(final QName name, final String value, final String dtdType, final boolean isSpecified, final Location location)

Constructor.

protected
AttributeImpl(final int type, final QName name, final String value, final String dtdType, final boolean isSpecified, final Location location)

Method Summary

Modifier and TypeMethod and Description
public final String
getDTDType()

Implements javax.xml.stream.events.Attribute.getDTDType.

Gets the type of this attribute, default is the String "CDATA".
public final QName
getName()

Implements javax.xml.stream.events.Attribute.getName.

Returns the QName for this attribute.
public final String
getValue()

Implements javax.xml.stream.events.Attribute.getValue.

Gets the normalized value of this attribute.
public final boolean
isSpecified()

Implements javax.xml.stream.events.Attribute.isSpecified.

A flag indicating whether this attribute was actually specified in the start-tag of its element, or was defaulted from the schema.
public final void
writeAsEncodedUnicode(Writer
The writer that will output the data
writer
)

Implements javax.xml.stream.events.XMLEvent.writeAsEncodedUnicode.

This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters.
Inherited from org.apache.xerces.stax.events.XMLEventImpl:
asCharactersasEndElementasStartElementgetEventTypegetLocationgetSchemaTypeisAttributeisCharactersisEndDocumentisEndElementisEntityReferenceisNamespaceisProcessingInstructionisStartDocumentisStartElementtoString

Field Detail

fDtdTypeback to summary
private final String fDtdType
fIsSpecifiedback to summary
private final boolean fIsSpecified
fNameback to summary
private final QName fName
fValueback to summary
private final String fValue

Constructor Detail

AttributeImplback to summary
public AttributeImpl(final QName name, final String value, final String dtdType, final boolean isSpecified, final Location location)

Constructor.

AttributeImplback to summary
protected AttributeImpl(final int type, final QName name, final String value, final String dtdType, final boolean isSpecified, final Location location)

Method Detail

getDTDTypeback to summary
public final String getDTDType()

Implements javax.xml.stream.events.Attribute.getDTDType.

Doc from javax.xml.stream.events.Attribute.getDTDType.

Gets the type of this attribute, default is the String "CDATA".

Returns:String

the type as a String, default is "CDATA"

See Also
javax.xml.stream.events.Attribute#getDTDType()
getNameback to summary
public final QName getName()

Implements javax.xml.stream.events.Attribute.getName.

Doc from javax.xml.stream.events.Attribute.getName.

Returns the QName for this attribute.

Returns:QName

the QName of the attribute

See Also
javax.xml.stream.events.Attribute#getName()
getValueback to summary
public final String getValue()

Implements javax.xml.stream.events.Attribute.getValue.

Doc from javax.xml.stream.events.Attribute.getValue.

Gets the normalized value of this attribute.

Returns:String

the normalized value of the attribute

See Also
javax.xml.stream.events.Attribute#getValue()
isSpecifiedback to summary
public final boolean isSpecified()

Implements javax.xml.stream.events.Attribute.isSpecified.

Doc from javax.xml.stream.events.Attribute.isSpecified.

A flag indicating whether this attribute was actually specified in the start-tag of its element, or was defaulted from the schema.

Returns:boolean

returns true if this was specified in the start element

See Also
javax.xml.stream.events.Attribute#isSpecified()
writeAsEncodedUnicodeback to summary
public final void writeAsEncodedUnicode(Writer writer) throws XMLStreamException

Implements javax.xml.stream.events.XMLEvent.writeAsEncodedUnicode.

Doc from javax.xml.stream.events.XMLEvent.writeAsEncodedUnicode.

This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters. No indentation or whitespace should be outputted. Any user defined event type SHALL have this method called when being written to on an output stream. Built in Event types MUST implement this method, but implementations MAY choose not call these methods for optimizations reasons when writing out built in Events to an output stream. The output generated MUST be equivalent in terms of the infoset expressed.

Parameters
writer:Writer

The writer that will output the data

Exceptions
XMLStreamException:
if there is a fatal error writing the event