Eclipse Platform
2.1

org.eclipse.update.core.model
Class DefaultSiteParser

java.lang.Object
  |
  +--org.xml.sax.helpers.DefaultHandler
        |
        +--org.eclipse.update.core.model.DefaultSiteParser
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class DefaultSiteParser
extends DefaultHandler

Default site parser. Parses the site manifest file as defined by the platform. Defers to a model factory to create the actual concrete model objects. The update framework supplies two factory implementations:

Since:
2.0

Constructor Summary
DefaultSiteParser()
          Constructs a site parser.
 
Method Summary
 void characters(char[] ch, int start, int length)
          Handle character text
 void endElement(String uri, String localName, String qName)
          Handle end of element tags
 void error(SAXParseException ex)
          Handle errors
 void fatalError(SAXParseException ex)
          Handle fatal errors
 MultiStatus getStatus()
          Returns all status objects accumulated by the parser.
 void init(SiteModelFactory factory)
           
 SiteModel parse(InputStream in)
          Parses the specified input steam and constructs a site model.
 void startElement(String uri, String localName, String qName, Attributes attributes)
          Handle start of element tags
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSiteParser

public DefaultSiteParser()
Constructs a site parser.

Method Detail

init

public void init(SiteModelFactory factory)

parse

public SiteModel parse(InputStream in)
                throws SAXException,
                       IOException
Parses the specified input steam and constructs a site model. The input stream is not closed as part of this operation.

Parameters:
in - input stream
Returns:
site model
Throws:
SAXException
IOException
Since:
2.0

getStatus

public MultiStatus getStatus()
Returns all status objects accumulated by the parser.

Returns:
multi-status containing accumulated status, or null.
Since:
2.0

startElement

public void startElement(String uri,
                         String localName,
                         String qName,
                         Attributes attributes)
                  throws SAXException
Handle start of element tags

Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class DefaultHandler
Parameters:
attributes - The specified or defaulted attributes.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
Since:
2.0
See Also:
DefaultHandler.startElement(String, String, String, Attributes)

endElement

public void endElement(String uri,
                       String localName,
                       String qName)
Handle end of element tags

Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class DefaultHandler
Since:
2.0
See Also:
DefaultHandler.endElement(String, String, String)

characters

public void characters(char[] ch,
                       int start,
                       int length)
Handle character text

Specified by:
characters in interface ContentHandler
Overrides:
characters in class DefaultHandler
Parameters:
ch - The characters.
start - The start position in the character array.
length - The number of characters to use from the character array.
Since:
2.0
See Also:
DefaultHandler.characters(char[], int, int)

error

public void error(SAXParseException ex)
Handle errors

Specified by:
error in interface ErrorHandler
Overrides:
error in class DefaultHandler
Parameters:
ex - The warning information encoded as an exception.
Since:
2.0
See Also:
DefaultHandler.error(SAXParseException)

fatalError

public void fatalError(SAXParseException ex)
                throws SAXException
Handle fatal errors

Specified by:
fatalError in interface ErrorHandler
Overrides:
fatalError in class DefaultHandler
Parameters:
ex - The error information encoded as an exception.
Throws:
SAXException
SAXException - Any SAX exception, possibly wrapping another exception.
Since:
2.0
See Also:
DefaultHandler.fatalError(SAXParseException)

Eclipse Platform
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.