issrg.ac
Class AttributeValue

java.lang.Object
  extended by issrg.ac.AttributeValue
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
DistinctAttribute

public class AttributeValue
extends java.lang.Object
implements java.lang.Cloneable

This is a default AttributeValue object used in the Attribute construct. You can derive from this class and register your own AttributeValue decoders using Attribute.registerAttribute method, so they will be used automatically when an AC is decoded.

When you create a subclass, don't forget to override isDecoded method, or derive your class from the DistinctAttribute class (which simply overrides that method to return true). Alternatively, your code can go through the vector of attribute values and replace the default AttributeValue objects with descendants of this class that are aware of their semantics (and can represent the ASN1Object of the value in a programmer-friendly way).

See Also:
Attribute.registerAttribute(java.lang.String, java.lang.Class)

Field Summary
protected  ASN1Object data
          This is the data as an ASN1Object that represents the value of the attribute.
 
Constructor Summary
protected AttributeValue()
           
  AttributeValue(ASN1Object data)
          This constructor builds an AttributeValue from ASN1Object of the single value.
 
Method Summary
 java.lang.Object clone()
           
 void decode(ASN1Object ao)
          This method decodes the single value of an Attribute.
 ASN1Object getRawAttribute()
          Returns the raw ASN1Object of the attribute, if it has been taken from the BER-encoded AC.
 boolean isDecoded()
          This method tells whether the value has been truly decoded, or it is some kind of placeholder and the actual value must be decoded by other means.
 ASN1Object toASN1Object()
          This method returns the ASN1Object of this value.
 java.lang.String toString()
           
 java.lang.String toString(java.lang.String ident)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

data

protected ASN1Object data
This is the data as an ASN1Object that represents the value of the attribute.

Constructor Detail

AttributeValue

protected AttributeValue()

AttributeValue

public AttributeValue(ASN1Object data)
               throws CodingException
This constructor builds an AttributeValue from ASN1Object of the single value.

Parameters:
data - - the ASN1Object of this value
Throws:
CodingException
Method Detail

getRawAttribute

public ASN1Object getRawAttribute()
Returns the raw ASN1Object of the attribute, if it has been taken from the BER-encoded AC. You don't need to set it, so there is no method for that.

This value may not be meaningful in some subclasses of AttributeValue.


isDecoded

public boolean isDecoded()
This method tells whether the value has been truly decoded, or it is some kind of placeholder and the actual value must be decoded by other means.

This method should be overridden by the user-defined classes to return true, so when the content of the set of attribute values is examined, the code would know if the class is aware of its semantics.

Returns:
true, if the value has been decoded and semantically evaluated by the subclass; false otherwise; by default returns false, so override this method

toASN1Object

public ASN1Object toASN1Object()
                        throws CodingException
This method returns the ASN1Object of this value.

Throws:
CodingException

decode

public void decode(ASN1Object ao)
            throws CodingException
This method decodes the single value of an Attribute. By default simply keeps the raw encoding, so you need to override this method in subclasses.

Parameters:
ao - - the ASN1Object of the single Attribute value
Throws:
CodingException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(java.lang.String ident)

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object