edu.isi.pegasus.planner.parser

## Class SiteCatalogXMLMetadataParser

- java.lang.Object
- - org.xml.sax.helpers.DefaultHandler
  - - edu.isi.pegasus.planner.parser.Parser
    - - edu.isi.pegasus.planner.parser.SiteCatalogXMLMetadataParser

All Implemented Interfaces:
  org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

    class SiteCatalogXMLMetadataParser
    extends Parser

A lightweight XML Parser class to just retrieve the meta data in first instance of an element in a XML Document. It used to get the metadata in the root element.

Author:
  Karan Vahi

### Nested Class Summary

Nested Classes
`private static class` `SiteCatalogXMLMetadataParser.StopParserException` Private RuntimeException to stop the SAX Parser

### Field Summary

Fields
`private java.lang.String` `mElement` The root element name to look for.
`private java.util.Map<java.lang.String,java.lang.String>` `mMetadata` The Metadata object that has to be returned.
`protected boolean` `mParsingDone` A boolean indicating that parsing is done.

### Fields inherited from class edu.isi.pegasus.planner.parser.Parser

`DEFAULT_PARSER_NAME, mAdjFName, mLocator, mLogger, mLogMsg, mParser, mProps, mTextContent, mTextString`

### Constructor Summary

Constructors
Constructor and Description
`SiteCatalogXMLMetadataParser(PegasusBag bag, java.lang.String element)` The overloaded constructor

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `endDocument()` Sets the boolean indicating parsing is done
`void` `endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)` An empty implementation
`java.util.Map<java.lang.String,java.lang.String>` `getMetadata()` Returns the metadata/attributes assoicated with the element that was parsed for.
`java.lang.String` `getSchemaLocation()` Not implemented as yet
`java.lang.String` `getSchemaNamespace()` Not implemented as yet
`void` `startElement(java.lang.String uri, java.lang.String local, java.lang.String raw, org.xml.sax.Attributes attrs)` Start Element.
`void` `startParser(java.lang.String file)` The function that starts the parser

### Methods inherited from class edu.isi.pegasus.planner.parser.Parser

`characters, ignoreWhitespace, ignoreWhitespace, setDocumentLocator, setParserFeature, setSchemaLocations, testForFile`

### Methods inherited from class org.xml.sax.helpers.DefaultHandler

`endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### mElement

    private java.lang.String mElement

The root element name to look for.

#### mMetadata

    private java.util.Map<java.lang.String,java.lang.String> mMetadata

The Metadata object that has to be returned.

#### mParsingDone

    protected boolean mParsingDone

A boolean indicating that parsing is done.

### Constructor Detail

#### SiteCatalogXMLMetadataParser

    public SiteCatalogXMLMetadataParser(PegasusBag bag,
                                        java.lang.String element)

The overloaded constructor

Parameters:
  `bag` - the bag of intiialization documents
  `element` - the root element

### Method Detail

#### getMetadata

    public java.util.Map<java.lang.String,java.lang.String> getMetadata()

Returns the metadata/attributes assoicated with the element that was parsed for.

Returns:

#### startElement

    public void startElement(java.lang.String uri,
                             java.lang.String local,
                             java.lang.String raw,
                             org.xml.sax.Attributes attrs)
                      throws org.xml.sax.SAXException

Start Element.

Specified by:
  `startElement` in interface `org.xml.sax.ContentHandler`
Specified by:
  `startElement` in class `Parser`
Parameters:
  `uri` -
  `local` -
  `raw` -
  `attrs` -
Throws:
  `org.xml.sax.SAXException`

#### endElement

    public void endElement(java.lang.String uri,
                           java.lang.String localName,
                           java.lang.String qName)
                    throws org.xml.sax.SAXException

An empty implementation

Specified by:
  `endElement` in interface `org.xml.sax.ContentHandler`
Specified by:
  `endElement` in class `Parser`
Parameters:
  `uri` -
  `localName` -
  `qName` -
Throws:
  `org.xml.sax.SAXException`

#### endDocument

    public void endDocument()

Sets the boolean indicating parsing is done

Specified by:
  `endDocument` in interface `org.xml.sax.ContentHandler`
Specified by:
  `endDocument` in class `Parser`

#### startParser

    public void startParser(java.lang.String file)

The function that starts the parser

Specified by:
  `startParser` in class `Parser`
Parameters:
  `file` - the file to be parsed

#### getSchemaLocation

    public java.lang.String getSchemaLocation()

Not implemented as yet

Specified by:
  `getSchemaLocation` in class `Parser`
Returns:

#### getSchemaNamespace

    public java.lang.String getSchemaNamespace()

Not implemented as yet

Specified by:
  `getSchemaNamespace` in class `Parser`
Returns: