org.jscience.ml.om.util
Class SchemaLoader

java.lang.Object
  extended by org.jscience.ml.om.util.SchemaLoader

public class SchemaLoader
extends java.lang.Object

The SchemaLoader provides loading facilities to load (parse) a XML Schmea file.
You can see this as a Factory of the Schema Objects.

Since:
1.0

Constructor Summary
SchemaLoader()
           
 
Method Summary
 IEyepiece[] getEyepieces()
           
static IFinding getFindingFromXSIType(java.lang.String xsiType, org.w3c.dom.Node currentNode)
          Gets a IFinding object (e.g.
 IImager[] getImagers()
           
 IObservation[] getObservations()
           
 IObserver[] getObservers()
           
 IScope[] getScopes()
           
 ISession[] getSessions()
           
 ISite[] getSites()
           
static ITarget getTargetFromXSIType(java.lang.String xsiType, org.w3c.dom.Node currentNode, IObserver[] observers)
          Gets a ITarget object (e.g.
 ITarget[] getTargets()
           
 RootElement load(org.w3c.dom.Document doc)
          Loads/parses a XML Document
 RootElement load(java.io.File xmlFile, java.io.File schemaFile)
          Loads/parses a XML File
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaLoader

public SchemaLoader()
Method Detail

getTargetFromXSIType

public static ITarget getTargetFromXSIType(java.lang.String xsiType,
                                           org.w3c.dom.Node currentNode,
                                           IObserver[] observers)
                                    throws SchemaException
Gets a ITarget object (e.g. DeepSkyTarget??) from a given xsiType.

Parameters:
xsiType - The unique xsi:Type that identifies the object/element
currentNode - The XML Node that represents the object e.g. ...
observers - A array of Observers that are needed to instanciate a object of type Target
Returns:
A ITarget that represents the given node as Java object
Throws:
SchemaException - if the given node is not well formed according to the Schema specifications

getFindingFromXSIType

public static IFinding getFindingFromXSIType(java.lang.String xsiType,
                                             org.w3c.dom.Node currentNode)
                                      throws SchemaException
Gets a IFinding object (e.g. DeepSkyFinding) from a given xsiType.

Parameters:
xsiType - The unique xsi:Type that identifies the object/element
currentNode - The XML Node that represents the object e.g. ...
Returns:
A IFinding that represents the given node as Java object
Throws:
SchemaException - if the given node is not well formed according to the Schema specifications

getObservations

public IObservation[] getObservations()

getSessions

public ISession[] getSessions()

getTargets

public ITarget[] getTargets()

getObservers

public IObserver[] getObservers()

getSites

public ISite[] getSites()

getScopes

public IScope[] getScopes()

getEyepieces

public IEyepiece[] getEyepieces()

getImagers

public IImager[] getImagers()

load

public RootElement load(java.io.File xmlFile,
                        java.io.File schemaFile)
                 throws FGCAException,
                        SchemaException
Loads/parses a XML File

Parameters:
schemaFile - The XML SchemaFile which should be parsed
Throws:
FGCAException - if schema File cannot be accessed
SchemaException - if XML File is not valid

load

public RootElement load(org.w3c.dom.Document doc)
                 throws FGCAException,
                        SchemaException
Loads/parses a XML Document

Parameters:
doc - The XML Document which should be parsed
Throws:
FGCAException - if doc is NULL or empty
SchemaException - if XML File is not valid