1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.asn1.codec;
18
19 /***
20 * <p>Provides the highest level of abstraction for Encoders.
21 * This is the sister interface of {@link org.apache.asn1.codec.Decoder}. Every implementation of
22 * Encoder provides this common generic interface whic allows a user to pass a
23 * generic Object to any Encoder implementation in the codec package.</p>
24 *
25 * @author Apache Software Foundation
26 * @version $Id: Encoder.java,v 1.10 2004/02/29 04:08:31 tobrien Exp $
27 */
28 public interface Encoder {
29
30 /***
31 * Encodes an "Object" and returns the encoded content
32 * as an Object. The Objects here may just be <code>byte[]</code>
33 * or <code>String</code>s depending on the implementation used.
34 *
35 * @param pObject An object ot encode
36 *
37 * @return An "encoded" Object
38 *
39 * @throws EncoderException an encoder exception is
40 * thrown if the encoder experiences a failure
41 * condition during the encoding process.
42 */
43 Object encode(Object pObject) throws EncoderException;
44 }
45