org.opends.server.protocols.asn1
Class ASN1Null

java.lang.Object
  extended by org.opends.server.protocols.asn1.ASN1Element
      extended by org.opends.server.protocols.asn1.ASN1Null
All Implemented Interfaces:
java.io.Serializable, ProtocolElement

@PublicAPI(stability=UNCOMMITTED,
           mayInstantiate=true,
           mayExtend=false,
           mayInvoke=true)
public final class ASN1Null
extends ASN1Element

This class defines the data structures and methods to use when interacting with ASN.1 null elements.

See Also:
Serialized Form

Constructor Summary
ASN1Null()
          Creates a new ASN.1 null element with the default type.
ASN1Null(byte type)
          Creates a new ASN.1 null element with the specified type.
 
Method Summary
static ASN1Null decodeAsNull(ASN1Element element)
          Decodes the provided ASN.1 element as a null element.
static ASN1Null decodeAsNull(byte[] encodedElement)
          Decodes the provided byte array as an ASN.1 null element.
 void setValue(byte[] value)
          Specifies the value for this ASN.1 null element.
 void toString(java.lang.StringBuilder buffer)
          Appends a string representation of this ASN.1 null element to the provided buffer.
 void toString(java.lang.StringBuilder buffer, int indent)
          Appends a string representation of this protocol element to the provided buffer.
 
Methods inherited from class org.opends.server.protocols.asn1.ASN1Element
decode, decode, decodeAsBoolean, decodeAsEnumerated, decodeAsInteger, decodeAsLong, decodeAsNull, decodeAsOctetString, decodeAsSequence, decodeAsSet, decodeElements, encode, encodeLength, encodeLongValue, encodeValue, encodeValue, encodeValue, equals, equalsElement, equalsIgnoreType, equalsIgnoreType, getProtocolElementName, getType, hashCode, isApplicationSpecific, isConstructed, isContextSpecific, isPrimitive, isPrivate, isUniversal, setType, setValueInternal, toString, value
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ASN1Null

public ASN1Null()
Creates a new ASN.1 null element with the default type.


ASN1Null

public ASN1Null(byte type)
Creates a new ASN.1 null element with the specified type.

Parameters:
type - The BER type to use for this ASN.1 null element.
Method Detail

setValue

public void setValue(byte[] value)
              throws ASN1Exception
Specifies the value for this ASN.1 null element.

Overrides:
setValue in class ASN1Element
Parameters:
value - The encoded value for this ASN.1 null element.
Throws:
ASN1Exception - If the provided array is not empty.

decodeAsNull

public static ASN1Null decodeAsNull(ASN1Element element)
                             throws ASN1Exception
Decodes the provided ASN.1 element as a null element.

Parameters:
element - The ASN.1 element to decode as a null element.
Returns:
The decoded ASN.1 null element.
Throws:
ASN1Exception - If the provided ASN.1 element cannot be decoded as a null element.

decodeAsNull

public static ASN1Null decodeAsNull(byte[] encodedElement)
                             throws ASN1Exception
Decodes the provided byte array as an ASN.1 null element.

Parameters:
encodedElement - The byte array to decode as an ASN.1 null element.
Returns:
The decoded ASN.1 null element.
Throws:
ASN1Exception - If the provided byte array cannot be decoded as an ASN.1 null element.

toString

public void toString(java.lang.StringBuilder buffer)
Appends a string representation of this ASN.1 null element to the provided buffer.

Specified by:
toString in interface ProtocolElement
Overrides:
toString in class ASN1Element
Parameters:
buffer - The buffer to which the information should be appended.

toString

public void toString(java.lang.StringBuilder buffer,
                     int indent)
Appends a string representation of this protocol element to the provided buffer.

Specified by:
toString in interface ProtocolElement
Overrides:
toString in class ASN1Element
Parameters:
buffer - The buffer into which the string representation should be written.
indent - The number of spaces that should be used to indent the resulting string representation.