public class XmlConfig extends Object
| Constructor and Description |
|---|
XmlConfig()
Create a new instance of XmlConfig without any features and that is namespace unaware.
|
| Modifier and Type | Method and Description |
|---|---|
XmlConfig |
and()
For syntactic sugar.
|
Map<String,String> |
declaredNamespaces() |
XmlConfig |
declareNamespace(String prefix,
String namespaceURI)
Declares a namespace and also sets
namespaceAware(boolean) to true. |
XmlConfig |
declareNamespaces(Map<String,String> namespacesToDeclare)
Specify declared namespaces that will be used when parsing XML.
|
XmlConfig |
disableLoadingOfExternalDtd()
Disables external DTD loading.
|
XmlConfig |
feature(String uri,
boolean enabled)
Set a value of a feature flag.
|
Map<String,Boolean> |
features() |
XmlConfig |
features(Map<String,Boolean> features)
Specify features that will be used when parsing XML.
|
boolean |
isNamespaceAware() |
XmlConfig |
namespaceAware(boolean shouldBeAwareOfNamespaces)
Configure whether or not REST Assured should be aware of namespaces when parsing XML.
|
Map<String,Object> |
properties() |
XmlConfig |
properties(Map<String,Object> properties)
Specify properties that will be used when parsing XML.
|
XmlConfig |
property(String name,
Object value)
Set a value of a property.
|
XmlConfig |
with()
For syntactic sugar.
|
static XmlConfig |
xmlConfig() |
public XmlConfig()
public Map<String,Boolean> features()
XmlSlurper.XMLReader.setFeature(java.lang.String, boolean)public Map<String,Object> properties()
XmlSlurper.XMLReader.setProperty(String, Object)public XmlConfig 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 XmlConfig properties(Map<String,Object> properties)
properties - A map containing properties that will be used by the underlying XmlSlurper.XMLReader.setProperty(String, Object)public XmlConfig 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 XmlConfig property(String name, Object value)
name - The property name.value - The requested value of the feature (true or false).XMLReader.setFeature(java.lang.String, boolean)public Map<String,String> declaredNamespaces()
XmlSlurper.XMLReader.setFeature(java.lang.String, boolean)public XmlConfig declareNamespaces(Map<String,String> namespacesToDeclare)
namespaceAware(boolean) to true of namespaces are not empty.
Note that you cannot use this to add namespaces for the org.hamcrest.xml.HasXPath matcher.
This has to be done by providing a NamespaceContext to the matcher instance.
namespacesToDeclare - A map containing features that will be used by the underlying XmlSlurper.XMLReader.setFeature(java.lang.String, boolean)public XmlConfig declareNamespace(String prefix, String namespaceURI)
namespaceAware(boolean) to true.
Note that you cannot use this to add namespaces for the org.hamcrest.xml.HasXPath matcher.
This has to be done by providing a NamespaceContext to the matcher instance.
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 XmlConfig disableLoadingOfExternalDtd()
This is a shortcut for doing:
setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
feature(String, boolean)public XmlConfig namespaceAware(boolean shouldBeAwareOfNamespaces)
shouldBeAwareOfNamespaces - true if xml parsing should take namespaces into account.public boolean isNamespaceAware()
true if REST Assured should be namespace aware.public XmlConfig with()
public XmlConfig and()
public static XmlConfig xmlConfig()
Copyright © 2010–2014. All rights reserved.