Package com.reportmill.base
Class RMArchiver
java.lang.Object
com.reportmill.base.RMArchiver
This class handles RM's legacy unarchival.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic interfaceThis interface defines the method necessary to add archival support to an object.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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- 
RMArchiverpublic RMArchiver()
 
- 
- 
Method Details- 
versionpublic int version()Returns the version of the currently unarchiving document.
- 
readObjectUnarchives an object from a File, String path, URL, byte array, etc.
- 
objectFromBytesUnarchives an object from byte array.
- 
readObjectWithNameUnarchives the named object from the current map.
- 
readObjectWithNameUnarchives the named object from the current map.
- 
readObjectWithNameUnarchives the named object from the current map.
- 
unarchiveObjectUnarchives an object from the given generic value.
- 
readBoolWithNameReturns boolean for given name/default-value.
- 
readBoolWithName
- 
readBooleanWithNameReturns Boolean for given name/default-value.
- 
readBooleanWithName
- 
readIntWithNameReturns int for given name/default-value.
- 
readIntWithName
- 
readFloatWithNameReturns float for given name/default-value.
- 
readFloatWithName
- 
readRectWithNameReturns rect for given name.
- 
rememberObjectCalled by objects during unarchival to record the actual instance that was created.
- 
hasValueNamedReturns whether there is a value with given name.
- 
readStringWithNameReturns string for given name/default-value.
- 
readStringWithName
- 
readUnsignedCharArrayWithNameReturns unsigned char array for given name.
- 
readIntArrayWithNameReturns int array for given name.
- 
readFloatArrayWithNameReturns float array for given name.
- 
getError
- 
getRPTMapReturns a class map to map xml element tag names to ReportMill classes.
- 
isXMLpublic static boolean isXML(byte[] bytes) Tells whether inputStream starts with XML - of course it invalidates the stream, too (iStream.reset() doesn't work).
- 
classForClassName
- 
fixBytespublic static byte[] fixBytes(byte[] bytes) Fixes old RM PList documents that incorrectly added newlines inside elements (just before or after tag).
 
-