|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.jackson.JsonFactory
com.fasterxml.jackson.xml.XmlFactory
public class XmlFactory
Factory used for constructing FromXmlParser
and ToXmlGenerator
instances.
Implements JsonFactory
since interface for constructing XML backed
parsers and generators is quite similar to dealing with JSON.
Field Summary | |
---|---|
protected int |
_xmlGeneratorFeatures
|
protected XMLInputFactory |
_xmlInputFactory
|
protected XMLOutputFactory |
_xmlOutputFactory
|
protected int |
_xmlParserFeatures
|
static String |
FORMAT_NAME_XML
Name used to identify JSON format (and returned by getFormatName() |
Fields inherited from class org.codehaus.jackson.JsonFactory |
---|
_characterEscapes, _generatorFeatures, _inputDecorator, _objectCodec, _outputDecorator, _parserFeatures, _recyclerRef, _rootByteSymbols, _rootCharSymbols, FORMAT_NAME_JSON |
Constructor Summary | |
---|---|
XmlFactory()
Default constructor used to create factory instances. |
|
XmlFactory(org.codehaus.jackson.ObjectCodec oc)
|
|
XmlFactory(org.codehaus.jackson.ObjectCodec oc,
XMLInputFactory xmlIn,
XMLOutputFactory xmlOut)
|
|
XmlFactory(XMLInputFactory xmlIn,
XMLOutputFactory xmlOut)
|
Method Summary | |
---|---|
protected FromXmlParser |
_createJsonParser(byte[] data,
int offset,
int len,
org.codehaus.jackson.io.IOContext ctxt)
Overridable factory method that actually instantiates desired parser. |
protected FromXmlParser |
_createJsonParser(InputStream in,
org.codehaus.jackson.io.IOContext ctxt)
Overridable factory method that actually instantiates desired parser. |
protected FromXmlParser |
_createJsonParser(Reader r,
org.codehaus.jackson.io.IOContext ctxt)
Overridable factory method that actually instantiates desired parser. |
protected XMLStreamWriter |
_createXmlWriter(OutputStream out)
|
protected XMLStreamWriter |
_createXmlWriter(Writer w)
|
protected XMLStreamReader |
_initializeXmlReader(XMLStreamReader sr)
|
protected XMLStreamWriter |
_initializeXmlWriter(XMLStreamWriter sw)
|
XmlFactory |
configure(FromXmlParser.Feature f,
boolean state)
Method for enabling or disabling specified XML parser feature. |
XmlFactory |
configure(ToXmlGenerator.Feature f,
boolean state)
Method for enabling or disabling specified XML generator feature. |
ToXmlGenerator |
createJsonGenerator(File f,
org.codehaus.jackson.JsonEncoding enc)
|
ToXmlGenerator |
createJsonGenerator(OutputStream out,
org.codehaus.jackson.JsonEncoding enc)
note: co-variant return type |
ToXmlGenerator |
createJsonGenerator(Writer out)
|
XmlFactory |
disable(FromXmlParser.Feature f)
Method for disabling specified XML parser feature. |
XmlFactory |
disable(ToXmlGenerator.Feature f)
Method for disabling specified XML generator feature. |
XmlFactory |
enable(FromXmlParser.Feature f)
Method for enabling specified XML parser feature. |
XmlFactory |
enable(ToXmlGenerator.Feature f)
Method for enabling specified XML generator feature. |
String |
getFormatName()
Method that returns short textual id identifying format this factory supports. |
org.codehaus.jackson.format.MatchStrength |
hasFormat(org.codehaus.jackson.format.InputAccessor acc)
|
static org.codehaus.jackson.format.MatchStrength |
hasXMLFormat(org.codehaus.jackson.format.InputAccessor acc)
Method that tries to figure out if content seems to be in some kind of XML format. |
boolean |
isEnabled(FromXmlParser.Feature f)
Checked whether specified XML parser feature is enabled. |
boolean |
isEnabled(ToXmlGenerator.Feature f)
Check whether specified XML generator feature is enabled. |
void |
setXMLInputFactory(XMLInputFactory f)
|
void |
setXMLOutputFactory(XMLOutputFactory f)
|
Methods inherited from class org.codehaus.jackson.JsonFactory |
---|
_createContext, _createJsonGenerator, _createUTF8JsonGenerator, _createWriter, _getBufferRecycler, _optimizedStreamFromURL, configure, configure, createJsonGenerator, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, disable, disable, disableGeneratorFeature, disableParserFeature, enable, enable, enableGeneratorFeature, enableParserFeature, getCharacterEscapes, getCodec, getInputDecorator, getOutputDecorator, hasJSONFormat, isEnabled, isEnabled, isGeneratorFeatureEnabled, isParserFeatureEnabled, setCharacterEscapes, setCodec, setGeneratorFeature, setInputDecorator, setOutputDecorator, setParserFeature, version |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String FORMAT_NAME_XML
getFormatName()
protected int _xmlParserFeatures
protected int _xmlGeneratorFeatures
protected XMLInputFactory _xmlInputFactory
protected XMLOutputFactory _xmlOutputFactory
Constructor Detail |
---|
public XmlFactory()
public XmlFactory(org.codehaus.jackson.ObjectCodec oc)
public XmlFactory(XMLInputFactory xmlIn, XMLOutputFactory xmlOut)
public XmlFactory(org.codehaus.jackson.ObjectCodec oc, XMLInputFactory xmlIn, XMLOutputFactory xmlOut)
Method Detail |
---|
public final XmlFactory configure(FromXmlParser.Feature f, boolean state)
public XmlFactory enable(FromXmlParser.Feature f)
public XmlFactory disable(FromXmlParser.Feature f)
public final boolean isEnabled(FromXmlParser.Feature f)
public final XmlFactory configure(ToXmlGenerator.Feature f, boolean state)
public XmlFactory enable(ToXmlGenerator.Feature f)
public XmlFactory disable(ToXmlGenerator.Feature f)
public final boolean isEnabled(ToXmlGenerator.Feature f)
public void setXMLInputFactory(XMLInputFactory f)
public void setXMLOutputFactory(XMLOutputFactory f)
public String getFormatName()
Note: sub-classes should override this method; default implementation will return null for all sub-classes
getFormatName
in class org.codehaus.jackson.JsonFactory
public org.codehaus.jackson.format.MatchStrength hasFormat(org.codehaus.jackson.format.InputAccessor acc) throws IOException
hasFormat
in class org.codehaus.jackson.JsonFactory
IOException
public ToXmlGenerator createJsonGenerator(OutputStream out, org.codehaus.jackson.JsonEncoding enc) throws IOException
note: co-variant return type
createJsonGenerator
in class org.codehaus.jackson.JsonFactory
IOException
public ToXmlGenerator createJsonGenerator(Writer out) throws IOException
createJsonGenerator
in class org.codehaus.jackson.JsonFactory
IOException
public ToXmlGenerator createJsonGenerator(File f, org.codehaus.jackson.JsonEncoding enc) throws IOException
createJsonGenerator
in class org.codehaus.jackson.JsonFactory
IOException
protected FromXmlParser _createJsonParser(InputStream in, org.codehaus.jackson.io.IOContext ctxt) throws IOException, org.codehaus.jackson.JsonParseException
_createJsonParser
in class org.codehaus.jackson.JsonFactory
IOException
org.codehaus.jackson.JsonParseException
protected FromXmlParser _createJsonParser(Reader r, org.codehaus.jackson.io.IOContext ctxt) throws IOException, org.codehaus.jackson.JsonParseException
_createJsonParser
in class org.codehaus.jackson.JsonFactory
IOException
org.codehaus.jackson.JsonParseException
protected FromXmlParser _createJsonParser(byte[] data, int offset, int len, org.codehaus.jackson.io.IOContext ctxt) throws IOException, org.codehaus.jackson.JsonParseException
_createJsonParser
in class org.codehaus.jackson.JsonFactory
IOException
org.codehaus.jackson.JsonParseException
protected XMLStreamWriter _createXmlWriter(OutputStream out) throws IOException
IOException
protected XMLStreamWriter _createXmlWriter(Writer w) throws IOException
IOException
protected final XMLStreamWriter _initializeXmlWriter(XMLStreamWriter sw) throws IOException, XMLStreamException
IOException
XMLStreamException
protected final XMLStreamReader _initializeXmlReader(XMLStreamReader sr) throws IOException, XMLStreamException
IOException
XMLStreamException
public static org.codehaus.jackson.format.MatchStrength hasXMLFormat(org.codehaus.jackson.format.InputAccessor acc) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |