Class AttributeImpl
java.lang.Object
com.sun.identity.xacml.context.impl.AttributeImpl
- All Implemented Interfaces:
XmlSerializable
,Attribute
The
Attribute
element specifies information about the
action/subject/resource requested in the Request
context by
listing a sequence of Attribute
elements associated with
the action.
<xs:element name="Attribute" type="xacml-context:AttributeType"/> <xs:complexType name="AttributeType"> <xs:sequence <xs:element ref="xacml-context:AttributeValue" maxOccurs="unbounded"/> <xs:sequence> <xs:attribute name="AttributeId" type="xs:anyURI" use="required"/> <xs:attribute name="DataType" type="xs:anyURI" use="required"/> <xs:attribute name="Issuer" type="xs:string" use="optional"/> <xs:complexType>
-
Constructor Summary
ConstructorDescriptionDefault constructorAttributeImpl
(String xml) This constructor is used to buildAttribute
object from a XML string.AttributeImpl
(Element element) This constructor is used to buildRequest
object from a block of existing XML that has already been built into a DOM. -
Method Summary
Modifier and TypeMethodDescriptionReturns the AttributeId of theAttribute
which the attribute identifier.Returns one to many values in theAttributeValue
elements of this objectReturns the datatype of the contents of theAttributeValue
elements.Returns the issuer of theAttribute
.boolean
Checks if the object is mutablevoid
Makes the object immutablevoid
setAttributeId
(URI attributeId) Sets the attributeId of theAttribute
.void
setAttributeStringValues
(List stringValues) Sets the attribute values for this objectvoid
setAttributeValues
(List values) Sets theAttributeValue
elements of this objectvoid
setDataType
(URI dataType) Sets the data type of the contents of theAttributeValue
elements.void
Sets the issuer of theAttribute
.toDocumentFragment
(Document document, boolean includeNSPrefix, boolean declareNS) Serializes the element into an XMLDocumentFragment
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.sun.identity.xacml.context.Attribute
toXMLString, toXMLString
-
Constructor Details
-
AttributeImpl
public AttributeImpl()Default constructor -
AttributeImpl
This constructor is used to buildAttribute
object from a XML string.- Parameters:
xml
- Ajava.lang.String
representing anAttribute
object- Throws:
XACMLException
- if it could not process the XML string
-
AttributeImpl
This constructor is used to buildRequest
object from a block of existing XML that has already been built into a DOM.- Parameters:
element
- Aorg.w3c.dom.Element
representing DOM tree forRequest
object- Throws:
XACMLException
- if it could not process the Element
-
-
Method Details
-
getIssuer
Returns the issuer of theAttribute
. -
setIssuer
Sets the issuer of theAttribute
.- Specified by:
setIssuer
in interfaceAttribute
- Parameters:
issuer
-String
representing the issuer. It MAY be an x500Name that binds to a public key or some other identification exchanged out-of-band by participating entities. This is optional so return value could be null or an emptyString
.- Throws:
XACMLException
- if the object is immutable
-
getAttributeId
Returns the AttributeId of theAttribute
which the attribute identifier.- Specified by:
getAttributeId
in interfaceAttribute
- Returns:
- the
URI
representing the data type.
-
setAttributeId
Sets the attributeId of theAttribute
.- Specified by:
setAttributeId
in interfaceAttribute
- Parameters:
attributeId
-URI
representing the attribite id.- Throws:
XACMLException
- if the object is immutable
-
getDataType
Returns the datatype of the contents of theAttributeValue
elements. This will be either a primitive datatype defined by XACML 2.0 specification or a type ( primitive or structured) defined in a namespace declared in the <xacml-context> element.- Specified by:
getDataType
in interfaceAttribute
- Returns:
- the
URI
representing the data type.
-
setDataType
Sets the data type of the contents of theAttributeValue
elements.- Specified by:
setDataType
in interfaceAttribute
- Parameters:
dataType
-URI
representing the data type.- Throws:
XACMLException
- if the object is immutable
-
getAttributeValues
Returns one to many values in theAttributeValue
elements of this object- Specified by:
getAttributeValues
in interfaceAttribute
- Returns:
- the List containing
Element
s representing theAttributeValue
of this object
-
setAttributeValues
Sets theAttributeValue
elements of this object- Specified by:
setAttributeValues
in interfaceAttribute
- Parameters:
values
- aList
containing Element representingAttributeValue
of this object.- Throws:
XACMLException
- if the object is immutable An object is consideredimmutable
ifmakeImmutable()
has been invoked on it. It can be determined by callingisMutable
on the object.
-
setAttributeStringValues
Sets the attribute values for this object- Specified by:
setAttributeStringValues
in interfaceAttribute
- Parameters:
stringValues
- aList
containingString
values of this object.- Throws:
XACMLException
- if the object is immutable An object is consideredimmutable
ifmakeImmutable()
has been invoked on it. It can be determined by callingisMutable
on the object.
-
toDocumentFragment
public DocumentFragment toDocumentFragment(Document document, boolean includeNSPrefix, boolean declareNS) throws com.sun.identity.saml2.common.SAML2Exception Description copied from interface:XmlSerializable
Serializes the element into an XMLDocumentFragment
. A default implementation is provided for compatibility with legacy code that implementsXmlSerializable.toXMLString()
, but it is highly recommended to override this method.- Specified by:
toDocumentFragment
in interfaceXmlSerializable
- Parameters:
document
- the parentDocument
to create the document fragment from.includeNSPrefix
- whether to include a namespace prefix in the document elements.declareNS
- whether to declare any namespaces or assume that they are already declared.- Returns:
- the XML document fragment representing this SAML2 element.
- Throws:
com.sun.identity.saml2.common.SAML2Exception
- if the element cannot be serialized for any reason.
-
makeImmutable
public void makeImmutable()Makes the object immutable- Specified by:
makeImmutable
in interfaceAttribute
-
isMutable
public boolean isMutable()Checks if the object is mutable
-