FromXmlParser and ToXmlGenerator
instances.
Implements JsonFactory since interface for constructing XML backed
parsers and generators is quite similar to dealing with JSON.
| Modifier and Type | Field and Description |
|---|---|
| protected String | |
| protected transient String | _jdkXmlInFactory
Hiding place for JDK-serialization unthawed factories... |
| protected transient String | _jdkXmlOutFactory
Hiding place for JDK-serialization unthawed factories... |
| protected XmlNameProcessor | |
| protected int | |
| protected transient XMLInputFactory | |
| protected transient XMLOutputFactory | |
| protected int | |
| private static final byte | |
| private static final byte | |
| private static final byte | |
| private static final byte | |
| private static final byte | |
| private static final byte | |
| private static final byte | |
| private static final byte | |
| pack-priv static final int | DEFAULT_XML_GENERATOR_FEATURE_FLAGS
Bitfield (set of flags) of all generator features that are enabled by default. |
| pack-priv static final int | DEFAULT_XML_PARSER_FEATURE_FLAGS
Bitfield (set of flags) of all parser features that are enabled by default. |
| public static final String | FORMAT_NAME_XML
Name used to identify XML format
(and returned by |
| private static final long | |
| private static final byte | |
| private static final byte | |
| private static final byte |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | |
| public | |
| public | XmlFactory(ObjectCodec oc, int xpFeatures, int xgFeatures, XMLInputFactory xmlIn, XMLOutputFactory xmlOut, String nameForTextElem)
|
| protected | XmlFactory(ObjectCodec oc, int xpFeatures, int xgFeatures, XMLInputFactory xmlIn, XMLOutputFactory xmlOut, String nameForTextElem, XmlNameProcessor nameProcessor)
|
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected JsonGenerator | _createGenerator(Writer
Writer underlying writer to write generated content to out, IOContext I/O context to use ctxt)Overrides com. Overridable factory method that actually instantiates generator for
given |
| protected FromXmlParser | _createParser(InputStream
InputStream to use for reading content to parse in, IOContext I/O context to use for parsing ctxt)Overrides com. Overridable factory method that actually instantiates desired parser
given |
| protected FromXmlParser | _createParser(Reader
Reader to use for reading content to parse r, IOContext I/O context to use for parsing ctxt)Overrides com. Overridable factory method that actually instantiates parser
using given |
| protected FromXmlParser | _createParser(char[]
Buffer that contains content to parse data, int Offset to the first character of data to parse offset, int Number of characters within buffer to parse len, IOContext I/O context to use for parsing ctxt, boolean Whether input buffer is recycled by the factory recycleBuffer)Overrides com. Overridable factory method that actually instantiates parser
using given |
| protected FromXmlParser | _createParser(byte[]
Buffer that contains content to parse data, int Offset to the first character of data to parse offset, int Number of characters within buffer to parse len, IOContext I/O context to use for parsing ctxt)Overrides com. Overridable factory method that actually instantiates parser
using given |
| protected XMLStreamWriter | |
| protected XMLStreamWriter | |
| protected OutputStream | |
| protected Writer | |
| protected void | |
| protected final XMLStreamReader | |
| protected final XMLStreamWriter | |
| public static XmlFactoryBuilder | builder()
Hides com. Main factory method to use for constructing |
| public boolean | canUseCharArrays()
Overrides com. As of 2.4, we do have actual capability for passing char arrays efficiently, but unfortunately have no working mechanism for recycling buffers. |
| public final XmlFactory | configure(FromXmlParser.
Method for enabling or disabling specified XML parser feature. |
| public final XmlFactory | configure(ToXmlGenerator.
Method for enabling or disabling specified XML generator feature. |
| public XmlFactory | copy()
Overrides com. Note compared to base implementation by |
| public ToXmlGenerator | createGenerator(OutputStream out)
Overrides com. Convenience method for constructing generator that uses default encoding of the format (UTF-8 for JSON and most other data formats). |
| public ToXmlGenerator | createGenerator(OutputStream
OutputStream to use for writing JSON content out, JsonEncoding Character encoding to use enc)Overrides com. Method for constructing JSON generator for writing JSON content using specified output stream. |
| public ToXmlGenerator | createGenerator(Writer
Writer to use for writing JSON content out)Overrides com. Method for constructing JSON generator for writing JSON content using specified Writer. |
| public ToXmlGenerator | createGenerator(File
File to write contents to f, JsonEncoding Character encoding to use enc)Overrides com. Method for constructing JSON generator for writing JSON content to specified file, overwriting contents it might have (or creating it if such file does not yet exist). |
| public ToXmlGenerator | createGenerator(XMLStreamWriter sw)
Factory method that wraps given |
| public JsonParser | createParser(String content)
Overrides com. Overridden just to prevent trying to optimize access via char array; while nice idea, problem is that we don't have proper hooks to ensure that temporary buffer gets recycled; so let's just use StringReader. |
| public FromXmlParser | createParser(XMLStreamReader sr)
Factory method that wraps given |
| public XmlFactory | |
| public XmlFactory | |
| public XmlFactory | |
| public XmlFactory | |
| public int | |
| public String | getFormatName()
Overrides com. Method that returns short textual id identifying format this factory supports. |
| public int | |
| public Class | getFormatReadFeatureType()
Overrides com. Method for accessing kind of |
| public Class | getFormatWriteFeatureType()
Overrides com. Method for accessing kind of |
| public XMLInputFactory | |
| public XmlNameProcessor | |
| public XMLOutputFactory | |
| public String | |
| public MatchStrength | |
| public static MatchStrength | hasXMLFormat(InputAccessor acc)
Method that tries to figure out if content seems to be in some kind of XML format. |
| public final boolean | |
| public final boolean | |
| private void | readObject(ObjectInputStream in)
In addition to default serialization, which mostly works, need to handle case of XML factories, hence override. |
| protected Object | readResolve()
Overrides com. Method that we need to override to actually make restoration go through constructors etc. |
| public XmlFactoryBuilder | rebuild()
Overrides com. Method that allows construction of differently configured factory, starting with settings of this factory. |
| public boolean | Returns: True since XML format does require support from codecOverrides com. XML format does require support from custom |
| public void | setXMLInputFactory(XMLInputFactory f)
Deprecated
Since 2.12 -- should be set as part of build process
(either in builder, or constructor)
|
| public void | |
| public void | setXMLOutputFactory(XMLOutputFactory f)
Deprecated
Since 2.12 -- should be set as part of build process
(either in builder, or constructor)
|
| public void | |
| private static final int | |
| private static final MatchStrength | |
| private static final boolean | |
| public Version | version()
Overrides com. Implements com. Method called to detect version of the component that implements this interface;
returned version should never be null, but may return specific "not available"
instance (see |
| private void | writeObject(ObjectOutputStream out)
In addition to default serialization, which mostly works, need to handle case of XML factories, hence override. |