edu.mit.jverbnet.parse
Class SelRestrictionsHandler<T extends IVerbnetType>

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by edu.mit.jverbnet.util.parse.MappedHandler<ISelRestrictions<T>>
          extended by edu.mit.jverbnet.parse.SelRestrictionsHandler<T>
All Implemented Interfaces:
IHasParserHandler, ITaggedBlockTaskHandler, ITaggedHandler<ISelRestrictions<T>>, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class SelRestrictionsHandler<T extends IVerbnetType>
extends MappedHandler<ISelRestrictions<T>>

Handles Verbnet XML blocks tagged with "SELRESTRS" or "SYNRESTRS".

Since:
JVerbnet 1.0.0
Version:
1.2.0
Author:
Mark A. Finlayson

Field Summary
static java.lang.String XML_TAG_SELRESTRS
           
static java.lang.String XML_TAG_SYNRESTRS
           
 
Fields inherited from class edu.mit.jverbnet.util.parse.MappedHandler
messageIgnoringElementBlockExternal, messageMatcherIgnoreExternal, messageMatcherIgnoreInternal, messageParserNotSet, messageUnmappedElementBlockInternal, tagStack
 
Constructor Summary
SelRestrictionsHandler(boolean isSelRestr, java.lang.Class<T> verbnetTypeClass)
          Creates a new SelRestrictionsHandler with no parent or parser.
SelRestrictionsHandler(IHasParserHandler parent, boolean isSelRestr, java.lang.Class<T> verbnetTypeClass)
          Creates a new SelRestrictionsHandler with the specified parent.
SelRestrictionsHandler(org.xml.sax.XMLReader parser, boolean isSelRestr, java.lang.Class<T> verbnetTypeClass)
          Creates a new SelRestrictionsHandler with the specified parser.
SelRestrictionsHandler(org.xml.sax.XMLReader parser, org.xml.sax.ContentHandler parent, boolean isSelRestr, java.lang.Class<T> verbnetTypeClass)
          Creates a new SelRestrictionsHandler with the specified parser and parent.
 
Method Summary
protected  void clearLocal()
          Subclasses may override this method to add code to be invoked when MappedHandler.clear() is called.
 ISelRestrictions<T> doGetElement()
          If subclasses intend to use the MappedHandler.getElement() method, they should override this method to provide the code that constructs the object corresponding to the tagged block.
protected  void initHandlerMap(java.util.Map<java.lang.String,org.xml.sax.ContentHandler> map)
          Adds handlers to the element map.
 void startTaggedBlock(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attrs)
          This method is used to run code when entering a tagged block.
 
Methods inherited from class edu.mit.jverbnet.util.parse.MappedHandler
checkParserSet, clear, endElement, endTaggedBlock, getDocumentLocator, getElement, getHandlerMappings, getParent, getParser, getTag, getTaggedBlockTasks, handleUnmappedEndElement, handleUnmappedStartElement, isInsideTaggedBlock, reportWarning, reportWarnings, setDocumentLocator, setParent, setParser, setReportWarnings, startElement
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xml.sax.ContentHandler
characters, endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, skippedEntity, startDocument, startPrefixMapping
 

Field Detail

XML_TAG_SELRESTRS

public static final java.lang.String XML_TAG_SELRESTRS
See Also:
Constant Field Values

XML_TAG_SYNRESTRS

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

SelRestrictionsHandler

public SelRestrictionsHandler(boolean isSelRestr,
                              java.lang.Class<T> verbnetTypeClass)
Creates a new SelRestrictionsHandler with no parent or parser.

Parameters:
isSelRestr - whether this is a semantic restriction (true) or syntactic restriction (false).
verbnetTypeClass - the verbnet type used in this restriction
Since:
JVerbnet 1.0.0

SelRestrictionsHandler

public SelRestrictionsHandler(IHasParserHandler parent,
                              boolean isSelRestr,
                              java.lang.Class<T> verbnetTypeClass)
Creates a new SelRestrictionsHandler with the specified parent.

Parameters:
parent - the parent of the handler; may be null
isSelRestr - whether this is a semantic restriction (true) or syntactic restriction (false).
verbnetTypeClass - the verbnet type used in this restriction
Since:
JVerbnet 1.0.0

SelRestrictionsHandler

public SelRestrictionsHandler(org.xml.sax.XMLReader parser,
                              boolean isSelRestr,
                              java.lang.Class<T> verbnetTypeClass)
Creates a new SelRestrictionsHandler with the specified parser.

Parameters:
parser - the parser of the handler; may be null
isSelRestr - whether this is a semantic restriction (true) or syntactic restriction (false).
verbnetTypeClass - the verbnet type used in this restriction
Since:
JVerbnet 1.0.0

SelRestrictionsHandler

public SelRestrictionsHandler(org.xml.sax.XMLReader parser,
                              org.xml.sax.ContentHandler parent,
                              boolean isSelRestr,
                              java.lang.Class<T> verbnetTypeClass)
Creates a new SelRestrictionsHandler with the specified parser and parent.

Parameters:
parser - the parent of the handler; may be null
parent - the parser of the handler; may be null
isSelRestr - whether this is a semantic restriction (true) or syntactic restriction (false).
verbnetTypeClass - the verbnet type used in this restriction
Since:
JVerbnet 1.0.0
Method Detail

initHandlerMap

protected void initHandlerMap(java.util.Map<java.lang.String,org.xml.sax.ContentHandler> map)
Description copied from class: MappedHandler
Adds handlers to the element map. Subclasses may override this to provide handlers for different tags.

Overrides:
initHandlerMap in class MappedHandler<ISelRestrictions<T extends IVerbnetType>>
Parameters:
map - the map to which handlers should be added

clearLocal

protected void clearLocal()
Description copied from class: MappedHandler
Subclasses may override this method to add code to be invoked when MappedHandler.clear() is called.

Overrides:
clearLocal in class MappedHandler<ISelRestrictions<T extends IVerbnetType>>

startTaggedBlock

public void startTaggedBlock(java.lang.String uri,
                             java.lang.String localName,
                             java.lang.String qName,
                             org.xml.sax.Attributes attrs)
                      throws org.xml.sax.SAXException
Description copied from interface: ITaggedBlockTaskHandler
This method is used to run code when entering a tagged block.

Specified by:
startTaggedBlock in interface ITaggedBlockTaskHandler
Overrides:
startTaggedBlock in class MappedHandler<ISelRestrictions<T extends IVerbnetType>>
Parameters:
uri - the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed
localName - 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
attrs - the attributes attached to the element. If there are no attributes, it shall be an empty Attributes object. The value of this object after startElement returns is undefined
Throws:
org.xml.sax.SAXException - any SAX exception, possibly wrapping another exception

doGetElement

public ISelRestrictions<T> doGetElement()
Description copied from class: MappedHandler
If subclasses intend to use the MappedHandler.getElement() method, they should override this method to provide the code that constructs the object corresponding to the tagged block.

Overrides:
doGetElement in class MappedHandler<ISelRestrictions<T extends IVerbnetType>>
Returns:
the object corresponding to the tagged block


Copyright © 2012 ${project.organization.name}. All Rights Reserved.