|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.asn1.ber.digester.AbstractRule
org.apache.asn1.ber.digester.rules.PrimitiveOctetStringRule
A rule that collects the value bytes of an ASN.1 OCTET STRING and pushes the buffer of bytes onto the digester's Object stack as a ByteBuffer.
This rule can only handle primitive octet strings. Constructed OCTET STRING values are simply ignored by this rule rather than throwing exceptions.
Field Summary | |
private ByteAccumulator |
accumulator
used to accumulate value bytes |
private boolean |
isConstructed
used to determine if our type is constructed or primitive |
private TagEnum |
tag
the tag to be accepted which defaults to an UNIVERSAL OCTET_STRING |
Fields inherited from class org.apache.asn1.ber.digester.AbstractRule |
|
Constructor Summary | |
PrimitiveOctetStringRule()
Creates a rule using defaults where only the OCTET_STRING tag id is accepted. |
|
PrimitiveOctetStringRule(TagEnum tag)
Creates a rule where only a specific tag is accepted. |
Method Summary | |
void |
finish()
Called when the tlv has been completely consumed. |
protected ByteAccumulator |
getAccumulator()
Gets the ByteAccumulator used by this octet string gathering rule. |
protected TagEnum |
getTag()
Gets the tag associated with this rule. |
protected boolean |
isConstructed()
Gets whether or not the current TLV for this octet string is constructed. |
void |
length(int length)
Called when the length of a TLV is encountered. |
protected void |
setConstructed(boolean isConstructed)
Gets whether or not the current TLV for this octet string is constructed. |
void |
tag(int id,
boolean isPrimitive,
TypeClass typeClass)
Rejects tag id's that are not equal to this Rules's id. |
void |
value(java.nio.ByteBuffer buf)
Called when a peice of the value is available. |
Methods inherited from class org.apache.asn1.ber.digester.AbstractRule |
getDigester, setDigester |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private final ByteAccumulator accumulator
private boolean isConstructed
private final TagEnum tag
Constructor Detail |
public PrimitiveOctetStringRule()
public PrimitiveOctetStringRule(TagEnum tag)
tag
- the tag to acceptMethod Detail |
public void tag(int id, boolean isPrimitive, TypeClass typeClass)
tag
in interface Rule
tag
in class AbstractRule
Rule.tag(int, boolean,
org.apache.asn1.ber.TypeClass)
public void length(int length)
Rule
length
in interface Rule
length
in class AbstractRule
public void value(java.nio.ByteBuffer buf)
Rule
value
in interface Rule
value
in class AbstractRule
public void finish()
Rule
finish
in interface Rule
finish
in class AbstractRule
protected ByteAccumulator getAccumulator()
protected boolean isConstructed()
protected void setConstructed(boolean isConstructed)
isConstructed
- true to set to constructed, false otherwiseprotected TagEnum getTag()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |