The getAttribute method
- Organization of this page
Description
Obtains an attribute bound to the subject. The requestor casts the returned object to reference the value. If the same attribute has two or more values, this method returns the first object found.
Syntax
public Object getAttribute(String alias) throws IllegalStateException;
Parameter
- alias:
-
Specifies the attribute name bound to the subject. If the alias of the attribute is specified in the AttributeEntry class, specify that alias.
Exception
- java.lang.IllegalStateException:
-
If the object is invalid, java.lang.IllegalStateException occurs. Note that this exception inherits from java.lang.RuntimeException and can therefore be compiled without being defined in catch or throws.
This exception occurs when both of the following conditions coexist:
-
The subject that has this object is read-only.
-
The logout process is performed using the logout method.
-
Return value
This method returns the attribute value bound to the subject if that value is found. If the value is not found, it returns null.