org.apache.asn1.ber.digester
Class AbstractRule

java.lang.Object
  extended byorg.apache.asn1.ber.digester.AbstractRule
All Implemented Interfaces:
Rule
Direct Known Subclasses:
ObjectCreateRule, PopOnFinish, PrimitiveBooleanRule, PrimitiveIntDecodeRule, PrimitiveOctetStringRule

public abstract class AbstractRule
extends java.lang.Object
implements Rule

A rule base class.

Version:
$Rev: 157644 $
Author:
Apache Directory Project

Field Summary
private  BERDigester digester
           
 
Constructor Summary
AbstractRule()
           
 
Method Summary
 void finish()
          Called when the tlv has been completely consumed.
 BERDigester getDigester()
          Get the BERDigester with which this Rule has been associated.
 void length(int length)
          Called when the length of a TLV is encountered.
 void setDigester(BERDigester digester)
          Set the BERDigester with which this Rule will be associated.
 void tag(int id, boolean isPrimitive, TypeClass typeClass)
          Called when the tag of the matched TLV is encountered.
 void value(java.nio.ByteBuffer buf)
          Called when a peice of the value is available.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

digester

private BERDigester digester
Constructor Detail

AbstractRule

public AbstractRule()
Method Detail

getDigester

public BERDigester getDigester()
Description copied from interface: Rule
Get the BERDigester with which this Rule has been associated.

Specified by:
getDigester in interface Rule
Returns:
the associated rulesBase

setDigester

public void setDigester(BERDigester digester)
Description copied from interface: Rule
Set the BERDigester with which this Rule will be associated.

Specified by:
setDigester in interface Rule
Parameters:
digester - the rulesBase to associate this rule with

tag

public void tag(int id,
                boolean isPrimitive,
                TypeClass typeClass)
Description copied from interface: Rule
Called when the tag of the matched TLV is encountered.

Specified by:
tag in interface Rule
Parameters:
id - the tag's id
isPrimitive - whether tlv is primitive or constructed
typeClass - the tag's type class

length

public void length(int length)
Description copied from interface: Rule
Called when the length of a TLV is encountered.

Specified by:
length in interface Rule
Parameters:
length - the length in bytes of the value

value

public void value(java.nio.ByteBuffer buf)
Description copied from interface: Rule
Called when a peice of the value is available.

Specified by:
value in interface Rule
Parameters:
buf - a portion of the value

finish

public void finish()
Description copied from interface: Rule
Called when the tlv has been completely consumed.

Specified by:
finish in interface Rule


Copyright © 2004-2006 . All Rights Reserved.