org.apache.maven.plugin
Class PluginScriptParser

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.apache.maven.plugin.PluginScriptParser
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

final class PluginScriptParser
extends org.xml.sax.helpers.DefaultHandler

Class to parse plugin XML scripts to find goals and tag libraries.

Author:
Brett Porter brett@apache.org

Constructor Summary
PluginScriptParser(PluginDefinitionHandler handler, JellyScriptHousing jellyScriptHousing)
          Constructor.
 
Method Summary
 void error(org.xml.sax.SAXParseException spe)
          Error callback.
 void fatalError(org.xml.sax.SAXParseException spe)
          Fatal error callback.
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String rawName, org.xml.sax.Attributes attributes)
          Handles opening elements of the xml file.
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
          We are looking for namespace declarations like the following: xmlns:doc="doc" Here we know that the given plugin.jelly script (or any jelly script used within Maven) has a dependency on the dyna tag lib named 'doc'.
 void warning(org.xml.sax.SAXParseException spe)
          Warning callback.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginScriptParser

PluginScriptParser(PluginDefinitionHandler handler,
                   JellyScriptHousing jellyScriptHousing)
Constructor.

Method Detail

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
We are looking for namespace declarations like the following: xmlns:doc="doc" Here we know that the given plugin.jelly script (or any jelly script used within Maven) has a dependency on the dyna tag lib named 'doc'. We need to make sure that this dyna tag lib is ready for use when the plugin.jelly script is run.

Specified by:
startPrefixMapping in interface org.xml.sax.ContentHandler
Overrides:
startPrefixMapping in class org.xml.sax.helpers.DefaultHandler
Parameters:
prefix - Prefix to be used in the jelly script.
uri - Uri of the dyna tag lib.
To Do:
check this works for multiple plugin versions

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String rawName,
                         org.xml.sax.Attributes attributes)
Handles opening elements of the xml file.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler

warning

public void warning(org.xml.sax.SAXParseException spe)
Warning callback.

Specified by:
warning in interface org.xml.sax.ErrorHandler
Overrides:
warning in class org.xml.sax.helpers.DefaultHandler
Parameters:
spe - The parse exception that caused the callback to be invoked.

error

public void error(org.xml.sax.SAXParseException spe)
Error callback.

Specified by:
error in interface org.xml.sax.ErrorHandler
Overrides:
error in class org.xml.sax.helpers.DefaultHandler
Parameters:
spe - The parse exception that caused the callback to be invoked.

fatalError

public void fatalError(org.xml.sax.SAXParseException spe)
Fatal error callback.

Specified by:
fatalError in interface org.xml.sax.ErrorHandler
Overrides:
fatalError in class org.xml.sax.helpers.DefaultHandler
Parameters:
spe - The parse exception that caused the callback to be invoked.


Copyright © 2001-2011 Apache Software Foundation. All Rights Reserved.