codec.x501
Class AVA

java.lang.Object
  |
  +--codec.x501.AVA

public class AVA
extends Object

This class encapsulates the key and value of a parsed AttributeValueAssertions (AVA), and indicates whether an AVA has a continuation at the same level (a multi valued RDN). This is not an ASN.1 object, do not add it to e.g., an ASN1Sequence.

Version:
"$Id: AVA.java,v 1.2 2007/08/30 08:45:05 pebinger Exp $"
Author:
Volker Roth, Jan Peters
See Also:
RFC2253Parser, Name

Constructor Summary
AVA(String key, byte[] buf, boolean hasSibling)
          Creates an instance with a DER encoded value.
AVA(String key, String value, boolean hasSibling)
          Creates an instance.
 
Method Summary
 boolean equals(Object o)
          Indicates whether some other object is "equal to" this one.
 byte[] getEncodedValue()
          Returns the encoded value of the AVA, if given.
 String getKey()
          Returns the attribute key of the AVA
 String getValue()
          Returns the string value of the AVA.
 boolean hasSibling()
           
 boolean isEncodedValue()
          Returns the status of the attribute value.
 String toString()
          Returns the string representation of the AVA.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AVA

public AVA(String key,
           String value,
           boolean hasSibling)
Creates an instance.
Parameters:
key - The attribute key.
value - The attribute value.
hasSibling - true iff this AVA is followed by another AVA at the same level. In other words, a value of true signals that this AVA is one in a sequence of AVAs of a multi valued RDN.

AVA

public AVA(String key,
           byte[] buf,
           boolean hasSibling)
Creates an instance with a DER encoded value.
Parameters:
key - The attribute key.
buf - The encoded attribute value.
hasSibling - true iff this AVA is followed by another AVA at the same level. In other words, a value of true signals that this AVA is one in a sequence of AVAs of a multi valued RDN.
Method Detail

getKey

public String getKey()
Returns the attribute key of the AVA
Returns:
The attribute key of the AVA

getValue

public String getValue()
Returns the string value of the AVA. If only an encoded value is given, this value is transformed first.
Returns:
the string value of the AVA.

hasSibling

public boolean hasSibling()
Returns:
true if this AVA is followed by another one that was separated from this one by means of a plus sign. In other words, this AVA and the next belong to the same RDN.

isEncodedValue

public boolean isEncodedValue()
Returns the status of the attribute value.
Returns:
true if the attribute value is a byte array.

getEncodedValue

public byte[] getEncodedValue()
Returns the encoded value of the AVA, if given.
Returns:
the encoded value of the AVA.

toString

public String toString()
Returns the string representation of the AVA.
Overrides:
toString in class Object
Returns:
the string representation of the AVA.

equals

public boolean equals(Object o)
Indicates whether some other object is "equal to" this one.
Overrides:
equals in class Object
Parameters:
o - the reference object with which to compare.
Returns:
true if this object is the same as the given object; false otherwise.


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.