Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.biojava.utils.stax
Class LongElementHandlerBase

    java.lang.Object
      org.biojava.utils.stax.StAXContentHandlerBase
          org.biojava.utils.stax.LongElementHandlerBase

All Implemented Interfaces:
  StAXContentHandler

    public abstract class LongElementHandlerBase

extends StAXContentHandlerBase

StAX handler for any element which just contains a string representation of a long.

This calss collects the string data, and when it is complete, passes it to the (abstract) setLongValue method. Typical use of this class is as a base for a small (often anonymous) class which takes the long value and stores it in some variable.

Since:
  1.2
Author:
  Matthew Pocock, Greg Cox

Constructor Summary
`LongElementHandlerBase()`

Method Summary
`void` | `characters(char[] ch, int start, int end)` Signal a span of character data in the XML input.
`void` | `endElement(String nsURI, String localName, String qName, StAXContentHandler handler)`
`protected abstract void` | `setLongValue(long val)` Override this method to do something useful with the long we collect.
`void` | `startElement(String nsURI, String localName, String qName, Attributes attrs, DelegationManager dm)`

Methods inherited from class org.biojava.utils.stax.StAXContentHandlerBase
`endPrefixMapping, endTree, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startPrefixMapping, startTree`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### LongElementHandlerBase

    public LongElementHandlerBase()

Method Detail

### startElement

    public void startElement(String nsURI,
                             String localName,
                             String qName,
                             Attributes attrs,
                             DelegationManager dm)
                      throws SAXException

  Specified by:
    `startElement` in interface `StAXContentHandler`
  Overrides:
    `startElement` in class `StAXContentHandlerBase`
  Throws:
    `SAXException`

### endElement

    public void endElement(String nsURI,
                           String localName,
                           String qName,
                           StAXContentHandler handler)
                    throws SAXException

  Specified by:
    `endElement` in interface `StAXContentHandler`
  Overrides:
    `endElement` in class `StAXContentHandlerBase`
  Throws:
    `SAXException`

### characters

    public void characters(char[] ch,
                           int start,
                           int end)
                    throws SAXException

  Description copied from class: `StAXContentHandlerBase`
  Signal a span of character data in the XML input.

  Specified by:
    `characters` in interface `StAXContentHandler`
  Overrides:
    `characters` in class `StAXContentHandlerBase`
  Parameters:
    `ch` - an array of characters
    `start` - index of the first significant character for this event.
    `end` - number of characters significant to this event.
  Throws:
    `SAXException`

### setLongValue

    protected abstract void setLongValue(long val)
                                  throws SAXException

  Override this method to do something useful with the long we collect.

  This method will be invoked by endElement with the fully parsed long.

  Parameters:
    `val` - the fully parsed long
  Throws:
    `SAXException` - if for any reason the long is not palatable

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD