18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25 package java.beans;
26
27 import com.sun.beans.finder.PersistenceDelegateFinder;
28
29 import java.util.HashMap;
30 import java.util.IdentityHashMap;
31 import java.util.Map;
32
33 /**
34 * An <code>Encoder</code> is a class which can be used to create
35 * files or streams that encode the state of a collection of
36 * JavaBeans in terms of their public APIs. The <code>Encoder</code>,
37 * in conjunction with its persistence delegates, is responsible for
38 * breaking the object graph down into a series of <code>Statements</code>s
39 * and <code>Expression</code>s which can be used to create it.
40 * A subclass typically provides a syntax for these expressions
41 * using some human readable form - like Java source code or XML.
42 *
43 * @since 1.4
44 *
45 * @author Philip Milne
46 */
47
48 public class Encoder {
49 private final PersistenceDelegateFinder finder = new PersistenceDelegateFinder();
50 private Map<Object, Expression> bindings = new IdentityHashMap<>();
51 private ExceptionListener exceptionListener;
52 boolean executeStatements = true;
53 private Map<Object, Object> attributes;
54
55 /**
56 * Write the specified object to the output stream.
57 * The serialized form will denote a series of
58 * expressions, the combined effect of which will create
|
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25 package java.beans;
26
27 import com.sun.beans.finder.PersistenceDelegateFinder;
28
29 import java.util.HashMap;
30 import java.util.IdentityHashMap;
31 import java.util.Map;
32
33 /**
34 * An <code>Encoder</code> is a class which can be used to create
35 * files or streams that encode the state of a collection of
36 * JavaBeans in terms of their public APIs. The <code>Encoder</code>,
37 * in conjunction with its persistence delegates, is responsible for
38 * breaking the object graph down into a series of {@code Statement}s
39 * and <code>Expression</code>s which can be used to create it.
40 * A subclass typically provides a syntax for these expressions
41 * using some human readable form - like Java source code or XML.
42 *
43 * @since 1.4
44 *
45 * @author Philip Milne
46 */
47
48 public class Encoder {
49 private final PersistenceDelegateFinder finder = new PersistenceDelegateFinder();
50 private Map<Object, Expression> bindings = new IdentityHashMap<>();
51 private ExceptionListener exceptionListener;
52 boolean executeStatements = true;
53 private Map<Object, Object> attributes;
54
55 /**
56 * Write the specified object to the output stream.
57 * The serialized form will denote a series of
58 * expressions, the combined effect of which will create
|