|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.directory.api.asn1.ber.AbstractContainer
public abstract 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 all the informations needed to decode a PDU.
| Field Summary | |
|---|---|
protected int |
decodeBytes
A counter for the decoded bytes |
protected Grammar<?> |
grammar
All the possible grammars |
protected int[] |
stateStack
Store a stack of the current states used when switching grammars |
| Constructor Summary | |
|---|---|
protected |
AbstractContainer()
Creates a new instance of AbstractContainer with a starting state. |
protected |
AbstractContainer(ByteBuffer stream)
Creates a new instance of AbstractContainer with a starting state. |
| Method Summary | |
|---|---|
void |
clean()
Clean the container for the next usage. |
TLV |
getCurrentTLV()
Gets the currentTLV |
int |
getDecodeBytes()
|
Grammar |
getGrammar()
Gets the grammar |
int |
getMaxPDUSize()
|
int |
getNewTlvId()
Gets a new TLV id |
TLV |
getParentTLV()
|
TLVStateEnum |
getState()
Gets the current grammar state |
ByteBuffer |
getStream()
Gets the current stream containing the bytes to decode |
int |
getTlvId()
Gets the current TLV id |
Enum<?> |
getTransition()
Gets the transition |
void |
incrementDecodeBytes(int nb)
Increment the decodedBytes by the latest received buffer's size. |
boolean |
isGathering()
|
boolean |
isGrammarEndAllowed()
Checks that we can have a end state after this transition |
void |
rewind()
Move backward in the stream to the first byte for a given TLV. |
void |
setCurrentTLV(TLV currentTLV)
Sets the current TLV |
void |
setGathering(boolean isGathering)
Set the isGathering flag |
void |
setGrammarEndAllowed(boolean grammarEndAllowed)
Sets the flag to allow a end transition |
void |
setMaxPDUSize(int maxPDUSize)
Set the maximum PDU size. |
void |
setParentTLV(TLV parentTLV)
Sets the parent TLV |
void |
setState(TLVStateEnum state)
Sets the new current state |
void |
setStream(ByteBuffer stream)
Stores the Stream being decoded |
void |
setTransition(Enum<?> transition)
Updates the transition from a state to another |
void |
updateParent()
Update the parent's length |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Grammar<?> grammar
protected int[] stateStack
protected int decodeBytes
| Constructor Detail |
|---|
protected AbstractContainer()
protected AbstractContainer(ByteBuffer stream)
stream - the buffer containing the data to decode| Method Detail |
|---|
public Grammar getGrammar()
getGrammar in interface Asn1Containerpublic TLVStateEnum getState()
getState in interface Asn1Containerpublic void setState(TLVStateEnum state)
setState in interface Asn1Containerstate - The new statepublic boolean isGrammarEndAllowed()
isGrammarEndAllowed in interface Asn1Containerpublic void setGrammarEndAllowed(boolean grammarEndAllowed)
setGrammarEndAllowed in interface Asn1ContainergrammarEndAllowed - true or false, depending on the next transition
being an end or not.public Enum<?> getTransition()
getTransition in interface Asn1Containerpublic void setTransition(Enum<?> transition)
setTransition in interface Asn1Containertransition - The transition to setpublic void setCurrentTLV(TLV currentTLV)
setCurrentTLV in interface Asn1ContainercurrentTLV - The current TLVpublic TLV getCurrentTLV()
getCurrentTLV in interface Asn1Containerpublic TLV getParentTLV()
getParentTLV in interface Asn1Containerpublic void setParentTLV(TLV parentTLV)
setParentTLV in interface Asn1ContainerparentTLV - The new parent TLVpublic void clean()
public int getNewTlvId()
getNewTlvId in interface Asn1Containerpublic int getTlvId()
getTlvId in interface Asn1Containerpublic int getDecodeBytes()
getDecodeBytes in interface Asn1Containerpublic void incrementDecodeBytes(int nb)
incrementDecodeBytes in interface Asn1Containernb - The buffer size.public int getMaxPDUSize()
getMaxPDUSize in interface Asn1Containerpublic void setMaxPDUSize(int maxPDUSize)
setMaxPDUSize in interface Asn1ContainermaxPDUSize - The maximum PDU size (if negative or null, will be
replaced by the max integer value)public ByteBuffer getStream()
getStream in interface Asn1Containerpublic void setStream(ByteBuffer stream)
setStream in interface Asn1Containerstream - The stream being decodedpublic void rewind()
rewind in interface Asn1Containerpublic void updateParent()
updateParent in interface Asn1Containerpublic boolean isGathering()
isGathering in interface Asn1Containerpublic void setGathering(boolean isGathering)
setGathering in interface Asn1ContainerisGathering - true to ask the Asn1Decoder to gather the data
into the container. If not set, the default value is 'false'
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||