Package com.ribs
Class RXArchiver
java.lang.Object
com.ribs.RXArchiver
- Direct Known Subclasses:
- RibsArchiver
This class manages archival and unarchival to/from RXElements.
 
For archival, objects simply implement the toXML() method to configure and return RXElements. RXArchiver's toXML() method manages the process, allowing for object references.
For unarchival, classes register for particular element names. Then during RXArchiver.fromXML(), RXArchiver will call fromXML() on the classes for encountered tags to reconstruct the object graph.
Copyright (c) 2004 ReportMill Software, Inc. All Rights Reserved. Contact ReportMill <info@reportmill.com>.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classThis inner class represents a named resource associated with an archiver.
- 
Constructor SummaryConstructorsConstructorDescriptionCreates a new archiver.RXArchiver(Map classMap) Creates an archiver with the given class map for unarchival class mapping.
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds a parent to the parent list.addResource(byte[] bytes, String aName) Adds a byte array resource to this archiver (only if absent).Returns an object unarchived from the given element.Returns an object unarchived from the given element by instanciating the given class.Returns a root object unarchived from the XML source (a File, String path, InputStream, URL, byte[], etc.).protected ObjectCalls fromXML on given object.Returns the first object of the given class from the given element.Returns the named object unarchived from the given element.Returns the named object unarchived from the given element (or, if missing, the given default value).Returns the list of objects of the given class unarchived from the given element.Returns the list of objects with the given name unarchived from given element.Returns the list of objects with the given name unarchived from given element instanciated from given class.Returns the list of objects with the given name unarchived from given element (or, if missing, given default).Returns parent object that initiated unarchival for current object (valid inside that object's fromXML method).intgetReference(Object anObj) Returns a reference id for the given object (used in archival).intgetReference(Object anObj, boolean add) Returns a reference id for given object if in references list with option to add if absent (used in archival).getReference(String aName, RXElement anElement) Returns an object for a given reference (used in unarchival).getResource(int anIndex) Returns an individual resource associated with this archiver, by index.byte[]getResource(String aName) Returns an individual resource associated with this archiver, by name.Returns the list of optional resources associated with this archiver.protected ObjectnewInstance(RXElement anElement, Class aClass) Returns a new instance of an object given an element and suggested class (probably null).voidCalled when a fromXML method swaps another object in to replace the one unarchiving.Writes the given object to XML elements.
- 
Constructor Details- 
RXArchiverpublic RXArchiver()Creates a new archiver.
- 
RXArchiverCreates an archiver with the given class map for unarchival class mapping.
 
- 
- 
Method Details- 
toXMLWrites the given object to XML elements.
- 
fromXMLReturns a root object unarchived from the XML source (a File, String path, InputStream, URL, byte[], etc.).
- 
fromXMLReturns an object unarchived from the given element.
- 
fromXMLReturns an object unarchived from the given element by instanciating the given class.
- 
newInstanceReturns a new instance of an object given an element and suggested class (probably null).
- 
fromXMLCalls fromXML on given object.
- 
getReturns the named object unarchived from the given element.
- 
getReturns the named object unarchived from the given element (or, if missing, the given default value).
- 
getReturns the first object of the given class from the given element.
- 
getListReturns the list of objects with the given name unarchived from given element.
- 
getListReturns the list of objects with the given name unarchived from given element (or, if missing, given default).
- 
getListReturns the list of objects with the given name unarchived from given element instanciated from given class.
- 
getListReturns the list of objects of the given class unarchived from the given element.
- 
getParentReturns parent object that initiated unarchival for current object (valid inside that object's fromXML method).
- 
addParentAdds a parent to the parent list.
- 
replaceCalled when a fromXML method swaps another object in to replace the one unarchiving.
- 
getReferenceReturns a reference id for the given object (used in archival).
- 
getReferenceReturns a reference id for given object if in references list with option to add if absent (used in archival).
- 
getReferenceReturns an object for a given reference (used in unarchival).
- 
getResourcesReturns the list of optional resources associated with this archiver.
- 
getResourceReturns an individual resource associated with this archiver, by index.
- 
getResourceReturns an individual resource associated with this archiver, by name.
- 
addResourceAdds a byte array resource to this archiver (only if absent).
 
-