org.opensourcephysics.controls
Class XMLLoader

java.lang.Object
  extended by org.opensourcephysics.controls.XMLLoader
All Implemented Interfaces:
XML.ObjectLoader
Direct Known Subclasses:
ArrowLoader, CircleLoader, DataColumn.Loader, DataFunction.Loader, Dataset.Loader, DrawableShapeLoader, DrawableTextLine.DrawableTextLineLoader, GeneralPathLoader, Histogram.HistogramLoader, InteractiveArrow.InteractiveArrowLoader, InteractiveCenteredArrow.InteractiveCenteredArrowLoader, InteractiveShape.InteractiveShapeLoader, InteractiveTextLine.InteractiveTextLineLoader, Matrix2DTransformation.Matrix2DTransformationLoader, Matrix3DTransformation.Affine3DTransformationLoader, Plot2DLoader, Quaternion.QuaternionLoader, Resolution.ResolutionLoader, Style.Loader, UserFunction.Loader, VisualizationHints.Loader

public class XMLLoader
extends java.lang.Object
implements XML.ObjectLoader

This is an ObjectLoader implementation that attempts to create a new object of class element.getObjectClass() but takes no other action. It is used as the default loader and can be extended for use by particular classes.

Version:
1.0
Author:
Douglas Brown

Constructor Summary
XMLLoader()
           
 
Method Summary
 java.lang.Object createObject(XMLControl control)
          Creates a new object if the class type has a no-arg constructor.
 java.lang.Object loadObject(XMLControl control, java.lang.Object obj)
          Loads the object with xml data.
 void saveObject(XMLControl control, java.lang.Object obj)
          Empty method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLLoader

public XMLLoader()
Method Detail

saveObject

public void saveObject(XMLControl control,
                       java.lang.Object obj)
Empty method.

Specified by:
saveObject in interface XML.ObjectLoader
Parameters:
control - the control
obj - the object

createObject

public java.lang.Object createObject(XMLControl control)
Creates a new object if the class type has a no-arg constructor.

Specified by:
createObject in interface XML.ObjectLoader
Parameters:
control - the control
Returns:
the new object

loadObject

public java.lang.Object loadObject(XMLControl control,
                                   java.lang.Object obj)
Loads the object with xml data. Calculations and Animations should reinitialize after they are loaded.

Specified by:
loadObject in interface XML.ObjectLoader
Parameters:
control - the control
obj - the object
Returns:
the loaded object