org.apache.asn1new.ber.tlv
Class TLV

java.lang.Object
  extended by org.apache.asn1new.ber.tlv.TLV

public class TLV
extends java.lang.Object

This class is used to store Tag, Length and Value decoded from a PDU.

Author:
Apache Directory Project

Field Summary
private  int expectedLength
          The expected length of the TLV's elements, if the current TLV is a constructed TLV.
private  Length length
          The current Length being processed
private  TLV parent
          Reference the TLV which contains the current TLV, if any.
private  Tag tag
          The current Tag being processed
private  Value value
          The current Value being processed
 
Constructor Summary
TLV()
          Creates a new TLV object.
 
Method Summary
 int getExpectedLength()
          Get the TLV expected length.
 Length getLength()
           
 TLV getParent()
           
 int getSize()
          The TLV size is calculated by adding the Tag's size, the Length's size and the Value's length, if any.
 Tag getTag()
           
 Value getValue()
           
 void reset()
          Reset the TLV, so it can be reused for the next PDU decoding.
 void setExpectedLength(int expectedLength)
          Set the new expected length of the current TLV.
 void setLength(Length length)
          Add the TLV Length part
 void setParent(TLV parent)
           
 java.lang.String toString()
          Get a String representation of the TLV
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tag

private Tag tag
The current Tag being processed


length

private Length length
The current Length being processed


value

private Value value
The current Value being processed


parent

private TLV parent
Reference the TLV which contains the current TLV, if any. As the enclosing TLV of a PDU does not have parent, it can be null in this case. Otherwise, it must point to a constructed TLV


expectedLength

private int expectedLength
The expected length of the TLV's elements, if the current TLV is a constructed TLV.

Constructor Detail

TLV

public TLV()
Creates a new TLV object.

Method Detail

reset

public void reset()
Reset the TLV, so it can be reused for the next PDU decoding.


getLength

public Length getLength()
Returns:
Returns the length.

setLength

public void setLength(Length length)
Add the TLV Length part

Parameters:
length - The length to set.

getTag

public Tag getTag()
Returns:
Returns the tag.

getValue

public Value getValue()
Returns:
Returns the value.

toString

public java.lang.String toString()
Get a String representation of the TLV

Overrides:
toString in class java.lang.Object
Returns:
A String

getSize

public int getSize()
The TLV size is calculated by adding the Tag's size, the Length's size and the Value's length, if any.

Returns:
Returns the size of the TLV.

getParent

public TLV getParent()
Returns:
Returns the parent.

setParent

public void setParent(TLV parent)
Parameters:
parent - The parent to set.

getExpectedLength

public int getExpectedLength()
Get the TLV expected length.

Returns:
Returns the expectedLength.

setExpectedLength

public void setExpectedLength(int expectedLength)
Set the new expected length of the current TLV.

Parameters:
expectedLength - The expectedLength to set.


Copyright © 2005-2009 . All Rights Reserved.