 
 is new.
 is new. 
 java.lang.Objectjava.beans.Encoder
public class Encoder
An Encoder is a class which can be used to create files or streams that encode the state of a collection of JavaBeans in terms of their public APIs. The Encoder, in conjunction with its persistence delegates, is responsible for breaking the object graph down into a series of Statementss and Expressions which can be used to create it. A subclass typically provides a syntax for these expressions using some human readable form - like Java source code or XML.
| Constructor Summary | |
|---|---|
| Encoder
() | |
| Method Summary | |
|---|---|
| Object | get
(
Object
 oldInstance) Returns a tentative value for oldInstance in the environment created by this stream. | 
| ExceptionListener | getExceptionListener
() Gets the exception handler for this stream. | 
| PersistenceDelegate | getPersistenceDelegate
(
Class
<?> type) Returns the persistence delegate for the given type. | 
| Object | remove
(
Object
 oldInstance) Removes the entry for this instance, returning the old entry. | 
| void | setExceptionListener
(
ExceptionListener
 exceptionListener) Sets the exception handler for this stream to exceptionListener. | 
| void | setPersistenceDelegate
(
Class
<?> type,                       
PersistenceDelegate
 persistenceDelegate) Sets the persistence delegate associated with this type to persistenceDelegate. | 
| void | writeExpression
(
Expression
 oldExp) The implementation first checks to see if an expression with this value has already been written. | 
| protected void | writeObject
(
Object
 o) Write the specified object to the output stream. | 
| void | writeStatement
(
Statement
 oldStm) Writes statement oldStm to the stream. | 
| Methods inherited from class java.lang. Object | 
|---|
| clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait | 
| Constructor Detail | 
|---|
public Encoder()
| Method Detail | 
|---|
protected void writeObject(Object o)
public void setExceptionListener(ExceptionListener exceptionListener)
public ExceptionListener getExceptionListener()
public PersistenceDelegate getPersistenceDelegate(Class<?> type)
 default
default 
 
 The default constructor is the constructor with the greatest number of parameters that has the
The default constructor is the constructor with the greatest number of parameters that has the 
 ConstructorProperties
ConstructorProperties
 annotation. If none of the constructors have the ConstructorProperties annotation, then the nullary constructor (constructor with no parameters) will be used. For example, in the following the nullary constructor for Foo will be used, while the two parameter constructor for Bar will be used. public class Foo { public Foo() { ... } public Foo(int x) { ... } } public class Bar { public Bar() { ... }
annotation. If none of the constructors have the ConstructorProperties annotation, then the nullary constructor (constructor with no parameters) will be used. For example, in the following the nullary constructor for Foo will be used, while the two parameter constructor for Bar will be used. public class Foo { public Foo() { ... } public Foo(int x) { ... } } public class Bar { public Bar() { ... } 
public void setPersistenceDelegate(Class<?> type,
                                   PersistenceDelegate persistenceDelegate)
public Object remove(Object oldInstance)
public Object get(Object oldInstance)
public void writeStatement(Statement oldStm)
The implementation of this method will produce a second expression to represent the same expression in an environment that will exist when the stream is read. This is achieved simply by calling writeObject on the target and all the arguments and building a new expression with the results.
public void writeExpression(Expression oldExp)