org.apache.hivemind.parse
Class DescriptorParser

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.apache.hivemind.parse.AbstractParser
          extended by org.apache.hivemind.parse.DescriptorParser
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public final class DescriptorParser
extends AbstractParser

Used to parse HiveMind module deployment descriptors.

TODO: The parser ignores element content except inside <contribution> and <invoke-factory> ... it probably should forbid non-whitespace content.

Author:
Howard Lewis Ship

Field Summary
static java.lang.String ID_PATTERN
          Format for configuration point ids, service point ids and schema ids.
static java.lang.String MODULE_ID_PATTERN
          Module ids are a sequence of simple ids seperated by periods.
static java.lang.String VERSION_PATTERN
           
 
Constructor Summary
DescriptorParser(ErrorHandler errorHandler)
           
 
Method Summary
 void begin(java.lang.String elementName, java.util.Map attributes)
          Invoked when an element's start tag is recognized.
 void end(java.lang.String elementName)
          Invoked when an element's close tag is recognized.
 ModuleDescriptor getModuleDescriptor()
           
 void initialize(Resource resource, ClassResolver resolver)
           
protected  void push(java.lang.String elementName, java.lang.Object object, int state)
          Enters a new state, pushing an object onto the stack.
 void reset()
           
 
Methods inherited from class org.apache.hivemind.parse.AbstractParser
characters, endElement, error, fatalError, getElementPath, getLocation, getResource, getState, initializeParser, peekContent, peekElementName, peekObject, pop, push, resetParser, setDocumentLocator, setState, startElement, unexpectedElement, updateObject, warning
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID_PATTERN

public static final java.lang.String ID_PATTERN
Format for configuration point ids, service point ids and schema ids. Consists of an optional leading underscore, followed by alphanumerics and underscores. Normal naming convention is to use a single CamelCase word, like a Java class name.

See Also:
Constant Field Values

MODULE_ID_PATTERN

public static final java.lang.String MODULE_ID_PATTERN
Module ids are a sequence of simple ids seperated by periods. In practice, they look like Java package names.

See Also:
Constant Field Values

VERSION_PATTERN

public static final java.lang.String VERSION_PATTERN
See Also:
Constant Field Values
Constructor Detail

DescriptorParser

public DescriptorParser(ErrorHandler errorHandler)
Method Detail

begin

public void begin(java.lang.String elementName,
                  java.util.Map attributes)
Description copied from class: AbstractParser
Invoked when an element's start tag is recognized. The element and attributes are provided to the subclass for further processing.

Specified by:
begin in class AbstractParser

push

protected void push(java.lang.String elementName,
                    java.lang.Object object,
                    int state)
Description copied from class: AbstractParser
Enters a new state, pushing an object onto the stack. Invokes AbstractParser.push(String, Object, int, boolean), and ignores character data within the element.

Overrides:
push in class AbstractParser
Parameters:
elementName - the element whose start tag was just parsed
object - the object created to represent the new object
state - the new state for the parse

end

public void end(java.lang.String elementName)
Description copied from class: AbstractParser
Invoked when an element's close tag is recognized. The element is provided. The content of the element (the unparsed whitespace within the element's tags) is available via AbstractParser.peekContent().

Specified by:
end in class AbstractParser

initialize

public void initialize(Resource resource,
                       ClassResolver resolver)
Since:
1.1

getModuleDescriptor

public ModuleDescriptor getModuleDescriptor()
Since:
1.1

reset

public void reset()
Since:
1.1