Class XMLLoader

java.lang.Object
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 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 Details

    • XMLLoader

      public XMLLoader()
  • Method Details

    • saveObject

      public void saveObject(XMLControl control, Object obj)
      Empty method.
      Specified by:
      saveObject in interface XML.ObjectLoader
      Parameters:
      control - the control
      obj - the object
    • createObject

      public 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 Object loadObject(XMLControl control, 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