public class AttributeImpl extends Object implements Attribute
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 and Description |
---|
AttributeImpl()
Default constructor
|
AttributeImpl(Element element)
This constructor is used to build
Request object from a
block of existing XML that has already been built into a DOM. |
AttributeImpl(String xml)
This constructor is used to build
Attribute object from a
XML string. |
Modifier and Type | Method and Description |
---|---|
URI |
getAttributeId()
Returns the AttributeId of the
Attribute
which the attribute identifier. |
List |
getAttributeValues()
Returns one to many values in the
AttributeValue elements
of this object |
URI |
getDataType()
Returns the datatype of the contents of the
AttributeValue
elements. |
String |
getIssuer()
Returns the issuer of the
Attribute . |
boolean |
isMutable()
Checks if the object is mutable
|
void |
makeImmutable()
Makes the object immutable
|
void |
setAttributeId(URI attributeId)
Sets the attributeId of the
Attribute . |
void |
setAttributeStringValues(List stringValues)
Sets the attribute values for this object
|
void |
setAttributeValues(List values)
Sets the
AttributeValue elements of this object |
void |
setDataType(URI dataType)
Sets the data type of the contents of the
AttributeValue
elements. |
void |
setIssuer(String issuer)
Sets the issuer of the
Attribute . |
String |
toXMLString()
Returns a string representation of this object
|
String |
toXMLString(boolean includeNSPrefix,
boolean declareNS)
Returns a
String representation of this object |
public AttributeImpl()
public AttributeImpl(String xml) throws XACMLException
Attribute
object from a
XML string.xml
- A java.lang.String
representing
an Attribute
objectXACMLException
- if it could not process the XML stringpublic AttributeImpl(Element element) throws XACMLException
Request
object from a
block of existing XML that has already been built into a DOM.element
- A org.w3c.dom.Element
representing
DOM tree for Request
objectXACMLException
- if it could not process the Elementpublic String getIssuer()
Attribute
.public void setIssuer(String issuer) throws XACMLException
Attribute
.setIssuer
in interface Attribute
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 empty
String
.XACMLException
- if the object is immutablepublic URI getAttributeId()
Attribute
which the attribute identifier.getAttributeId
in interface Attribute
URI
representing the data type.public void setAttributeId(URI attributeId) throws XACMLException
Attribute
.setAttributeId
in interface Attribute
attributeId
- URI
representing the attribite id.XACMLException
- if the object is immutablepublic URI getDataType()
AttributeValue
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.getDataType
in interface Attribute
URI
representing the data type.public void setDataType(URI dataType) throws XACMLException
AttributeValue
elements.setDataType
in interface Attribute
dataType
- URI
representing the data type.XACMLException
- if the object is immutablepublic List getAttributeValues()
AttributeValue
elements
of this objectgetAttributeValues
in interface Attribute
Element
s representing the
AttributeValue
of this objectpublic void setAttributeValues(List values) throws XACMLException
AttributeValue
elements of this objectsetAttributeValues
in interface Attribute
values
- a List
containing Element representing
AttributeValue
of this object.XACMLException
- if the object is immutable
An object is considered immutable
if
makeImmutable()
has been invoked on it. It can
be determined by calling isMutable
on the object.public void setAttributeStringValues(List stringValues) throws XACMLException
setAttributeStringValues
in interface Attribute
stringValues
- a List
containing String
values of this object.XACMLException
- if the object is immutable
An object is considered immutable
if
makeImmutable()
has been invoked on it. It can
be determined by calling isMutable
on the object.public String toXMLString(boolean includeNSPrefix, boolean declareNS) throws XACMLException
String
representation of this objecttoXMLString
in interface Attribute
includeNSPrefix
- Determines whether or not the namespace qualifier
is prepended to the Element when converteddeclareNS
- Determines whether or not the namespace is declared
within the Element.XACMLException
- if conversion fails for any reasonpublic String toXMLString() throws XACMLException
toXMLString
in interface Attribute
XACMLException
- if conversion fails for any reasonpublic void makeImmutable()
makeImmutable
in interface Attribute
Copyright © 2010-2018, ForgeRock All Rights Reserved.