org.apache.asn1.ber
Class BERDecoderState

java.lang.Object
  extended by org.apache.asn1.ber.BERDecoderState

public final class BERDecoderState
extends java.lang.Object

A type safe enumeration representing the state of a BERDecoder. This can take one of the following three values:

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

Field Summary
static BERDecoderState LENGTH
          enum for the LENGTH state
static int LENGTH_VAL
          value for the LENGTH state
private  java.lang.String name
          the name of this enumeration element
static BERDecoderState TAG
          enum for the TAG state
static int TAG_VAL
          value for the TAG state
private  int value
          the value of this enumeration element
static BERDecoderState VALUE
          enum for the VALUE state
static int VALUE_VAL
          value for the VALUE state
 
Constructor Summary
private BERDecoderState(java.lang.String name, int value)
          Private constructor so no other instances can be created other than the public static constants in this class.
 
Method Summary
 java.lang.String getName()
          Get's the name of this enumeration element.
 BERDecoderState getNext(boolean isPrimitive)
          Gets the next state after this BERDecoderState based on the nature of the present TLV being processed.
static BERDecoderState getStartState()
          Gets the start state.
static BERDecoderState getState(int value)
          Gets the state of the decoder using a state value.
static BERDecoderState getState(java.lang.String stateName)
          Gets the enum type for the state regardless of case.
 int getValue()
          Get's the value of this enumeration element.
 boolean isEndState(boolean isPrimitive)
          Determines if this present state is the processing end state for a TLV based on the nature of the current TLV tuple as either a primitive TLV or a constructed one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TAG_VAL

public static final int TAG_VAL
value for the TAG state

See Also:
Constant Field Values

LENGTH_VAL

public static final int LENGTH_VAL
value for the LENGTH state

See Also:
Constant Field Values

VALUE_VAL

public static final int VALUE_VAL
value for the VALUE state

See Also:
Constant Field Values

TAG

public static final BERDecoderState TAG
enum for the TAG state


LENGTH

public static final BERDecoderState LENGTH
enum for the LENGTH state


VALUE

public static final BERDecoderState VALUE
enum for the VALUE state


name

private final java.lang.String name
the name of this enumeration element


value

private final int value
the value of this enumeration element

Constructor Detail

BERDecoderState

private BERDecoderState(java.lang.String name,
                        int value)
Private constructor so no other instances can be created other than the public static constants in this class.

Parameters:
name - a string name for the enumeration value.
value - the integer value of the enumeration.
Method Detail

getName

public final java.lang.String getName()
Get's the name of this enumeration element.

Returns:
the name of the enumeration element

getValue

public final int getValue()
Get's the value of this enumeration element.

Returns:
the value of the enumeration element

getNext

public final BERDecoderState getNext(boolean isPrimitive)
Gets the next state after this BERDecoderState based on the nature of the present TLV being processed.

Parameters:
isPrimitive - true if the current TLV is primitive, false if it is constructed
Returns:
the type safe enum for the next state to transit to

isEndState

public final boolean isEndState(boolean isPrimitive)
Determines if this present state is the processing end state for a TLV based on the nature of the current TLV tuple as either a primitive TLV or a constructed one. The VALUE state is considered a terminal processing state for all TLV tuples. The LENGTH state is considered a terminal processing state for constructed TLV tuples.

Parameters:
isPrimitive - true if the current TLV is primitive, false if it is constructed
Returns:
true if the next state is the last processing state

getStartState

public static final BERDecoderState getStartState()
Gets the start state.

Returns:
the start state

getState

public static final BERDecoderState getState(java.lang.String stateName)
Gets the enum type for the state regardless of case.

Parameters:
stateName - the name of the state
Returns:
the BERDecoderState enum for the state name

getState

public static final BERDecoderState getState(int value)
Gets the state of the decoder using a state value.

Parameters:
value - the value of the state
Returns:
the BERDecoderState for the decoder state value


Copyright © 2004-2009 . All Rights Reserved.