Package org.apache.sis.xml
Class TransformedEvent<E extends XMLEvent>
java.lang.Object
org.apache.sis.xml.TransformedEvent<E>
- All Implemented Interfaces:
XMLEvent
,XMLStreamConstants
- Direct Known Subclasses:
TransformedEvent.Attr
,TransformedEvent.End
,TransformedEvent.NS
,TransformedEvent.Start
Base class of events that are wrappers over the events emitted during the reading or writing of an XML document.
Those wrappers are used for changing the namespace and sometimes the name of XML elements or attributes.
- Since:
- 1.0
- Version:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
Wrapper over an attribute emitted during the reading or writing of an XML document.(package private) static final class
Wrapper over an element emitted during the reading or writing of an XML document.(package private) static final class
Wrapper over a namespace emitted during the reading or writing of an XML document.(package private) static class
Wrapper over an element emitted during the reading or writing of an XML document.(package private) static final class
The"xsi:type"
attribute. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final E
The event to be exported in a different namespace.(package private) final QName
Exported name of the attribute or element.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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal QName
getName()
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
(package private) final Appendable
name
(Appendable out) Appends the name to the given output.final String
toString()
Returns the event as per the XML 1.0 without indentation or whitespace.(package private) abstract void
write
(Appendable out) Implementation ofwriteAsEncodedUnicode(Writer)
andtoString()
.final void
writeAsEncodedUnicode
(Writer writer) Writes the event as per the XML 1.0 without indentation or whitespace.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
getEventType
-
Field Details
-
event
The event to be exported in a different namespace. -
name
Exported name of the attribute or element. Will often (but not necessarily) have the same local part thanevent.getName()
but a different namespace.
-
-
Constructor Details
-
TransformedEvent
Exports a new event.- Parameters:
event
- the event to be exported in a different namespace.name
- the exported name of the attribute or element.
-
-
Method Details
-
isStartElement
public boolean isStartElement()- Specified by:
isStartElement
in interfaceXMLEvent
-
isAttribute
public boolean isAttribute()- Specified by:
isAttribute
in interfaceXMLEvent
-
isNamespace
public boolean isNamespace()- Specified by:
isNamespace
in interfaceXMLEvent
-
isEndElement
public boolean isEndElement()- Specified by:
isEndElement
in interfaceXMLEvent
-
isEntityReference
public boolean isEntityReference()- Specified by:
isEntityReference
in interfaceXMLEvent
-
isProcessingInstruction
public boolean isProcessingInstruction()- Specified by:
isProcessingInstruction
in interfaceXMLEvent
-
isCharacters
public boolean isCharacters()- Specified by:
isCharacters
in interfaceXMLEvent
-
isStartDocument
public boolean isStartDocument()- Specified by:
isStartDocument
in interfaceXMLEvent
-
isEndDocument
public boolean isEndDocument()- Specified by:
isEndDocument
in interfaceXMLEvent
-
asStartElement
- Specified by:
asStartElement
in interfaceXMLEvent
-
asEndElement
- Specified by:
asEndElement
in interfaceXMLEvent
-
asCharacters
- Specified by:
asCharacters
in interfaceXMLEvent
-
getLocation
- Specified by:
getLocation
in interfaceXMLEvent
-
getSchemaType
- Specified by:
getSchemaType
in interfaceXMLEvent
-
getName
-
name
Appends the name to the given output. This is a convenience method forwrite(Appendable)
implementations.- Throws:
IOException
-
write
Implementation ofwriteAsEncodedUnicode(Writer)
andtoString()
.- Throws:
IOException
-
writeAsEncodedUnicode
Writes the event as per the XML 1.0 without indentation or whitespace. This implementation delegates towrite(Appendable)
.- Specified by:
writeAsEncodedUnicode
in interfaceXMLEvent
- Throws:
XMLStreamException
-
toString
Returns the event as per the XML 1.0 without indentation or whitespace. This implementation delegates towrite(Appendable)
.
-