org.opensourcephysics.controls
Interface XML.ObjectLoader

All Known Implementing Classes:
ArrowLoader, Camera.Loader, CircleLoader, DrawableShapeLoader, DrawingFrame3D.Loader, DrawingPanel3D.Loader, Element.Loader, ElementArrow.Loader, ElementBox.Loader, ElementCircle.Loader, ElementCone.Loader, ElementCylinder.Loader, ElementEllipsoid.Loader, ElementImage.Loader, ElementObject.Loader, ElementPlane.ElementPlaneLoader, ElementPoints.ElementPointsLoader, ElementPolygon.ElementPolygonLoader, ElementSegment.Loader, ElementSpring.Loader, ElementSurface.Loader, ElementTessellation.Loader, ElementTetrahedron.Loader, ElementText.Loader, ElementTrail.Loader, GeneralPathLoader, Group.Loader, ImageCoordSystem.Loader, Launcher.LaunchSet, Plot2DLoader, Resolution.ResolutionLoader, Style.Loader, VisualizationHints.Loader, XMLJavaLoader, XMLLoader
Enclosing class:
XML

public static interface XML.ObjectLoader

This defines methods for moving xml data between an XMLControl and a corresponding Java object.

Version:
1.0
Author:
Douglas Brown

Method Summary
 java.lang.Object createObject(XMLControl control)
          Creates an object from data in an XMLControl.
 java.lang.Object loadObject(XMLControl control, java.lang.Object obj)
          Loads an object with data from an XMLControl.
 void saveObject(XMLControl control, java.lang.Object obj)
          Saves data from an object to an XMLControl.
 

Method Detail

saveObject

void saveObject(XMLControl control,
                java.lang.Object obj)
Saves data from an object to an XMLControl. The object must be castable to the class control.getObjectClass().

Parameters:
control - the xml control
obj - the object

createObject

java.lang.Object createObject(XMLControl control)
Creates an object from data in an XMLControl. The returned object must be castable to the class control.getObjectClass().

Parameters:
control - the xml control
Returns:
a new object

loadObject

java.lang.Object loadObject(XMLControl control,
                            java.lang.Object obj)
Loads an object with data from an XMLControl. The object must be castable to the class control.getObjectClass().

Parameters:
control - the xml control
obj - the object
Returns:
the loaded object