|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.directory.shared.asn1.ber.AbstractContainer
public class AbstractContainer
This class is the abstract container used to store the current state of a PDU being decoded. It also stores the grammars used to decode the PDU, and zll the informations needed to decode a PDU.
| Field Summary | |
|---|---|
protected int |
decodeBytes
A counter for the decoded bytes |
protected IGrammar |
grammar
All the possible grammars |
protected boolean |
grammarEndAllowed
The grammar end transition flag |
protected int |
maxPDUSize
The maximum allowed size for a PDU. |
protected TLV |
parentTLV
The parent TLV |
protected int |
state
The current state of the decoding |
protected IStates |
states
Store the different states for debug purpose |
protected int[] |
stateStack
Store a stack of the current states used when switching grammars |
protected TLV |
tlv
The current TLV |
protected int |
transition
The current transition |
| Constructor Summary | |
|---|---|
AbstractContainer()
|
|
| Method Summary | |
|---|---|
void |
clean()
Clean the container for the next usage. |
TLV |
getCurrentTLV()
Get the current TLV |
int |
getDecodeBytes()
|
IGrammar |
getGrammar()
Get the current grammar |
int |
getMaxPDUSize()
|
int |
getNewTlvId()
Return a new ID and increment the counter |
TLV |
getParentTLV()
Get the parent TLV; |
int |
getState()
Get the current grammar state |
IStates |
getStates()
Get the states for this container's grammars |
int |
getTlvId()
Get the current TLV id |
int |
getTransition()
Get the transition |
void |
grammarEndAllowed(boolean grammarEndAllowed)
Set the flag to allow a end transition |
void |
incrementDecodeBytes(int nb)
Increment the decodedBytes by the latest received buffer's size. |
boolean |
isGrammarEndAllowed()
Check that we can have a end state after this transition |
void |
setCurrentTLV(TLV tlv)
Set the current TLV |
void |
setMaxPDUSize(int maxPDUSize)
Set the maximum PDU size. |
void |
setParentTLV(TLV parentTLV)
Set the parent TLV. |
void |
setState(int state)
Set the new current state |
void |
setTransition(int transition)
Update the transition from a state to another |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected IGrammar grammar
protected int[] stateStack
protected int state
protected int transition
protected TLV tlv
protected IStates states
protected TLV parentTLV
protected boolean grammarEndAllowed
protected int decodeBytes
protected int maxPDUSize
| Constructor Detail |
|---|
public AbstractContainer()
| Method Detail |
|---|
public IGrammar getGrammar()
getGrammar in interface IAsn1Containerpublic int getState()
getState in interface IAsn1Containerpublic void setState(int state)
setState in interface IAsn1Containerstate - The new statepublic boolean isGrammarEndAllowed()
isGrammarEndAllowed in interface IAsn1Containerpublic void grammarEndAllowed(boolean grammarEndAllowed)
grammarEndAllowed in interface IAsn1ContainergrammarEndAllowed - true or false, depending on the next transition
being an end or not.public int getTransition()
getTransition in interface IAsn1Containerpublic void setTransition(int transition)
setTransition in interface IAsn1Containertransition - The transition to setpublic void setCurrentTLV(TLV tlv)
setCurrentTLV in interface IAsn1Containertlv - The current TLVpublic TLV getCurrentTLV()
getCurrentTLV in interface IAsn1Containerpublic IStates getStates()
getStates in interface IAsn1Containerpublic TLV getParentTLV()
getParentTLV in interface IAsn1Containerpublic void setParentTLV(TLV parentTLV)
setParentTLV in interface IAsn1ContainerparentTLV - The parent TLV to set.public void clean()
public int getNewTlvId()
getNewTlvId in interface IAsn1Containerpublic int getTlvId()
IAsn1Container
getTlvId in interface IAsn1Containerpublic int getDecodeBytes()
getDecodeBytes in interface IAsn1Containerpublic void incrementDecodeBytes(int nb)
incrementDecodeBytes in interface IAsn1Containernb - The buffer size.public int getMaxPDUSize()
getMaxPDUSize in interface IAsn1Containerpublic void setMaxPDUSize(int maxPDUSize)
setMaxPDUSize in interface IAsn1ContainermaxPDUSize - The maximum PDU size (if negative or null, will be
replaced by the max integer value)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||