Package org.opensourcephysics.controls
Class XMLJavaLoader
java.lang.Object
org.opensourcephysics.controls.XMLJavaLoader
- All Implemented Interfaces:
XML.ObjectLoader
This is an ObjectLoader implementation that uses the Java XMLEncoder and
XMLDecoder classes to save and load data.
- Version:
- 1.0
- Author:
- Douglas Brown
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateObject
(XMLControl control) Creates a new object if the class type has a no-arg constructor.loadObject
(XMLControl control, Object obj) Loads an object with data from an XMLControl.void
saveObject
(XMLControl control, Object obj) Saves XMLEncoder data for an object in the specified XMLControl.
-
Constructor Details
-
XMLJavaLoader
public XMLJavaLoader()Constructs the loader.
-
-
Method Details
-
saveObject
Saves XMLEncoder data for an object in the specified XMLControl.- Specified by:
saveObject
in interfaceXML.ObjectLoader
- Parameters:
control
- the controlobj
- the object
-
createObject
Creates a new object if the class type has a no-arg constructor.- Specified by:
createObject
in interfaceXML.ObjectLoader
- Parameters:
control
- the control- Returns:
- the new object
-
loadObject
Loads an object with data from an XMLControl.- Specified by:
loadObject
in interfaceXML.ObjectLoader
- Parameters:
control
- the controlobj
- the object- Returns:
- the loaded object
-