public final class AnyUriValue extends StringParseableValue<String>
WARNING: java.net.URI cannot be used here for this XACML datatype, because not equivalent to XML schema anyURI type. Spaces are allowed in XSD anyURI [1], not in java.net.URI.
[1] http://www.w3.org/TR/xmlschema-2/#anyURI That's why we use String instead.
See also:
https://java.net/projects/jaxb/lists/users/archive/2011-07/message/16
From the JAXB spec: "xs:anyURI is not bound to java.net.URI by default since not all possible values of xs:anyURI can be passed to the java.net.URI constructor. Using a global JAXB customization described in Section 7.9".
Last but not least, we now refer to the definition of anyURI datatype given in XSD 1.1, which has the same value space as the string datatype. More info in the XSD 1.1 datatypes document and SAXON documentation: http://www.saxonica.com/html/documentation9.4/changes/intro93/xsd11-93.html. Also confirmed on the mailing list: https://sourceforge.net/p/saxon/mailman/saxon-help/thread/[email protected]/. Although XACML 3.0 still refers to XSD 1.0 and its stricter definition of anyURI, we prefer to anticipate and use the definition from XSD 1.1 for XACML AttributeValues of datatype anyURI. However, this does not affect XACML schema validation of Policy/PolicySet/Request documents, where the XSD 1.0 definition of anyURI still applies.
With the new anyURI definition of XSD 1.1, we also avoid using StandardURIChecker
which maintains a thread-local cache of validated URIs (cache size is 50 and eviction policy is LRU) that
may be spotted as a possible memory leak by servlet containers such as Tomcat, as confirmed on the mailing list: https://sourceforge.net/p/saxon/mailman/message/27043134/ ,
https://sourceforge.net/p/saxon/mailman/saxon-help/thread/[email protected]/ .
StringParseableValue.Factory<AV extends AttributeValue>
SimpleValue.BaseFactory<AV extends AttributeValue>
value
Constructor and Description |
---|
AnyUriValue(String value)
Creates a new
AnyURIAttributeValue that represents the URI value supplied. |
Modifier and Type | Method and Description |
---|---|
String |
printXML()
Converts the internal value (accessible via
SimpleValue.getUnderlyingValue() to a valid lexical representation for XML marshalling. |
getXmlAttributes
equals, getContent, getUnderlyingValue, hashCode, toString
public AnyUriValue(String value) throws IllegalArgumentException
AnyURIAttributeValue
that represents the URI value supplied.value
- the URI to be represented
WARNING: java.net.URI cannot be used here for XACML datatype, because not equivalent to XML schema anyURI type. Spaces are allowed in XSD anyURI [1], not in java.net.URI. [1] http://www.w3.org/TR/xmlschema-2/#anyURI So we use String instead.
IllegalArgumentException
- if value
is not a valid string representation for xs:anyURIpublic String printXML()
SimpleValue.getUnderlyingValue()
to a valid lexical representation for XML marshalling. Equivalent to the 'printMethod' in JAXB 'javaType' binding
customizations. Implementations of this typically call DatatypeConverter
. This method is called by SimpleValue.getContent()
and its result cached by the same method for later use.
Therefore, no need to cache the result in the implementation.printXML
in class SimpleValue<String>
Copyright © 2012–2020. All rights reserved.