Package org.ow2.authzforce.core.pdp.api
Class XmlUtils
- java.lang.Object
-
- org.ow2.authzforce.core.pdp.api.XmlUtils
-
public final class XmlUtils extends Object
Utilities for XML-to-JAXB binding
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
XmlUtils.NoXmlnsFilteringParser
This is a bare implementation of namespace-filtering parser, i.e.static class
XmlUtils.SAXBasedXmlnsFilteringParser
SAX-based namespace-filtering XML-to-JAXB parser.static interface
XmlUtils.XmlnsFilteringParser
(Namespace-filtering) XML-to-JAXB parserstatic interface
XmlUtils.XmlnsFilteringParserFactory
(Namespace-filtering) XACML-to-JAXB parser factorystatic class
XmlUtils.XPathEvaluator
Wrapper around XPathExecutable that provides the original XPath expression from which the XPathExecutable was compiled, via toString() method.
-
Field Summary
Fields Modifier and Type Field Description static String
SAXON_CONFIGURATION_CLASSPATH_LOCATION
Saxon configuration file for Attributes/Content XML parsing (into XDM data model) and AttributeSelector's XPath evaluationstatic net.sf.saxon.s9api.Processor
SAXON_PROCESSOR
SAXON XML/XPath Processor configured by "saxon.xml"static DatatypeFactory
XML_TEMPORAL_DATATYPE_FACTORY
XML datatype factory for parsing XML-Schema-compliant date/time/duration values into Java types.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static net.sf.saxon.s9api.XPathCompiler
newXPathCompiler(String xpathVersionURI, Map<String,String> namespaceURIsByPrefix)
Create XPath compiler for given XPath version and namespace context.
-
-
-
Field Detail
-
XML_TEMPORAL_DATATYPE_FACTORY
public static final DatatypeFactory XML_TEMPORAL_DATATYPE_FACTORY
XML datatype factory for parsing XML-Schema-compliant date/time/duration values into Java types. DatatypeFactory's official javadoc does not say whether it is thread-safe. But bug report indicates it should be and has been so far: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6466177 Reusing the same instance matters for performance: https://www.java.net/node/666491 The alternative would be to use ThreadLocal to limit thread-safety issues in the future.
-
SAXON_CONFIGURATION_CLASSPATH_LOCATION
public static final String SAXON_CONFIGURATION_CLASSPATH_LOCATION
Saxon configuration file for Attributes/Content XML parsing (into XDM data model) and AttributeSelector's XPath evaluation- See Also:
- Constant Field Values
-
SAXON_PROCESSOR
public static final net.sf.saxon.s9api.Processor SAXON_PROCESSOR
SAXON XML/XPath Processor configured by "saxon.xml"
-
-
Method Detail
-
newXPathCompiler
public static net.sf.saxon.s9api.XPathCompiler newXPathCompiler(String xpathVersionURI, Map<String,String> namespaceURIsByPrefix) throws IllegalArgumentException
Create XPath compiler for given XPath version and namespace context. For single evaluation of a given XPath withXPathCompiler.evaluateSingle(String, XdmItem)
. For repeated evaluation of the same XPath, useXmlUtils.XPathEvaluator
instead. What we have in XACML Policy/PolicySetDefaults is the version URI so we need this map to map the URI to the XPath compiler- Parameters:
xpathVersionURI
- XPath version URI, e.g. "http://www.w3.org/TR/1999/REC-xpath-19991116"namespaceURIsByPrefix
- namespace prefix-URI mapping to be part of the static context for XPath expressions compiled using the created XPathCompiler- Returns:
- XPath compiler instance
- Throws:
IllegalArgumentException
- ifxpathVersionURI
is invalid or unsupported XPath version or one of the namespace prefixes/URIs innamespaceURIsByPrefix
is null
-
-