public static class NativeHandlers.Parsers
extends java.lang.Object
The default collection of response content parsers.
Modifier and Type | Field and Description |
---|---|
static org.apache.xml.resolver.tools.CatalogResolver |
catalogResolver
This CatalogResolver is static to avoid the overhead of re-parsing the catalog definition file every time.
|
static java.nio.charset.Charset |
DEFAULT_CHARSET |
Constructor and Description |
---|
Parsers() |
Modifier and Type | Method and Description |
---|---|
static java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
form(ChainedHttpConfig config,
FromServer fromServer)
Standard parser for responses with content type 'application/x-www-form-urlencoded'.
|
static java.lang.Object |
json(ChainedHttpConfig config,
FromServer fromServer)
Standard parser for json responses.
|
static byte[] |
streamToBytes(ChainedHttpConfig config,
FromServer fromServer)
Standard parser for raw bytes.
|
static java.lang.String |
textToString(ChainedHttpConfig config,
FromServer fromServer)
Standard parser for text response content.
|
static void |
transfer(java.io.InputStream istream,
java.io.OutputStream ostream,
boolean close)
Deprecated.
Use the version in
IoUtils instead - this one just delegates to it |
static GPathResult |
xml(ChainedHttpConfig config,
FromServer fromServer)
Standard parser for xml responses.
|
public static final java.nio.charset.Charset DEFAULT_CHARSET
public static org.apache.xml.resolver.tools.CatalogResolver catalogResolver
This CatalogResolver is static to avoid the overhead of re-parsing the catalog definition file every time. Unfortunately, there’s no
way to share a single Catalog instance between resolvers. The Catalog
class is technically not thread-safe, but as long as you
do not parse catalog files while using the resolver, it should be fine.
public static byte[] streamToBytes(ChainedHttpConfig config, FromServer fromServer)
Standard parser for raw bytes.
fromServer
- Backend indenpendent representation of data returned from http serverpublic static java.lang.String textToString(ChainedHttpConfig config, FromServer fromServer)
Standard parser for text response content.
config
- the http client configurationfromServer
- Backend independent representation of data returned from http serverpublic static java.util.Map<java.lang.String,java.util.List<java.lang.String>> form(ChainedHttpConfig config, FromServer fromServer)
Standard parser for responses with content type 'application/x-www-form-urlencoded'.
fromServer
- Backend indenpendent representation of data returned from http serverpublic static GPathResult xml(ChainedHttpConfig config, FromServer fromServer)
Standard parser for xml responses.
fromServer
- Backend indenpendent representation of data returned from http serverpublic static java.lang.Object json(ChainedHttpConfig config, FromServer fromServer)
Standard parser for json responses.
fromServer
- Backend indenpendent representation of data returned from http server@Deprecated public static void transfer(java.io.InputStream istream, java.io.OutputStream ostream, boolean close)
IoUtils
instead - this one just delegates to itTransfers the contents of the InputStream
into the OutputStream
, optionally closing the stream.
istream
- the input streamostream
- the output streamclose
- whether or not to close the output stream