Class AnyUriValue
- java.lang.Object
-
- org.ow2.authzforce.core.pdp.api.value.SimpleValue<V>
-
- org.ow2.authzforce.core.pdp.api.value.StringParseableValue<String>
-
- org.ow2.authzforce.core.pdp.api.value.AnyUriValue
-
- All Implemented Interfaces:
AttributeValue
,PrimitiveValue
,Value
public final class AnyUriValue extends StringParseableValue<String>
Represent the URI value that this class representsWARNING: 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]/ .- Version:
- $Id: $
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.ow2.authzforce.core.pdp.api.value.StringParseableValue
StringParseableValue.Factory<AV extends AttributeValue>
-
Nested classes/interfaces inherited from class org.ow2.authzforce.core.pdp.api.value.SimpleValue
SimpleValue.BaseFactory<AV extends AttributeValue>
-
-
Field Summary
-
Fields inherited from class org.ow2.authzforce.core.pdp.api.value.SimpleValue
value
-
-
Constructor Summary
Constructors Constructor Description AnyUriValue(String value)
Creates a newAnyURIAttributeValue
that represents the URI value supplied.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
printXML()
Converts the internal value (accessible viaSimpleValue.getUnderlyingValue()
to a valid lexical representation for XML marshalling.-
Methods inherited from class org.ow2.authzforce.core.pdp.api.value.StringParseableValue
getXmlAttributes
-
Methods inherited from class org.ow2.authzforce.core.pdp.api.value.SimpleValue
equals, getContent, getUnderlyingValue, hashCode, toString
-
-
-
-
Constructor Detail
-
AnyUriValue
public AnyUriValue(String value) throws IllegalArgumentException
Creates a newAnyURIAttributeValue
that represents the URI value supplied.- Parameters:
value
- the URI to be representedWARNING: 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.
- Throws:
IllegalArgumentException
- ifvalue
is not a valid string representation for xs:anyURI
-
-
Method Detail
-
printXML
public String printXML()
Converts the internal value (accessible viaSimpleValue.getUnderlyingValue()
to a valid lexical representation for XML marshalling. Equivalent to the 'printMethod' in JAXB 'javaType' binding customizations. Implementations of this typically callDatatypeConverter
. This method is called bySimpleValue.getContent()
and its result cached by the same method for later use. Therefore, no need to cache the result in the implementation.- Specified by:
printXML
in classSimpleValue<String>
- Returns:
- XML-valid lexical representation.
-
-