Class AttributeBase
java.lang.Object
com.bea.xml.stream.AttributeBase
- All Implemented Interfaces:
Attribute, XMLEvent, Location, XMLStreamConstants
- Direct Known Subclasses:
NamespaceBase
-
Field Summary
Fields inherited from interface 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
ConstructorsConstructorDescriptionAttributeBase(String prefix, String localName, String value) AttributeBase(String prefix, String namespaceURI, String localName, String value, String attributeType) AttributeBase(QName name, String value) -
Method Summary
Modifier and TypeMethodDescriptionReturns this event as Characters, may result in a class cast exception if this event is not Characters.Returns this event as an end element event, may result in a class cast exception if this event is not a end element.Returns this event as a start element event, may result in a class cast exception if this event is not a start element.intReturn the byte or character offset into the input source this location is pointing to.intReturn the column number where the current event ends, returns -1 if none is available.Gets the type of this attribute, default is the String "CDATA"intReturns an integer code for this event.intReturn the line number where the current event ends, returns -1 if none is available.Return the location of this event.getName()Returns the QName for this attributeReturns the public ID of the XMLThis method is provided for implementations to provide optional type information about the associated event.Returns the system ID of the XMLgetValue()Gets the normalized value of this attributebooleanhasName()booleanA utility function to check if this event is an Attribute.booleanA utility function to check if this event is Characters.booleanbooleanA utility function to check if this event is an EndDocument.booleanA utility function to check if this event is a EndElement.booleanbooleanA utility function to check if this event is an EntityReference.booleanA utility function to check if this event is a Namespace.booleanbooleanA utility function to check if this event is a ProcessingInstruction.booleanBy default, all attributes are created as specified since RI doesn't handle attribute defaulting.booleanA utility function to check if this event is a StartDocument.booleanA utility function to check if this event is a StartElement.booleanvoidrecycle()voidsetCharacterOffset(int c) voidsetColumnNumber(int col) voidsetLineNumber(int line) voidsetLocationURI(String uri) voidsetNamespaceURI(String uri) toString()voidwriteAsEncodedUnicode(Writer writer) This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters.static voidwriteEncodedChar(Writer writer, char c)
-
Constructor Details
-
AttributeBase
-
AttributeBase
-
AttributeBase
-
-
Method Details
-
toString
-
getLineNumber
public int getLineNumber()Description copied from interface:javax.xml.stream.LocationReturn the line number where the current event ends, returns -1 if none is available.- Specified by:
getLineNumberin interfaceLocation- Returns:
- the current line number
-
setLineNumber
public void setLineNumber(int line) -
getColumnNumber
public int getColumnNumber()Description copied from interface:javax.xml.stream.LocationReturn the column number where the current event ends, returns -1 if none is available.- Specified by:
getColumnNumberin interfaceLocation- Returns:
- the current column number
-
setColumnNumber
public void setColumnNumber(int col) -
getCharacterOffset
public int getCharacterOffset()Description copied from interface:javax.xml.stream.LocationReturn the byte or character offset into the input source this location is pointing to. If the input source is a file or a byte stream then this is the byte offset into that stream, but if the input source is a character media then the offset is the character offset. Returns -1 if there is no offset available.- Specified by:
getCharacterOffsetin interfaceLocation- Returns:
- the current offset
-
setCharacterOffset
public void setCharacterOffset(int c) -
getLocationURI
-
setLocationURI
-
getEventType
public int getEventType()Description copied from interface:javax.xml.stream.events.XMLEventReturns an integer code for this event.- Specified by:
getEventTypein interfaceXMLEvent- See Also:
-
hasName
public boolean hasName() -
getName
Description copied from interface:javax.xml.stream.events.AttributeReturns the QName for this attribute -
isNamespaceDeclaration
public boolean isNamespaceDeclaration() -
getLocalName
-
getValue
Description copied from interface:javax.xml.stream.events.AttributeGets the normalized value of this attribute -
getDTDType
Description copied from interface:javax.xml.stream.events.AttributeGets the type of this attribute, default is the String "CDATA"- Specified by:
getDTDTypein interfaceAttribute- Returns:
- the type as a String, default is "CDATA"
-
getNamespaceURI
-
setNamespaceURI
-
isSpecified
public boolean isSpecified()By default, all attributes are created as specified since RI doesn't handle attribute defaulting.- Specified by:
isSpecifiedin interfaceAttribute- Returns:
- returns true if this was specified in the start element
-
isStartElement
public boolean isStartElement()Description copied from interface:javax.xml.stream.events.XMLEventA utility function to check if this event is a StartElement.- Specified by:
isStartElementin interfaceXMLEvent- See Also:
-
isEndElement
public boolean isEndElement()Description copied from interface:javax.xml.stream.events.XMLEventA utility function to check if this event is a EndElement.- Specified by:
isEndElementin interfaceXMLEvent- See Also:
-
isEntityReference
public boolean isEntityReference()Description copied from interface:javax.xml.stream.events.XMLEventA utility function to check if this event is an EntityReference.- Specified by:
isEntityReferencein interfaceXMLEvent- See Also:
-
isProcessingInstruction
public boolean isProcessingInstruction()Description copied from interface:javax.xml.stream.events.XMLEventA utility function to check if this event is a ProcessingInstruction.- Specified by:
isProcessingInstructionin interfaceXMLEvent- See Also:
-
isCharacters
public boolean isCharacters()Description copied from interface:javax.xml.stream.events.XMLEventA utility function to check if this event is Characters.- Specified by:
isCharactersin interfaceXMLEvent- See Also:
-
isAttribute
public boolean isAttribute()Description copied from interface:javax.xml.stream.events.XMLEventA utility function to check if this event is an Attribute.- Specified by:
isAttributein interfaceXMLEvent- See Also:
-
isNamespace
public boolean isNamespace()Description copied from interface:javax.xml.stream.events.XMLEventA utility function to check if this event is a Namespace.- Specified by:
isNamespacein interfaceXMLEvent- See Also:
-
isStartDocument
public boolean isStartDocument()Description copied from interface:javax.xml.stream.events.XMLEventA utility function to check if this event is a StartDocument.- Specified by:
isStartDocumentin interfaceXMLEvent- See Also:
-
isEndDocument
public boolean isEndDocument()Description copied from interface:javax.xml.stream.events.XMLEventA utility function to check if this event is an EndDocument.- Specified by:
isEndDocumentin interfaceXMLEvent- See Also:
-
isEndEntity
public boolean isEndEntity() -
isStartEntity
public boolean isStartEntity() -
getPublicId
Description copied from interface:javax.xml.stream.LocationReturns the public ID of the XML- Specified by:
getPublicIdin interfaceLocation- Returns:
- the public ID, or null if not available
-
getSystemId
Description copied from interface:javax.xml.stream.LocationReturns the system ID of the XML- Specified by:
getSystemIdin interfaceLocation- Returns:
- the system ID, or null if not available
-
getLocation
Description copied from interface:javax.xml.stream.events.XMLEventReturn the location of this event. The Location returned from this method is non-volatile and will retain its information.- Specified by:
getLocationin interfaceXMLEvent- See Also:
-
asStartElement
Description copied from interface:javax.xml.stream.events.XMLEventReturns this event as a start element event, may result in a class cast exception if this event is not a start element.- Specified by:
asStartElementin interfaceXMLEvent
-
asEndElement
Description copied from interface:javax.xml.stream.events.XMLEventReturns this event as an end element event, may result in a class cast exception if this event is not a end element.- Specified by:
asEndElementin interfaceXMLEvent
-
asCharacters
Description copied from interface:javax.xml.stream.events.XMLEventReturns this event as Characters, may result in a class cast exception if this event is not Characters.- Specified by:
asCharactersin interfaceXMLEvent
-
recycle
public void recycle() -
isDefault
public boolean isDefault() -
getSourceName
-
getSchemaType
Description copied from interface:javax.xml.stream.events.XMLEventThis method is provided for implementations to provide optional type information about the associated event. It is optional and will return null if no information is available.- Specified by:
getSchemaTypein interfaceXMLEvent
-
writeAsEncodedUnicode
Description copied from interface:javax.xml.stream.events.XMLEventThis 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:
writeAsEncodedUnicodein interfaceXMLEvent- Parameters:
writer- The writer that will output the data- Throws:
XMLStreamException
-
writeEncodedChar
- Throws:
IOException
-