1 /*
2 * Copyright 2005 The Apache Software Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 */
17 package org.apache.asn1new.ber.tlv;
18
19 import org.apache.asn1.codec.DecoderException;
20
21
22
23 /**
24 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
25 */
26 public interface ITLVBerDecoderMBean
27 {
28 //~ Methods ------------------------------------------------------------------------------------
29
30 /** Set the number of bytes that can be used to encode the Value length,
31 * including the first byte.
32 * Max is 127 if the Length use a definite form, default is 1
33 *
34 * @param length The number of byte to use
35 */
36 void setMaxLengthLength( int length ) throws DecoderException;
37
38 /** Set the maximum number of bytes that should be used to encode a Tag label,
39 * including the first byte.
40 * Default is 1, no maximum
41 *
42 * @param length The length to use
43 */
44 void setMaxTagLength( int length );
45
46 /** Allow indefinite length. */
47 void allowIndefiniteLength();
48
49 /** Disallow indefinite length. */
50 void disallowIndefiniteLength();
51
52 /** Get the actual maximum number of bytes that can be used to encode the Length
53 *
54 * @return The maximum bytes of the Length
55 */
56 int getMaxLengthLength();
57
58 /** Get the actual maximum number of bytes that can be used to encode the Tag
59 * @return The maximum length of the Tag
60 */
61 int getMaxTagLength();
62
63 /** Tell if indefinite length form could be used for Length
64 * @return <code>true</code> if the Indefinite form is allowed
65 */
66 boolean isIndefiniteLengthAllowed();
67 }