Class AttributeImpl

java.lang.Object
com.sun.identity.xacml.context.impl.AttributeImpl
All Implemented Interfaces:
XmlSerializable, Attribute

@SupportedAll public class AttributeImpl extends Object implements 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 Details

    • AttributeImpl

      public AttributeImpl()
      Default constructor
    • AttributeImpl

      public AttributeImpl(String xml) throws XACMLException
      This constructor is used to build Attribute object from a XML string.
      Parameters:
      xml - A java.lang.String representing an Attribute object
      Throws:
      XACMLException - if it could not process the XML string
    • AttributeImpl

      public AttributeImpl(Element element) throws XACMLException
      This constructor is used to build Request object from a block of existing XML that has already been built into a DOM.
      Parameters:
      element - A org.w3c.dom.Element representing DOM tree for Request object
      Throws:
      XACMLException - if it could not process the Element
  • Method Details

    • getIssuer

      public String getIssuer()
      Returns the issuer of the Attribute.
      Specified by:
      getIssuer in interface Attribute
      Returns:
      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.
    • setIssuer

      public void setIssuer(String issuer) throws XACMLException
      Sets the issuer of the Attribute.
      Specified by:
      setIssuer in interface Attribute
      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 empty String.
      Throws:
      XACMLException - if the object is immutable
    • getAttributeId

      public URI getAttributeId()
      Returns the AttributeId of the Attribute which the attribute identifier.
      Specified by:
      getAttributeId in interface Attribute
      Returns:
      the URI representing the data type.
    • setAttributeId

      public void setAttributeId(URI attributeId) throws XACMLException
      Sets the attributeId of the Attribute.
      Specified by:
      setAttributeId in interface Attribute
      Parameters:
      attributeId - URI representing the attribite id.
      Throws:
      XACMLException - if the object is immutable
    • getDataType

      public URI getDataType()
      Returns the datatype of the contents of the 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.
      Specified by:
      getDataType in interface Attribute
      Returns:
      the URI representing the data type.
    • setDataType

      public void setDataType(URI dataType) throws XACMLException
      Sets the data type of the contents of the AttributeValue elements.
      Specified by:
      setDataType in interface Attribute
      Parameters:
      dataType - URI representing the data type.
      Throws:
      XACMLException - if the object is immutable
    • getAttributeValues

      public List getAttributeValues()
      Returns one to many values in the AttributeValue elements of this object
      Specified by:
      getAttributeValues in interface Attribute
      Returns:
      the List containing Elements representing the AttributeValue of this object
    • setAttributeValues

      public void setAttributeValues(List values) throws XACMLException
      Sets the AttributeValue elements of this object
      Specified by:
      setAttributeValues in interface Attribute
      Parameters:
      values - a List containing Element representing AttributeValue of this object.
      Throws:
      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.
    • setAttributeStringValues

      public void setAttributeStringValues(List stringValues) throws XACMLException
      Sets the attribute values for this object
      Specified by:
      setAttributeStringValues in interface Attribute
      Parameters:
      stringValues - a List containing String values of this object.
      Throws:
      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.
    • 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 XML DocumentFragment. A default implementation is provided for compatibility with legacy code that implements XmlSerializable.toXMLString(), but it is highly recommended to override this method.
      Specified by:
      toDocumentFragment in interface XmlSerializable
      Parameters:
      document - the parent Document 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 interface Attribute
    • isMutable

      public boolean isMutable()
      Checks if the object is mutable
      Specified by:
      isMutable in interface Attribute
      Returns:
      true if the object is mutable, false otherwise