java.lang.Object
tools.jackson.dataformat.xml.ser.XmlDeclaration
- All Implemented Interfaces:
XmlGeneratorWritable
Immutable entity representing an XML Declaration to write (e.g.
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>).
Normal entry point is XmlGeneratorInitializer.addXmlDeclaration(String, String)
(and its overloads) rather than constructing this class directly.
- Since:
- 3.2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidwrite(ToXmlGenerator xmlGen, org.codehaus.stax2.XMLStreamWriter2 sw) Method to call to actually write out the entity using givenXMLStreamWriter2.
-
Constructor Details
-
XmlDeclaration
- Parameters:
version- XML version: must be non-null, typically "1.0" or "1.1"encoding- Encoding to declare; may benull(or empty, treated asnull) to omit the encoding pseudo-attribute. Note: whenstandaloneis non-null, a nullencodingwill be silently substituted with "UTF-8" since the underlying StaxwriteStartDocument(version, encoding, standalone)overload requires a non-null encoding.standalone-standalonepseudo-attribute value;nullmeans omit the attribute
-
-
Method Details
-
write
public void write(ToXmlGenerator xmlGen, org.codehaus.stax2.XMLStreamWriter2 sw) throws XMLStreamException Description copied from interface:XmlGeneratorWritableMethod to call to actually write out the entity using givenXMLStreamWriter2.ToXmlGeneratoris only passed in case access to configuration was needed.- Specified by:
writein interfaceXmlGeneratorWritable- Parameters:
xmlGen- Generator that called this method: MUST NOT call its output methods, only to be used for configuration accesssw- Writer to use for actual output of XML event- Throws:
XMLStreamException
-