-
Notifications
You must be signed in to change notification settings - Fork 24
Default Java XACML type mappings
Cyril Dangerville edited this page Jan 29, 2018
·
1 revision
AuthzForce API allows to create AttributeValues (and AttributeBags) from standard Java types using default Java-to-XACML type mappings detailed below:
java.util.Date
, java.util.Calendar
and subclasses such as java.util.GregorianCalendar
are not supported here because considered unsafe legacy code since Java 8. More info: https://docs.oracle.com/javase/tutorial/datetime/iso/legacy.html
private static final AttributeValueFactoryRegistry ATT_VALUE_FACTORIES = StandardAttributeValueFactories.getRegistry(false, Optional.empty());
...
// Single value
final AttributeValue attVal = ATT_VALUE_FACTORIES.newAttributeValue(myRawValue);
// Collection
final AttributeBag<?> attBag = ATT_VALUE_FACTORIES.newAttributeBag(myRawValues);
...