public abstract class AttributeValue extends java.lang.Object implements ASN1Type
An Attribute
consists of an attribute type (specified by an
object identifier) and one or more attribute values:
Attribute ::= SEQUENCE { type AttributeType, values SET OF AttributeValue -- at least one value is required -- } AttributeType ::= OBJECT IDENTIFIER AttributeValue ::= ANY DEFINED BY type
Any class implementing a particular attribute value has to extend this
class and therefore has to implement the abstract methods decode
, toASN1Object
and getAttributeType
. The attribute type to be returned by method getAttributeType
is the one identifying the particular Attribute and shall be used for registering
the corresponding class as implemenation for this Attribute value, e.g.:
public class MyAttributeValue extends AttributeValue { ... // the attribute type: public static final ObjectID attributeType = ...; ... } ... // register the implementation: Attribute.register(MyAttributeValue.attributeType, MyAttributeValue.class);When implementing a statement info by extending this class please be aware that methods
toASN1Object
and decode
only have to convert the attribute
value itself (and NOT the attribute type OID) into respectively from an ASN1Object.Attribute
Constructor and Description |
---|
AttributeValue() |
Modifier and Type | Method and Description |
---|---|
abstract ObjectID |
getAttributeType()
Returns the attribute type OID identifying the type to which this Attribute Value belongs.
|
java.lang.String |
getName()
Returns the Attribute type name.
|
boolean |
multipleAllowed()
Returns whether multiple AttributeValues of this type are allowed
in the SET OF AttributeValue of an
Attribute object. |
abstract java.lang.String |
toString()
Returns a String representation of the AttributeValue.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
decode, toASN1Object
public abstract ObjectID getAttributeType()
public abstract java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getName()
public boolean multipleAllowed()
Attribute
object. By default this method returns true
meaning that multiple attribute values are allowed. An application may
override this method for a particular attribute value implementing
class if it wants to restrict the number of allowed attribute values
to one only. In this case, when adding
an AttributeValue to an Attribute
object, any already existing AttributeValue with the same
type will be replaced (since only one of this type is allowed).true
if multiple attribute values are allowed (default),
false
if only one attribute value is allowed