Package com.reportmill.base
Class RMArchiver
java.lang.Object
com.reportmill.base.RMArchiver
This class handles RM's legacy unarchival.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThis interface defines the method necessary to add archival support to an object. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static ClassclassForClassName(String name, int version) static byte[]fixBytes(byte[] bytes) Fixes old RM PList documents that incorrectly added newlines inside elements (just before or after tag).static StringgetError()static MapReturns a class map to map xml element tag names to ReportMill classes.booleanhasValueNamed(String name) Returns whether there is a value with given name.static booleanisXML(byte[] bytes) Tells whether inputStream starts with XML - of course it invalidates the stream, too (iStream.reset() doesn't work).objectFromBytes(byte[] bytes) Unarchives an object from byte array.readBooleanWithName(String name) Returns Boolean for given name/default-value.readBooleanWithName(String name, Boolean defaultValue) booleanreadBoolWithName(String name) Returns boolean for given name/default-value.booleanreadBoolWithName(String name, boolean defaultValue) float[]readFloatArrayWithName(String name, int count) Returns float array for given name.floatreadFloatWithName(String name) Returns float for given name/default-value.floatreadFloatWithName(String name, float defaultValue) voidreadIntArrayWithName(int[] array, String name) Returns int array for given name.intreadIntWithName(String name) Returns int for given name/default-value.intreadIntWithName(String name, int defaultValue) readObject(Object aSource) Unarchives an object from a File, String path, URL, byte array, etc.readObjectWithName(String name) Unarchives the named object from the current map.readObjectWithName(String name, Object defaultVal) Unarchives the named object from the current map.readObjectWithName(String name, Object defaultValue, boolean useDefault) Unarchives the named object from the current map.readRectWithName(String name) Returns rect for given name.readStringWithName(String nameString) Returns string for given name/default-value.readStringWithName(String nameString, String defaultValue) byte[]readUnsignedCharArrayWithName(String name, int count) Returns unsigned char array for given name.voidrememberObject(Object newObject) Called by objects during unarchival to record the actual instance that was created.unarchiveObject(Object newObject, Object newInstance) Unarchives an object from the given generic value.intversion()Returns the version of the currently unarchiving document.
-
Constructor Details
-
RMArchiver
public RMArchiver()
-
-
Method Details
-
version
public int version()Returns the version of the currently unarchiving document. -
readObject
Unarchives an object from a File, String path, URL, byte array, etc. -
objectFromBytes
Unarchives an object from byte array. -
readObjectWithName
Unarchives the named object from the current map. -
readObjectWithName
Unarchives the named object from the current map. -
readObjectWithName
Unarchives the named object from the current map. -
unarchiveObject
Unarchives an object from the given generic value. -
readBoolWithName
Returns boolean for given name/default-value. -
readBoolWithName
-
readBooleanWithName
Returns Boolean for given name/default-value. -
readBooleanWithName
-
readIntWithName
Returns int for given name/default-value. -
readIntWithName
-
readFloatWithName
Returns float for given name/default-value. -
readFloatWithName
-
readRectWithName
Returns rect for given name. -
rememberObject
Called by objects during unarchival to record the actual instance that was created. -
hasValueNamed
Returns whether there is a value with given name. -
readStringWithName
Returns string for given name/default-value. -
readStringWithName
-
readUnsignedCharArrayWithName
Returns unsigned char array for given name. -
readIntArrayWithName
Returns int array for given name. -
readFloatArrayWithName
Returns float array for given name. -
getError
-
getRPTMap
Returns a class map to map xml element tag names to ReportMill classes. -
isXML
public static boolean isXML(byte[] bytes) Tells whether inputStream starts with XML - of course it invalidates the stream, too (iStream.reset() doesn't work). -
classForClassName
-
fixBytes
public static byte[] fixBytes(byte[] bytes) Fixes old RM PList documents that incorrectly added newlines inside elements (just before or after tag).
-