1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.asn1.ber.digester ;
18
19
20 import java.nio.ByteBuffer;
21
22 import org.apache.asn1.ber.TypeClass;
23
24
25 /***
26 * A BER event processing rule.
27 *
28 * @author <a href="mailto:dev@directory.apache.org">
29 * Apache Directory Project</a>
30 * @version $Rev: 157644 $
31 */
32 public interface Rule
33 {
34 /***
35 * Get the <code>BERDigester</code> with which this <code>Rule</code> has
36 * been associated.
37 *
38 * @return the associated rulesBase
39 */
40 BERDigester getDigester() ;
41
42 /***
43 * Set the <code>BERDigester</code> with which this <code>Rule</code> will
44 * be associated.
45 *
46 * @param digester the rulesBase to associate this rule with
47 */
48 void setDigester( BERDigester digester ) ;
49
50 /***
51 * Called when the tag of the matched TLV is encountered.
52 *
53 * @param id the tag's id
54 * @param isPrimitive whether tlv is primitive or constructed
55 * @param typeClass the tag's type class
56 */
57 void tag( int id, boolean isPrimitive, TypeClass typeClass ) ;
58
59 /***
60 * Called when the length of a TLV is encountered.
61 *
62 * @param length the length in bytes of the value
63 */
64 void length( int length ) ;
65
66 /***
67 * Called when a peice of the value is available.
68 *
69 * @param buf a portion of the value
70 */
71 void value( ByteBuffer buf ) ;
72
73 /***
74 * Called when the tlv has been completely consumed.
75 */
76 void finish() ;
77 }