org.apache.asn1.ber
Class TupleTreeDecoder

java.lang.Object
  extended byorg.apache.asn1.ber.TupleTreeDecoder
All Implemented Interfaces:
org.apache.asn1.codec.stateful.StatefulDecoder

public class TupleTreeDecoder
extends java.lang.Object
implements org.apache.asn1.codec.stateful.StatefulDecoder

Builds a TLV tree from the TLV stream emitted from the decoder. The decoded objects delivered to this StatefulDecoder's DecoderCallback are DefaultMutableTupleNodes.

Version:
$Rev: 157644 $
Author:
Apache Directory Project

Field Summary
(package private)  org.apache.asn1.codec.stateful.DecoderCallback cb
          the callback to use for this StatefulDecoder
(package private)  BERDecoder decoder
          the underlying BER data stream to TLV stream decoder
(package private)  org.apache.asn1.codec.stateful.DecoderMonitor monitor
          the monitor to use for this StatefulDecoder
(package private)  java.util.Stack stack
          a stack of nested constructed tuples used to track state
(package private)  java.util.ArrayList valueChunks
          the value chunks buffer collection
 
Constructor Summary
TupleTreeDecoder()
          Creates a simple BER byte stream to TLV Tuple tree decoder.
 
Method Summary
 void decode(java.lang.Object encoded)
           
private  void handleTuple(Tuple t)
          Handles a tuple recieved from the underlying BER byte stream decoder.
 void setCallback(org.apache.asn1.codec.stateful.DecoderCallback cb)
           
 void setDecoderMonitor(org.apache.asn1.codec.stateful.DecoderMonitor monitor)
           
static TupleNode treeDecode(java.nio.ByteBuffer buf)
          Decodes a BER byte buffer into a tree of TLV tuples.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stack

java.util.Stack stack
a stack of nested constructed tuples used to track state


decoder

BERDecoder decoder
the underlying BER data stream to TLV stream decoder


cb

org.apache.asn1.codec.stateful.DecoderCallback cb
the callback to use for this StatefulDecoder


monitor

org.apache.asn1.codec.stateful.DecoderMonitor monitor
the monitor to use for this StatefulDecoder


valueChunks

java.util.ArrayList valueChunks
the value chunks buffer collection

Constructor Detail

TupleTreeDecoder

public TupleTreeDecoder()
Creates a simple BER byte stream to TLV Tuple tree decoder.

Method Detail

handleTuple

private void handleTuple(Tuple t)
Handles a tuple recieved from the underlying BER byte stream decoder.

Parameters:
t - the tuple to handle

decode

public void decode(java.lang.Object encoded)
            throws org.apache.asn1.codec.DecoderException
Specified by:
decode in interface org.apache.asn1.codec.stateful.StatefulDecoder
Throws:
org.apache.asn1.codec.DecoderException

treeDecode

public static TupleNode treeDecode(java.nio.ByteBuffer buf)
                            throws org.apache.asn1.codec.DecoderException
Decodes a BER byte buffer into a tree of TLV tuples.

Parameters:
buf - the buffer to decode
Returns:
the TLV tuple node with children if applicable
Throws:
org.apache.asn1.codec.DecoderException - if there is a problem decoding the data
java.util.NoSuchElementException - if there is not enough data to properly decode a complete TLV tree

setCallback

public void setCallback(org.apache.asn1.codec.stateful.DecoderCallback cb)
Specified by:
setCallback in interface org.apache.asn1.codec.stateful.StatefulDecoder

setDecoderMonitor

public void setDecoderMonitor(org.apache.asn1.codec.stateful.DecoderMonitor monitor)
Specified by:
setDecoderMonitor in interface org.apache.asn1.codec.stateful.StatefulDecoder


Copyright © 2004-2006 . All Rights Reserved.