public class XmlPathConfig extends Object
| Constructor and Description |
|---|
XmlPathConfig()
Creates a new XmlPathConfig that is configured to use the default JAXBObjectMapperFactory.
|
XmlPathConfig(String defaultCharset)
Create a new XmlPathConfig that uses the
defaultCharset when deserializing XML data. |
XmlPathConfig(XmlPathConfig config)
Create a new instance of a XmlPathConfig based on the properties in the supplied config.
|
| Modifier and Type | Method and Description |
|---|---|
XmlPathConfig |
and()
For syntactic sugar.
|
String |
charset() |
XmlPathConfig |
charset(String charset) |
XmlPathConfig |
declaredNamespace(String prefix,
String namespaceURI)
Declares a namespace.
|
Map<String,String> |
declaredNamespaces() |
XmlPathConfig |
declareNamespaces(Map<String,String> namespacesToDeclare)
Specify declared namespaces that will be used when parsing XML.
|
XmlPathObjectDeserializer |
defaultDeserializer() |
XmlPathConfig |
defaultObjectDeserializer(XmlPathObjectDeserializer defaultObjectDeserializer)
Creates an json path configuration that uses the specified object de-serializer as default.
|
XmlParserType |
defaultParserType() |
XmlPathConfig |
defaultParserType(XmlParserType defaultParserType)
Creates an xml path configuration that uses the specified parser type as default.
|
XmlPathConfig |
disableLoadingOfExternalDtd()
Disables external DTD loading.
|
XmlPathConfig |
feature(String uri,
boolean enabled)
Set a value of a feature flag.
|
Map<String,Boolean> |
features() |
XmlPathConfig |
features(Map<String,Boolean> features)
Specify features that will be used when parsing XML.
|
boolean |
hasCustomJaxbObjectMapperFactory() |
boolean |
hasDeclaredNamespaces() |
boolean |
hasDefaultDeserializer() |
boolean |
hasDefaultParserType() |
JAXBObjectMapperFactory |
jaxbObjectMapperFactory() |
XmlPathConfig |
jaxbObjectMapperFactory(JAXBObjectMapperFactory jaxbObjectMapperFactory)
Specify a custom Gson object mapper factory.
|
Map<String,Object> |
properties() |
XmlPathConfig |
properties(Map<String,Object> properties)
Specify properties that will be used when parsing XML.
|
XmlPathConfig |
property(String name,
Object value)
Set a value of a property.
|
XmlPathConfig |
with()
For syntactic sugar.
|
static XmlPathConfig |
xmlPathConfig() |
public XmlPathConfig(XmlPathConfig config)
config - The config to copy.public XmlPathConfig()
public XmlPathConfig(String defaultCharset)
defaultCharset when deserializing XML data.public Map<String,Boolean> features()
XmlSlurper.XMLReader.setFeature(java.lang.String, boolean)public XmlPathConfig features(Map<String,Boolean> features)
features - A map containing features that will be used by the underlying XmlSlurper.XMLReader.setFeature(java.lang.String, boolean)public XmlPathConfig feature(String uri, boolean enabled)
uri - The feature name, which is a fully-qualified URI.enabled - The requested value of the feature (true or false).XMLReader.setFeature(java.lang.String, boolean)public Map<String,Object> properties()
XmlSlurper.XMLReader.setProperty(String, Object)public XmlPathConfig properties(Map<String,Object> properties)
properties - A map containing properties that will be used by the underlying XmlSlurper.XMLReader.setFeature(java.lang.String, boolean)public XmlPathConfig property(String name, Object value)
name - The property namevalue - The value of the propertyXMLReader.setFeature(java.lang.String, boolean)public XmlPathConfig disableLoadingOfExternalDtd()
This is a shortcut for doing:
setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
feature(String, boolean)public String charset()
public XmlPathConfig charset(String charset)
public XmlParserType defaultParserType()
public boolean hasDefaultParserType()
public boolean hasCustomJaxbObjectMapperFactory()
public XmlPathObjectDeserializer defaultDeserializer()
public boolean hasDefaultDeserializer()
public XmlPathConfig defaultParserType(XmlParserType defaultParserType)
defaultParserType - The default parser type to use. If null then classpath scanning will be used.public XmlPathConfig defaultObjectDeserializer(XmlPathObjectDeserializer defaultObjectDeserializer)
defaultObjectDeserializer - The object de-serializer to use. If null then classpath scanning will be used.public JAXBObjectMapperFactory jaxbObjectMapperFactory()
public Map<String,String> declaredNamespaces()
XmlSlurper.XMLReader.setFeature(java.lang.String, boolean)public XmlPathConfig declareNamespaces(Map<String,String> namespacesToDeclare)
namespacesToDeclare - A map containing features that will be used by the underlying XmlSlurper.XMLReader.setFeature(java.lang.String, boolean)public XmlPathConfig declaredNamespace(String prefix, String namespaceURI)
prefix - The feature name, which is a fully-qualified URI.namespaceURI - The requested value of the feature (true or false).XMLReader.setFeature(java.lang.String, boolean)public XmlPathConfig jaxbObjectMapperFactory(JAXBObjectMapperFactory jaxbObjectMapperFactory)
jaxbObjectMapperFactory - The object mapper factorypublic boolean hasDeclaredNamespaces()
public XmlPathConfig with()
public XmlPathConfig and()
public static XmlPathConfig xmlPathConfig()
Copyright © 2010–2014. All rights reserved.