org.eclipse.core.runtime.internal.adaptor
Class PluginParser

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.eclipse.core.runtime.internal.adaptor.PluginParser
All Implemented Interfaces:
IModel, ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class PluginParser
extends DefaultHandler
implements IModel

Internal class.


Nested Class Summary
 class PluginParser.PluginInfo
           
 class PluginParser.Prerequisite
           
 
Field Summary
 
Fields inherited from interface org.eclipse.core.runtime.internal.adaptor.IModel
ELEMENT, ELEMENT_NAME, ELEMENT_VALUE, EXTENSION, EXTENSION_ID, EXTENSION_NAME, EXTENSION_POINT, EXTENSION_POINT_ID, EXTENSION_POINT_NAME, EXTENSION_POINT_SCHEMA, EXTENSION_TARGET, FALSE, FRAGMENT, FRAGMENT_ID, FRAGMENT_NAME, FRAGMENT_PLUGIN_ID, FRAGMENT_PLUGIN_MATCH, FRAGMENT_PLUGIN_MATCH_COMPATIBLE, FRAGMENT_PLUGIN_MATCH_EQUIVALENT, FRAGMENT_PLUGIN_MATCH_GREATER_OR_EQUAL, FRAGMENT_PLUGIN_MATCH_PERFECT, FRAGMENT_PLUGIN_VERSION, FRAGMENT_PROVIDER, FRAGMENT_VERSION, INDENT, LIBRARY, LIBRARY_EXPORT, LIBRARY_EXPORT_MASK, LIBRARY_NAME, LIBRARY_PACKAGES, LIBRARY_PACKAGES_PREFIXES, LIBRARY_SOURCE, LIBRARY_TYPE, PLUGIN, PLUGIN_CLASS, PLUGIN_ID, PLUGIN_KEY_VERSION_SEPARATOR, PLUGIN_NAME, PLUGIN_PROVIDER, PLUGIN_REQUIRES, PLUGIN_REQUIRES_EXPORT, PLUGIN_REQUIRES_IMPORT, PLUGIN_REQUIRES_MATCH, PLUGIN_REQUIRES_MATCH_COMPATIBLE, PLUGIN_REQUIRES_MATCH_EQUIVALENT, PLUGIN_REQUIRES_MATCH_EXACT, PLUGIN_REQUIRES_MATCH_GREATER_OR_EQUAL, PLUGIN_REQUIRES_MATCH_PERFECT, PLUGIN_REQUIRES_OPTIONAL, PLUGIN_REQUIRES_PLATFORM, PLUGIN_REQUIRES_PLUGIN, PLUGIN_REQUIRES_PLUGIN_VERSION, PLUGIN_VENDOR, PLUGIN_VERSION, PROPERTY, PROPERTY_NAME, PROPERTY_VALUE, RADIX, REGISTRY, REGISTRY_PATH, RUNTIME, TRUE
 
Constructor Summary
PluginParser(FrameworkAdaptor adaptor, BundleContext context, Version target)
           
 
Method Summary
static SAXParserFactory acquireXMLParsing(BundleContext context)
           
 void endDocument()
          Receive notification of the end of the document.
 void endElement(java.lang.String uri, java.lang.String elementName, java.lang.String qName)
          Receive notification of the end of an element.
 void error(SAXParseException ex)
          Receive notification of a recoverable parser error.
 void fatalError(SAXParseException ex)
          Report a fatal XML parsing error.
 void handleExtensionPointState(java.lang.String elementName, Attributes attributes)
           
 void handleExtensionState(java.lang.String elementName, Attributes attributes)
           
 void handleInitialState(java.lang.String elementName, Attributes attributes)
           
 void handleLibraryExportState(java.lang.String elementName, Attributes attributes)
           
 void handleLibraryState(java.lang.String elementName, Attributes attributes)
           
 void handlePluginState(java.lang.String elementName, Attributes attributes)
           
 void handleRequiresImportState(java.lang.String elementName, Attributes attributes)
           
 void handleRequiresState(java.lang.String elementName, Attributes attributes)
           
 void handleRuntimeState(java.lang.String elementName, Attributes attributes)
           
 void parseFragmentAttributes(Attributes attributes)
           
 void parseLibraryAttributes(Attributes attributes)
           
 PluginParser.PluginInfo parsePlugin(java.io.InputStream in)
           
 void parsePluginAttributes(Attributes attributes)
           
 void parsePluginRequiresImport(Attributes attributes)
           
 void parseRequiresAttributes(Attributes attributes)
           
 void processingInstruction(java.lang.String target, java.lang.String data)
          Receive notification of a processing instruction.
static void releaseXMLParsing()
           
 void setDocumentLocator(Locator locator)
          Receive a Locator object for document events.
 void startDocument()
          Receive notification of the beginning of the document.
 void startElement(java.lang.String uri, java.lang.String elementName, java.lang.String qName, Attributes attributes)
          Receive notification of the start of an element.
 void warning(SAXParseException ex)
          Receive notification of a parser warning.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endPrefixMapping, ignorableWhitespace, notationDecl, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginParser

public PluginParser(FrameworkAdaptor adaptor,
                    BundleContext context,
                    Version target)
Method Detail

setDocumentLocator

public void setDocumentLocator(Locator locator)
Receive a Locator object for document events.

By default, do nothing. Application writers may override this method in a subclass if they wish to store the locator for use with other document events.

Specified by:
setDocumentLocator in interface ContentHandler
Overrides:
setDocumentLocator in class DefaultHandler
Parameters:
locator - A locator for all SAX document events.
See Also:
ContentHandler.setDocumentLocator(org.xml.sax.Locator), Locator

endDocument

public void endDocument()
Description copied from class: DefaultHandler
Receive notification of the end of the document.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of a document (such as finalising a tree or closing an output file).

Specified by:
endDocument in interface ContentHandler
Overrides:
endDocument in class DefaultHandler
See Also:
ContentHandler.endDocument()

endElement

public void endElement(java.lang.String uri,
                       java.lang.String elementName,
                       java.lang.String qName)
Description copied from class: DefaultHandler
Receive notification of the end of an element.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of each element (such as finalising a tree node or writing output to a file).

Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class DefaultHandler
Parameters:
uri - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
elementName - The local name (without prefix), or the empty string if Namespace processing is not being performed.
qName - The qualified name (with prefix), or the empty string if qualified names are not available.
See Also:
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)

error

public void error(SAXParseException ex)
Description copied from class: DefaultHandler
Receive notification of a recoverable parser error.

The default implementation does nothing. Application writers may override this method in a subclass to take specific actions for each error, such as inserting the message in a log file or printing it to the console.

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

fatalError

public void fatalError(SAXParseException ex)
                throws SAXException
Description copied from class: DefaultHandler
Report a fatal XML parsing error.

The default implementation throws a SAXParseException. Application writers may override this method in a subclass if they need to take specific actions for each fatal error (such as collecting all of the errors into a single report): in any case, the application must stop all regular processing when this method is invoked, since the document is no longer reliable, and the parser may no longer report parsing events.

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

handleExtensionPointState

public void handleExtensionPointState(java.lang.String elementName,
                                      Attributes attributes)

handleExtensionState

public void handleExtensionState(java.lang.String elementName,
                                 Attributes attributes)

handleInitialState

public void handleInitialState(java.lang.String elementName,
                               Attributes attributes)

handleLibraryExportState

public void handleLibraryExportState(java.lang.String elementName,
                                     Attributes attributes)

handleLibraryState

public void handleLibraryState(java.lang.String elementName,
                               Attributes attributes)

handlePluginState

public void handlePluginState(java.lang.String elementName,
                              Attributes attributes)

handleRequiresImportState

public void handleRequiresImportState(java.lang.String elementName,
                                      Attributes attributes)

handleRequiresState

public void handleRequiresState(java.lang.String elementName,
                                Attributes attributes)

handleRuntimeState

public void handleRuntimeState(java.lang.String elementName,
                               Attributes attributes)

parsePlugin

public PluginParser.PluginInfo parsePlugin(java.io.InputStream in)
                                    throws java.lang.Exception
Throws:
java.lang.Exception

acquireXMLParsing

public static SAXParserFactory acquireXMLParsing(BundleContext context)

releaseXMLParsing

public static void releaseXMLParsing()

parseFragmentAttributes

public void parseFragmentAttributes(Attributes attributes)

parseLibraryAttributes

public void parseLibraryAttributes(Attributes attributes)

parsePluginAttributes

public void parsePluginAttributes(Attributes attributes)

parsePluginRequiresImport

public void parsePluginRequiresImport(Attributes attributes)

parseRequiresAttributes

public void parseRequiresAttributes(Attributes attributes)

startDocument

public void startDocument()
Description copied from class: DefaultHandler
Receive notification of the beginning of the document.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the beginning of a document (such as allocating the root node of a tree or creating an output file).

Specified by:
startDocument in interface ContentHandler
Overrides:
startDocument in class DefaultHandler
See Also:
ContentHandler.startDocument()

startElement

public void startElement(java.lang.String uri,
                         java.lang.String elementName,
                         java.lang.String qName,
                         Attributes attributes)
Description copied from class: DefaultHandler
Receive notification of the start of an element.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each element (such as allocating a new tree node or writing output to a file).

Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class DefaultHandler
Parameters:
uri - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
elementName - The local name (without prefix), or the empty string if Namespace processing is not being performed.
qName - The qualified name (with prefix), or the empty string if qualified names are not available.
attributes - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
See Also:
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)

warning

public void warning(SAXParseException ex)
Description copied from class: DefaultHandler
Receive notification of a parser warning.

The default implementation does nothing. Application writers may override this method in a subclass to take specific actions for each warning, such as inserting the message in a log file or printing it to the console.

Specified by:
warning in interface ErrorHandler
Overrides:
warning in class DefaultHandler
Parameters:
ex - The warning information encoded as an exception.
See Also:
ErrorHandler.warning(org.xml.sax.SAXParseException), SAXParseException

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws SAXException
Description copied from class: DefaultHandler
Receive notification of a processing instruction.

By default, do nothing. Application writers may override this method in a subclass to take specific actions for each processing instruction, such as setting status variables or invoking other methods.

Specified by:
processingInstruction in interface ContentHandler
Overrides:
processingInstruction in class DefaultHandler
Parameters:
target - The processing instruction target.
data - The processing instruction data, or null if none is supplied.
Throws:
SAXException - any SAX exception, possibly wrapping another exception
See Also:
ContentHandler.processingInstruction(java.lang.String, java.lang.String)