Class Attribute


  • @SupportedAll
    public class Attribute
    extends AttributeDesignator
    The Attribute element specifies an attribute of the assertion subject. The Attribute element is an extension of the AttributeDesignator element that allows the attribute value to be specified.
    • Field Detail

      • _attributeValue

        protected List<Element> _attributeValue
    • Constructor Detail

      • Attribute

        public Attribute​(Element element)
                  throws SAMLException
        Constructs an attribute element from an existing XML block.
        Parameters:
        element - representing a DOM tree element.
        Throws:
        SAMLException - if there is an error in the sender or in the element definition.
      • Attribute

        public Attribute​(String name,
                         String nameSpace,
                         List<Element> values)
                  throws SAMLException
        Constructs an instance of Attribute.
        Parameters:
        name - A String representing AttributeName (the name of the attribute).
        nameSpace - A String representing the namespace in which AttributeName elements are interpreted.
        values - A List of DOM element representing the AttributeValue object.
        Throws:
        SAMLException - if there is an error in the sender or in the element definition.
      • Attribute

        public Attribute​(String name,
                         String nameSpace,
                         String attributeValue)
                  throws SAMLException
        Constructs an instance of Attribute.
        Parameters:
        name - The name of the attribute.
        nameSpace - The namespace in which AttributeName elements are interpreted.
        attributeValue - an AttributeValue object.
        Throws:
        SAMLException - if there is an error in the sender or in the element definition.
    • Method Detail

      • getAttributeValue

        public List<Element> getAttributeValue()
                                        throws SAMLException
        Returns AttributeValue from the Attribute.
        Returns:
        A list of DOM Element representing the AttributeValue block.
        Throws:
        SAMLException - If there was an error.
      • addAttributeValue

        public void addAttributeValue​(String value)
                               throws SAMLException
        Adds AttributeValue to the Attribute.
        Parameters:
        value - A String representing AttributeValue.
        Throws:
        SAMLException - If there was an error.
      • addAttributeValue

        public void addAttributeValue​(Element element)
                               throws SAMLException
        Adds AttributeValue to the Attribute.
        Parameters:
        element - An Element object representing AttributeValue.
        Throws:
        SAMLException - If there was an error.
      • toString

        public String toString()
        Returns a String representation of the <saml:Attribute> element,
        Overrides:
        toString in class AttributeDesignator
        Returns:
        A string containing the valid XML for this element.
      • toString

        public String toString​(boolean includeNS,
                               boolean declareNS)
        Returns a String representation of the <saml:Attribute> element.
        Overrides:
        toString in class AttributeDesignator
        Parameters:
        includeNS - Determines whether or not the namespace qualifier is prepended to the Element when converted
        declareNS - Determines whether or not the namespace is declared within the Element.
        Returns:
        A string containing the valid XML for this element