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 |
allowDocTypeDeclaration(boolean allowDocTypeDeclaration)
Configure if XmlPath should provide support for DOCTYPE declarations (default is ).
|
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() |
boolean |
isAllowDocTypeDeclaration()
Whether XmlPath should provide support for DOCTYPE declarations
|
boolean |
isNamespaceAware()
Whether XmlPath should provide support for XML namespaces
|
boolean |
isValidating()
Whether XmlPath should validate documents as they are parsed.
|
JAXBObjectMapperFactory |
jaxbObjectMapperFactory() |
XmlPathConfig |
jaxbObjectMapperFactory(JAXBObjectMapperFactory jaxbObjectMapperFactory)
Specify a custom Gson object mapper factory.
|
XmlPathConfig |
namespaceAware(boolean namespaceAware)
Configure if XmlPath should provide support for XML namespaces (default is ).
|
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 |
validating(boolean isValidating)
Configure if XmlPath should validate documents as they are parsed (default is ).
|
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 XmlPathConfig validating(boolean isValidating)
XmlPath.CompatibilityMode
is equal to
XmlPath.CompatibilityMode#XML
.isValidating
- true
if the parser should validate documents as they are parsed; false
otherwise.public boolean isValidating()
public XmlPathConfig namespaceAware(boolean namespaceAware)
XmlPath.CompatibilityMode
is equal to
XmlPath.CompatibilityMode#XML
.namespaceAware
- true
if the parser should provide support for XML namespaces; false
otherwise.public boolean isNamespaceAware()
public XmlPathConfig allowDocTypeDeclaration(boolean allowDocTypeDeclaration)
XmlPath.CompatibilityMode
is equal to
XmlPath.CompatibilityMode#XML
.allowDocTypeDeclaration
- true
if the parser should provide support for DOCTYPE declarations; false
otherwise.public boolean isAllowDocTypeDeclaration()
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–2020. All rights reserved.