|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.base.apps.beans.util.BetwixtUtil
public class BetwixtUtil
Utility methods to persist and load objects using Betwixt library.
| Nested Class Summary | |
|---|---|
static class |
BetwixtUtil.BaseSuppressionStrategy
|
static class |
BetwixtUtil.BaseTypeBindingStrategy
Identifies Enum types as primitives, simplifying their persistence. |
| Constructor Summary | |
|---|---|
BetwixtUtil()
|
|
| Method Summary | ||
|---|---|---|
(package private) static void |
configure(XMLIntrospector xml,
BindingConfiguration cfg)
Configures Betwixt utities consistently for read-write reflexiveness. |
|
(package private) static BeanReader |
newReader(Class<?> clz)
|
|
static
|
readObject(Class<T> clz,
File file)
Reads an object of the specified type from the given file. |
|
static
|
readObject(Class<T> clz,
String data)
Reads an object of the specified type from the given file. |
|
(package private) static void |
write(Object data,
Writer out,
boolean decl)
; Writes the specified object to the given file. |
|
static String |
writeObject(Object data)
; Writes the specified object to a string |
|
static void |
writeObject(Object data,
File file)
; Writes the specified object to the given file. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BetwixtUtil()
| Method Detail |
|---|
public static <T> T readObject(Class<T> clz,
String data)
throws Exception
T - The type of the object to read.clz - The object's class instance.data - The serialized data.
null.
org.apache.commons.lang.NullArgumentException - if either argument is null.
ClassCastException - if the data is not of type T.
Exception - if an severe occurs reading object.
public static <T> T readObject(Class<T> clz,
File file)
throws Exception
T - The type of the object to read.clz - The object's class instance.file - The file containing serialized data.
null.
org.apache.commons.lang.NullArgumentException - if either argument is null.
ClassCastException - if the data is not of type T.
Exception - if an severe occurs reading object.
static BeanReader newReader(Class<?> clz)
throws Exception
Exception
static void configure(XMLIntrospector xml,
BindingConfiguration cfg)
xml - The xml introspector.cfg - The binding configuration.
public static void writeObject(Object data,
File file)
throws Exception
data - The object to write.file - The file to which object is written.
org.apache.commons.lang.NullArgumentException - if either argument is null.
Exception - if an severe occurs writing object.
public static String writeObject(Object data)
throws Exception
data - The object to write.
org.apache.commons.lang.NullArgumentException - if either argument is null.
Exception - if an severe occurs writing object.
static void write(Object data,
Writer out,
boolean decl)
throws Exception
data - The object to write.out - The writer for this object.decl - true if an XML declaration should be included
org.apache.commons.lang.NullArgumentException - if either argument is null.
Exception - if an severe occurs writing object.
|
Please visit Base Apps, hosted on Sourceforge.net. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||