public class AttributeImpl extends Object implements Attribute
Attribute
.
The Attribute
element identifies an attribute by name and
optionally includes its value(s). It has the AttributeType
complex type.
<complexType name="AttributeType"> <complexContent> <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> <sequence> <element ref="{urn:oasis:names:tc:SAML:2.0:assertion} AttributeValue" maxOccurs="unbounded" minOccurs="0"/> </sequence> <attribute name="FriendlyName" type="{http://www.w3.org/2001/XMLSchema}string" /> <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> <attribute name="NameFormat" type="{http://www.w3.org/2001/XMLSchema}anyURI" /> </restriction> </complexContent> </complexType>
Constructor and Description |
---|
AttributeImpl()
Class constructor.
|
AttributeImpl(Element element)
Class constructor with
Attribute in
Element format. |
AttributeImpl(String xmlString)
Class constructor with
Attribute in xml string
format. |
Modifier and Type | Method and Description |
---|---|
EncryptedAttribute |
encrypt(Key recipientPublicKey,
String dataEncAlgorithm,
int dataEncStrength,
String recipientEntityID)
Returns an
EncryptedAttribute object. |
Map |
getAnyAttribute()
Returns the
anyAttribute of the attribute. |
List |
getAttributeValue()
Returns the
AttributeValue (s) of the Attribute . |
List |
getAttributeValueString()
Returns the
AttributeValue (s) of the Attribute . |
String |
getFriendlyName()
Returns the
FriendlyName of the attribute. |
String |
getName()
Returns the
Name of the attribute. |
String |
getNameFormat()
Returns the
NameFormat of the attribute. |
boolean |
isMutable()
Returns the mutability of the object.
|
void |
makeImmutable()
Makes the object immutable.
|
void |
setAnyAttribute(Map value)
Sets the
anyAttribute of the attribute. |
void |
setAttributeValue(List value)
Sets the
AttributeValue (s) of the Attribute . |
void |
setAttributeValueString(List value)
Sets the value of
AttributeValue element(s). |
void |
setFriendlyName(String value)
Sets the
FriendlyName of the attribute. |
void |
setName(String value)
Sets the
Name of the attribute. |
void |
setNameFormat(String value)
Sets the
NameFormat of the attribute. |
String |
toXMLString()
Returns a String representation of the element.
|
String |
toXMLString(boolean includeNS,
boolean declareNS)
Returns a String representation of the element.
|
public AttributeImpl()
public AttributeImpl(Element element) throws SAML2Exception
Attribute
in
Element
format.SAML2Exception
public AttributeImpl(String xmlString) throws SAML2Exception
Attribute
in xml string
format.SAML2Exception
public void makeImmutable()
makeImmutable
in interface Attribute
public boolean isMutable()
public List getAttributeValue()
AttributeValue
(s) of the Attribute
.getAttributeValue
in interface Attribute
AttributeValue
(s)
of the Attribute
.setAttributeValue(List)
public void setAttributeValue(List value) throws SAML2Exception
AttributeValue
(s) of the Attribute
.setAttributeValue
in interface Attribute
value
- List of xml String representing the new
AttributeValue
element(s).SAML2Exception
- if the object is immutable or the input can not
be converted to AttributeValue
element.getAttributeValue()
public List getAttributeValueString()
AttributeValue
(s) of the Attribute
.getAttributeValueString
in interface Attribute
AttributeValue
(s).setAttributeValueString(List)
public void setAttributeValueString(List value) throws SAML2Exception
AttributeValue
element(s).setAttributeValueString
in interface Attribute
value
- List of String representing the value of the new
AttributeValue
element(s).SAML2Exception
- if the object is immutable.getAttributeValueString()
public String getName()
Name
of the attribute.getName
in interface Attribute
Name
of the attribute.setName(String)
public void setName(String value) throws SAML2Exception
Name
of the attribute.setName
in interface Attribute
value
- new Name
of the attribute.SAML2Exception
- if the object is immutable.getName()
public String getNameFormat()
NameFormat
of the attribute.getNameFormat
in interface Attribute
NameFormat
.setNameFormat(String)
public void setNameFormat(String value) throws SAML2Exception
NameFormat
of the attribute.setNameFormat
in interface Attribute
value
- new NameFormat
of the attribute.SAML2Exception
- if the object is immutable.getNameFormat()
public String getFriendlyName()
FriendlyName
of the attribute.getFriendlyName
in interface Attribute
FriendlyName
of the attribute.setFriendlyName(String)
public void setFriendlyName(String value) throws SAML2Exception
FriendlyName
of the attribute.setFriendlyName
in interface Attribute
value
- new FriendlyName
of the attribute.SAML2Exception
- if the object is immutable.getFriendlyName()
public Map getAnyAttribute()
anyAttribute
of the attribute.getAnyAttribute
in interface Attribute
anyAttribute
.
Both the name and value are String object types.setAnyAttribute(Map)
public void setAnyAttribute(Map value) throws SAML2Exception
anyAttribute
of the attribute.setAnyAttribute
in interface Attribute
value
- Map of name/value pairs to be set. Both the name and value
are String object types.SAML2Exception
- if the object is immutable.getAnyAttribute()
public EncryptedAttribute encrypt(Key recipientPublicKey, String dataEncAlgorithm, int dataEncStrength, String recipientEntityID) throws SAML2Exception
EncryptedAttribute
object.encrypt
in interface Attribute
recipientPublicKey
- Public key used to encrypt the data encryption
(secret) key, it is the public key of the
recipient of the XML document to be encrypted.dataEncAlgorithm
- Data encryption algorithm.dataEncStrength
- Data encryption strength.recipientEntityID
- Unique identifier of the recipient, it is used
as the index to the cached secret key so that
the key can be reused for the same recipient;
It can be null in which case the secret key will
be generated every time and will not be cached
and reused. Note that the generation of a secret
key is a relatively expensive operation.EncryptedAttribute
objectSAML2Exception
- if error occurs during the encryption process.public String toXMLString() throws SAML2Exception
toXMLString
in interface Attribute
SAML2Exception
- if the object does not conform to the schema.public String toXMLString(boolean includeNS, boolean declareNS) throws SAML2Exception
toXMLString
in interface Attribute
includeNS
- 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.SAML2Exception
- if the object does not conform to the schema.Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.