public class AbstractContainer extends Object implements IAsn1Container
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
AbstractContainer() |
Modifier and Type | Method and Description |
---|---|
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
|
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
public IGrammar getGrammar()
getGrammar
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
grammarEndAllowed
- true or false, depending on the next transition
being an end or not.public int getTransition()
getTransition
in interface IAsn1Container
public void setTransition(int transition)
setTransition
in interface IAsn1Container
transition
- The transition to setpublic 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
parentTLV
- The parent TLV to set.public void clean()
public int getNewTlvId()
getNewTlvId
in interface IAsn1Container
public int getTlvId()
IAsn1Container
getTlvId
in interface IAsn1Container
public int getDecodeBytes()
getDecodeBytes
in interface IAsn1Container
public void incrementDecodeBytes(int nb)
incrementDecodeBytes
in interface IAsn1Container
nb
- The buffer size.public int getMaxPDUSize()
getMaxPDUSize
in interface IAsn1Container
public void setMaxPDUSize(int maxPDUSize)
setMaxPDUSize
in interface IAsn1Container
maxPDUSize
- The maximum PDU size (if negative or null, will be
replaced by the max integer value)Copyright © 2003–2016 The Apache Software Foundation. All rights reserved.