org.apache.felix.ipojo.xml.parser

## Class XMLMetadataParser

- java.lang.Object
- - org.apache.felix.ipojo.xml.parser.XMLMetadataParser

All Implemented Interfaces:
  ContentHandler, ErrorHandler

    public class XMLMetadataParser
    extends Object
    implements ContentHandler, ErrorHandler

XML Metadata parser.

Author:
  Felix Project Team

### Constructor Summary

Constructors
Constructor and Description
`XMLMetadataParser()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `characters(char[] ch, int start, int length)` Characters.
`void` `endDocument()` End the document.
`void` `endElement(String namespaceURI, String localName, String qName)` End of an element.
`void` `endPrefixMapping(String prefix)` End prefix mapping.
`void` `error(SAXParseException saxparseexception)` An error occurs during the XML-Schema checking.
`void` `fatalError(SAXParseException saxparseexception)` A fatal error occurs during the XML-Schema checking.
`org.apache.felix.ipojo.metadata.Element[]` `getMetadata()` Get parsed metadata.
`void` `ignorableWhitespace(char[] ch, int start, int length)` Ignore whitespace.
`void` `processingInstruction(String target, String data)` Process an instruction.
`void` `setDocumentLocator(Locator locator)` Set Document locator.
`void` `skippedEntity(String name)` Skipped entity.
`void` `startDocument()` Start a document.
`void` `startElement(String namespaceURI, String localName, String qName, Attributes atts)` Start an element.
`void` `startPrefixMapping(String prefix, String uri)` Start a prefix mapping.
`void` `warning(SAXParseException saxparseexception)` A warning was detected during the XML-Schema checking.

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

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

### Constructor Detail

#### XMLMetadataParser

    public XMLMetadataParser()

### Method Detail

#### getMetadata

    public org.apache.felix.ipojo.metadata.Element[] getMetadata()
                                                          throws ParseException

Get parsed metadata. The document must be parsed before calling this method.

Returns:
  : all the metadata.
Throws:
  `ParseException` - : occurs if an error occurs during the parsing.

#### characters

    public void characters(char[] ch,
                           int start,
                           int length)
                    throws SAXException

Characters.

Specified by:
  `characters` in interface `ContentHandler`
Parameters:
  `ch` - : character
  `start` - : start
  `length` - : length
Throws:
  `SAXException` - : can never occurs.
See Also:
  `ContentHandler.characters(char[], int, int)`

#### endDocument

    public void endDocument()
                     throws SAXException

End the document.

Specified by:
  `endDocument` in interface `ContentHandler`
Throws:
  `SAXException` - : can never occrus.
See Also:
  `ContentHandler.endDocument()`

#### endElement

    public void endElement(String namespaceURI,
                           String localName,
                           String qName)
                    throws SAXException

End of an element.

Specified by:
  `endElement` in interface `ContentHandler`
Parameters:
  `namespaceURI` - : element namespace
  `localName` - : local name
  `qName` - : qualified name
Throws:
  `SAXException` - : occurs when the element is malformed
See Also:
  `ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)`

#### endPrefixMapping

    public void endPrefixMapping(String prefix)
                          throws SAXException

End prefix mapping.

Specified by:
  `endPrefixMapping` in interface `ContentHandler`
Parameters:
  `prefix` - : ended prefix
Throws:
  `SAXException` - : can never occurs.
See Also:
  `ContentHandler.endPrefixMapping(java.lang.String)`

#### ignorableWhitespace

    public void ignorableWhitespace(char[] ch,
                                    int start,
                                    int length)
                             throws SAXException

Ignore whitespace.

Specified by:
  `ignorableWhitespace` in interface `ContentHandler`
Parameters:
  `ch` - : character
  `start` - : start
  `length` - : length
Throws:
  `SAXException` - : can never occurs.
See Also:
  `ContentHandler.ignorableWhitespace(char[], int, int)`

#### processingInstruction

    public void processingInstruction(String target,
                                      String data)
                               throws SAXException

Process an instruction.

Specified by:
  `processingInstruction` in interface `ContentHandler`
Parameters:
  `target` - : target
  `data` - : data
Throws:
  `SAXException` - : can never occurs.
See Also:
  `ContentHandler.processingInstruction(java.lang.String, java.lang.String)`

#### setDocumentLocator

    public void setDocumentLocator(Locator locator)

Set Document locator.

Specified by:
  `setDocumentLocator` in interface `ContentHandler`
Parameters:
  `locator` - : new locator.
See Also:
  `ContentHandler.setDocumentLocator(org.xml.sax.Locator)`

#### skippedEntity

    public void skippedEntity(String name)
                       throws SAXException

Skipped entity.

Specified by:
  `skippedEntity` in interface `ContentHandler`
Parameters:
  `name` - : name.
Throws:
  `SAXException` - : can never occurs.
See Also:
  `ContentHandler.skippedEntity(java.lang.String)`

#### startDocument

    public void startDocument()
                       throws SAXException

Start a document.

Specified by:
  `startDocument` in interface `ContentHandler`
Throws:
  `SAXException` - : can never occurs.
See Also:
  `ContentHandler.startDocument()`

#### startElement

    public void startElement(String namespaceURI,
                             String localName,
                             String qName,
                             Attributes atts)
                      throws SAXException

Start an element.

Specified by:
  `startElement` in interface `ContentHandler`
Parameters:
  `namespaceURI` - : element namespace.
  `localName` - : local element.
  `qName` - : qualified name.
  `atts` - : attribute
Throws:
  `SAXException` - : occurs if the element cannot be parsed correctly.
See Also:
  `ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)`

#### startPrefixMapping

    public void startPrefixMapping(String prefix,
                                   String uri)
                            throws SAXException

Start a prefix mapping.

Specified by:
  `startPrefixMapping` in interface `ContentHandler`
Parameters:
  `prefix` - : prefix.
  `uri` - : uri.
Throws:
  `SAXException` - : can never occurs.
See Also:
  `ContentHandler.startPrefixMapping(java.lang.String, java.lang.String)`

#### error

    public void error(SAXParseException saxparseexception)
               throws SAXException

An error occurs during the XML-Schema checking. This method propagates the error except if the error concerns no XML-Schemas are used (`cvc-elt.1`).

Specified by:
  `error` in interface `ErrorHandler`
Parameters:
  `saxparseexception` - the checking error
Throws:
  `SAXException` - the propagated exception
See Also:
  `ErrorHandler.error(org.xml.sax.SAXParseException)`

#### fatalError

    public void fatalError(SAXParseException saxparseexception)
                    throws SAXException

A fatal error occurs during the XML-Schema checking. This method always propagates the error.

Specified by:
  `fatalError` in interface `ErrorHandler`
Parameters:
  `saxparseexception` - the checking error
Throws:
  `SAXException` - the propagated exception
See Also:
  `ErrorHandler.fatalError(SAXParseException)`

#### warning

    public void warning(SAXParseException saxparseexception)
                 throws SAXException

A warning was detected during the XML-Schema checking. This method always propagate the warning message to `System.out`.

Specified by:
  `warning` in interface `ErrorHandler`
Parameters:
  `saxparseexception` - the checking error
Throws:
  `SAXException` - nothing.
See Also:
  `ErrorHandler.warning(SAXParseException)`