com.sun.xml.stream.events
Class AttributeImpl

java.lang.Object
  extended by com.sun.xml.stream.events.DummyEvent
      extended by com.sun.xml.stream.events.AttributeImpl
All Implemented Interfaces:
javax.xml.stream.events.Attribute, javax.xml.stream.events.XMLEvent, javax.xml.stream.XMLStreamConstants
Direct Known Subclasses:
NamespaceImpl

public class AttributeImpl
extends DummyEvent
implements javax.xml.stream.events.Attribute

Implementation of Attribute Event.

Author:
Neeraj Bajaj, Sun Microsystems, K.Venugopal, Sun Microsystems

Field Summary
 
Fields inherited from class com.sun.xml.stream.events.DummyEvent
fLocation
 
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
 
Constructor Summary
AttributeImpl()
           
AttributeImpl(javax.xml.namespace.QName qname, java.lang.String value, java.lang.String nonNormalizedvalue, java.lang.String type, boolean isSpecified)
           
AttributeImpl(java.lang.String name, java.lang.String value)
           
AttributeImpl(java.lang.String prefix, java.lang.String name, java.lang.String value)
           
AttributeImpl(java.lang.String prefix, java.lang.String uri, java.lang.String localPart, java.lang.String value, java.lang.String type)
           
AttributeImpl(java.lang.String prefix, java.lang.String uri, java.lang.String localPart, java.lang.String value, java.lang.String nonNormalizedvalue, java.lang.String type, boolean isSpecified)
           
 
Method Summary
 java.lang.String getDTDType()
          Gets the type of this attribute, default is "CDATA
 javax.xml.namespace.QName getName()
           
 java.lang.String getNonNormalizedValue()
           
 java.lang.String getValue()
           
protected  void init()
           
 boolean isSpecified()
           
 void setAttributeType(java.lang.String attributeType)
           
 void setName(javax.xml.namespace.QName name)
           
 void setNonNormalizedValue(java.lang.String nonNormalizedvalue)
           
 void setSpecified(boolean isSpecified)
          is this attribute is specified in the instance document
 void setValue(java.lang.String value)
           
 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.
 
Methods inherited from class com.sun.xml.stream.events.DummyEvent
asCharacters, asEndElement, asStartElement, getEventType, getLocation, getSchemaType, isAttribute, isCharacterData, isCharacters, isEndDocument, isEndElement, isEntityReference, isNamespace, isProcessingInstruction, isStartDocument, isStartElement, setEventType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.xml.stream.events.XMLEvent
asCharacters, asEndElement, asStartElement, getEventType, getLocation, getSchemaType, isAttribute, isCharacters, isEndDocument, isEndElement, isEntityReference, isNamespace, isProcessingInstruction, isStartDocument, isStartElement
 

Constructor Detail

AttributeImpl

public AttributeImpl()

AttributeImpl

public AttributeImpl(java.lang.String name,
                     java.lang.String value)

AttributeImpl

public AttributeImpl(java.lang.String prefix,
                     java.lang.String name,
                     java.lang.String value)

AttributeImpl

public AttributeImpl(java.lang.String prefix,
                     java.lang.String uri,
                     java.lang.String localPart,
                     java.lang.String value,
                     java.lang.String type)

AttributeImpl

public AttributeImpl(java.lang.String prefix,
                     java.lang.String uri,
                     java.lang.String localPart,
                     java.lang.String value,
                     java.lang.String nonNormalizedvalue,
                     java.lang.String type,
                     boolean isSpecified)

AttributeImpl

public AttributeImpl(javax.xml.namespace.QName qname,
                     java.lang.String value,
                     java.lang.String nonNormalizedvalue,
                     java.lang.String type,
                     boolean isSpecified)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setName

public void setName(javax.xml.namespace.QName name)

getName

public javax.xml.namespace.QName getName()
Specified by:
getName in interface javax.xml.stream.events.Attribute

setValue

public void setValue(java.lang.String value)

getValue

public java.lang.String getValue()
Specified by:
getValue in interface javax.xml.stream.events.Attribute

setNonNormalizedValue

public void setNonNormalizedValue(java.lang.String nonNormalizedvalue)

getNonNormalizedValue

public java.lang.String getNonNormalizedValue()

setAttributeType

public void setAttributeType(java.lang.String attributeType)

getDTDType

public java.lang.String getDTDType()
Gets the type of this attribute, default is "CDATA

Specified by:
getDTDType in interface javax.xml.stream.events.Attribute

setSpecified

public void setSpecified(boolean isSpecified)
is this attribute is specified in the instance document


isSpecified

public boolean isSpecified()
Specified by:
isSpecified in interface javax.xml.stream.events.Attribute

writeAsEncodedUnicode

public void writeAsEncodedUnicode(java.io.Writer writer)
                           throws javax.xml.stream.XMLStreamException
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.

Specified by:
writeAsEncodedUnicode in interface javax.xml.stream.events.XMLEvent
Overrides:
writeAsEncodedUnicode in class DummyEvent
Parameters:
writer - The writer that will output the data
Throws:
XMLStreamException - if there is a fatal error writing the event

init

protected void init()


Copyright ? 2002-2003 Apache XML Project. All Rights Reserved.