|
|||||||||||
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
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 |
currentGrammar
The current grammar |
protected boolean |
grammarEndAllowed
The grammar end transition flag |
protected boolean |
grammarPopAllowed
The grammar pop transition flag |
protected IGrammar[] |
grammars
All the possible grammars |
protected IGrammar[] |
grammarStack
The grammars that are used. |
protected int |
nbGrammars
The number of stored grammars |
protected TLV |
parentTLV
The parent TLV |
protected boolean[] |
popAllowedStack
Store a stack of allowed pop |
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 |
addGrammar(IGrammar grammar)
Add a IGrammar to use |
void |
clean()
Clean the container for the next usage. |
int |
getCurrentGrammar()
Gert the current grammar number |
int |
getCurrentGrammarType()
Get the current grammar type. |
TLV |
getCurrentTLV()
Get the current TLV |
IGrammar |
getGrammar()
Get the current grammar |
TLV |
getParentTLV()
Get the parent TLV; |
int |
getState()
Get the current grammar state |
IStates |
getStates()
Get the states for this container's grammars |
int |
getTransition()
Get the transition |
void |
grammarEndAllowed(boolean grammarEndAllowed)
Set the flag to allow a end transition |
void |
grammarPopAllowed(boolean grammarPopAllowed)
Set the flag to allow a pop transition |
boolean |
isGrammarEndAllowed()
Check that we can have a end state after this transition |
boolean |
isGrammarPopAllowed()
Check that we can have a pop after this transition |
int |
restoreGrammar()
restore the previous grammar (the one before a switch has occured) |
void |
setCurrentTLV(TLV tlv)
Set the current TLV |
void |
setInitGrammar(int grammar)
Initialize the grammar stack |
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 |
void |
switchGrammar(int currentState,
int grammar)
Switch to another grammar |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected IGrammar[] grammarStack
protected IGrammar[] grammars
protected int[] stateStack
protected boolean[] popAllowedStack
protected int nbGrammars
protected int currentGrammar
protected int state
protected int transition
protected TLV tlv
protected IStates states
protected TLV parentTLV
protected boolean grammarEndAllowed
protected boolean grammarPopAllowed
Constructor Detail |
public AbstractContainer()
Method Detail |
public IGrammar getGrammar()
getGrammar
in interface IAsn1Container
public void addGrammar(IGrammar grammar)
addGrammar
in interface IAsn1Container
grammar
- The grammar to add.public void switchGrammar(int currentState, int grammar)
switchGrammar
in interface IAsn1Container
currentState
- The current state in the current grammargrammar
- The grammar to add.public int restoreGrammar()
restoreGrammar
in interface IAsn1Container
public int getState()
getState
in interface IAsn1Container
public void setState(int state)
setState
in interface IAsn1Container
state
- The new statepublic boolean isGrammarEndAllowed()
isGrammarEndAllowed
in interface IAsn1Container
public void grammarEndAllowed(boolean grammarEndAllowed)
grammarEndAllowed
in interface IAsn1Container
public boolean isGrammarPopAllowed()
isGrammarPopAllowed
in interface IAsn1Container
public void grammarPopAllowed(boolean grammarPopAllowed)
grammarPopAllowed
in interface IAsn1Container
public int getTransition()
getTransition
in interface IAsn1Container
public void setTransition(int transition)
setTransition
in interface IAsn1Container
transition
- The transition to setpublic int getCurrentGrammar()
getCurrentGrammar
in interface IAsn1Container
public int getCurrentGrammarType()
getCurrentGrammarType
in interface IAsn1Container
public void setInitGrammar(int grammar)
setInitGrammar
in interface IAsn1Container
grammar
- Set the initial grammarpublic void setCurrentTLV(TLV tlv)
setCurrentTLV
in interface IAsn1Container
tlv
- The current TLVpublic TLV getCurrentTLV()
getCurrentTLV
in interface IAsn1Container
public IStates getStates()
getStates
in interface IAsn1Container
public TLV getParentTLV()
getParentTLV
in interface IAsn1Container
public void setParentTLV(TLV parentTLV)
setParentTLV
in interface IAsn1Container
public void clean()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |