Class RMArchiver

java.lang.Object
com.reportmill.base.RMArchiver

public class RMArchiver extends Object
This class handles RM's legacy unarchival.
  • Constructor Details

    • RMArchiver

      public RMArchiver()
  • Method Details

    • version

      public int version()
      Returns the version of the currently unarchiving document.
    • readObject

      public Object readObject(Object aSource)
      Unarchives an object from a File, String path, URL, byte array, etc.
    • objectFromBytes

      public Object objectFromBytes(byte[] bytes)
      Unarchives an object from byte array.
    • readObjectWithName

      public Object readObjectWithName(String name)
      Unarchives the named object from the current map.
    • readObjectWithName

      public Object readObjectWithName(String name, Object defaultVal)
      Unarchives the named object from the current map.
    • readObjectWithName

      public Object readObjectWithName(String name, Object defaultValue, boolean useDefault)
      Unarchives the named object from the current map.
    • unarchiveObject

      public Object unarchiveObject(Object newObject, Object newInstance)
      Unarchives an object from the given generic value.
    • readBoolWithName

      public boolean readBoolWithName(String name)
      Returns boolean for given name/default-value.
    • readBoolWithName

      public boolean readBoolWithName(String name, boolean defaultValue)
    • readBooleanWithName

      public Boolean readBooleanWithName(String name)
      Returns Boolean for given name/default-value.
    • readBooleanWithName

      public Boolean readBooleanWithName(String name, Boolean defaultValue)
    • readIntWithName

      public int readIntWithName(String name)
      Returns int for given name/default-value.
    • readIntWithName

      public int readIntWithName(String name, int defaultValue)
    • readFloatWithName

      public float readFloatWithName(String name)
      Returns float for given name/default-value.
    • readFloatWithName

      public float readFloatWithName(String name, float defaultValue)
    • readRectWithName

      public RMRect readRectWithName(String name)
      Returns rect for given name.
    • rememberObject

      public void rememberObject(Object newObject)
      Called by objects during unarchival to record the actual instance that was created.
    • hasValueNamed

      public boolean hasValueNamed(String name)
      Returns whether there is a value with given name.
    • readStringWithName

      public String readStringWithName(String nameString)
      Returns string for given name/default-value.
    • readStringWithName

      public String readStringWithName(String nameString, String defaultValue)
    • readUnsignedCharArrayWithName

      public byte[] readUnsignedCharArrayWithName(String name, int count)
      Returns unsigned char array for given name.
    • readIntArrayWithName

      public void readIntArrayWithName(int[] array, String name)
      Returns int array for given name.
    • readFloatArrayWithName

      public float[] readFloatArrayWithName(String name, int count)
      Returns float array for given name.
    • getError

      public static String getError()
    • getRPTMap

      public static Map 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

      protected static Class classForClassName(String name, int version)
    • fixBytes

      public static byte[] fixBytes(byte[] bytes)
      Fixes old RM PList documents that incorrectly added newlines inside elements (just before or after tag).