faa.tg.scenario.importer
Class XmlRouteImporter

java.lang.Object
  extended by faa.tg.scenario.importer.XmlDomImporter
      extended by faa.tg.scenario.importer.ImporterBase<T>
          extended by faa.tg.scenario.importer.XmlRouteImporterBase<Route>
              extended by faa.tg.scenario.importer.XmlRouteImporter
All Implemented Interfaces:
Importer<Route>, org.xml.sax.ErrorHandler

public class XmlRouteImporter
extends XmlRouteImporterBase<Route>
implements Importer<Route>

 XmlRouteImporter reads Route data from an XML file.
 
See the source: XmlRouteImporter.java

Version:
$Id: XmlRouteImporter.java,v 3.16 2009/01/17 19:46:33 danaw Exp $, $Id: XmlRouteImporter.java,v 3.16 2009/01/17 19:46:33 danaw Exp $
Author:
Michael E. Ross, Dan Warburton, FAA/ACB-860
See Also:
XmlDomImporter, Importer

Nested Class Summary
 
Nested classes/interfaces inherited from class faa.tg.scenario.importer.XmlRouteImporterBase
XmlRouteImporterBase.RouteExtender
 
Field Summary
static java.lang.String CVS_VERSION_ID
          The CVS Version ID
 
Fields inherited from class faa.tg.scenario.importer.XmlRouteImporterBase
airspace
 
Fields inherited from class faa.tg.scenario.importer.ImporterBase
list
 
Fields inherited from class faa.tg.scenario.importer.XmlDomImporter
jdoc
 
Constructor Summary
XmlRouteImporter(Airspace airspace)
           
XmlRouteImporter(java.util.Properties scenProp)
          Import Routes based on the pointer in Scenario Properties, the constructor creates an enumeration of Route objects.
XmlRouteImporter(java.lang.String url)
          Import routes based on a string URL.
 
Method Summary
 java.util.Iterator<Route> importObjects(org.w3c.dom.Element rootRouteElement)
          This method creates a list of all routes found in a given file.
static void main(java.lang.String[] args)
          For testing purposes only.
 void parse(java.util.Properties scenProp)
           
 
Methods inherited from class faa.tg.scenario.importer.XmlRouteImporterBase
importAltitudeRestriction, importRoute, importRouteNode, importRouteNoValidCheck
 
Methods inherited from class faa.tg.scenario.importer.ImporterBase
getNext, importObjects, importObjects, parse, parse, parse, size
 
Methods inherited from class faa.tg.scenario.importer.XmlDomImporter
error, fatalError, getBoolean, getElementNamed, getText, getXmlDocument, getXmlDocument, getXmlDocument, getXmlDocument, getXmlDocumentUsingSchema, makeSimpleElement, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface faa.tg.scenario.importer.Importer
getNext
 

Field Detail

CVS_VERSION_ID

public static final java.lang.String CVS_VERSION_ID
The CVS Version ID

See Also:
Constant Field Values
Constructor Detail

XmlRouteImporter

public XmlRouteImporter(java.util.Properties scenProp)
                 throws java.net.MalformedURLException,
                        XmlUrlException
Import Routes based on the pointer in Scenario Properties, the constructor creates an enumeration of Route objects. Then getNext() is called for each Route to add it to the scenario. Out-of-Memory problems can occur, since the Dom Document used is an in- memory structure.

Parameters:
scenProp - A pointer in the scenario properties file that points to an xml file.
Throws:
java.net.MalformedURLException - URL was malformed.
XmlUrlException - Was unable to find file or its dtd/schema.

XmlRouteImporter

public XmlRouteImporter(Airspace airspace)

XmlRouteImporter

public XmlRouteImporter(java.lang.String url)
                 throws java.net.MalformedURLException,
                        XmlUrlException
Import routes based on a string URL. Seems to be used by the main only.

Parameters:
url - The URL of an xml file as a string.
Throws:
java.net.MalformedURLException - - Thrown when a malformed URL occurres.
XmlUrlException - is unable to find file or its dtd/schema
Method Detail

parse

public void parse(java.util.Properties scenProp)
           throws java.net.MalformedURLException,
                  XmlUrlException
Throws:
java.net.MalformedURLException
XmlUrlException

importObjects

public java.util.Iterator<Route> importObjects(org.w3c.dom.Element rootRouteElement)
This method creates a list of all routes found in a given file.

Specified by:
importObjects in class ImporterBase<Route>
Parameters:
rootRouteElement - Element to look for routes in, or null.
Returns:
A route iterator containing the routes found, or a blank list.

main

public static void main(java.lang.String[] args)
For testing purposes only.

Parameters:
args - Description of the Parameter