demo for SASAX - 1.5

jp.ne.dti.lares.foozy.sasax
Class PathDemo

java.lang.Object
  |
  +--jp.ne.dti.lares.foozy.sasax.AbstractElement
        |
        +--jp.ne.dti.lares.foozy.sasax.PathDemo
All Implemented Interfaces:
Element

public class PathDemo
extends AbstractElement

Demonstration how to use path extension of SASAX.

This class can parse all (well-formed) XML document, and print "path" on each "startElement".

This class reads XML document in from standard input at invocation of main(String[]).

Author:
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>(code/doc)

Constructor Summary
PathDemo(Element parent)
           
 
Method Summary
 boolean accepts(ParseContext context, java.lang.String uri, java.lang.String lName)
          Accept any elements.
 Element characters(ParseContext context, char[] chars, int offset, int length)
          Receive notification of character data.
 Element endElement(ParseContext context, java.lang.String uri, java.lang.String lName)
           
static void main(java.lang.String[] args)
          Invoke demonstration.
 Element processingInstruction(ParseContext context, java.lang.String target, java.lang.String data)
          Receive notification of ignorable whitespace in element content.
 Element skippedEntity(ParseContext context, java.lang.String name)
          Receive notification of a processing instruction.
 Element startElement(ParseContext context, java.lang.String uri, java.lang.String lName, org.xml.sax.Attributes attrs)
           
 
Methods inherited from class jp.ne.dti.lares.foozy.sasax.AbstractElement
addCleanup, addNotification, clear, ensureDetermined, fireElementStarted, getAttribute, getParent, hasNotification, hasXSINil, ignorableWhitespace, isDetermined, notifyDetermined, notifyDetermined, removeNotification, setDetermined, unwatchAttribute, watchAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PathDemo

public PathDemo(Element parent)
Method Detail

accepts

public boolean accepts(ParseContext context,
                       java.lang.String uri,
                       java.lang.String lName)
Accept any elements.
Overrides:
accepts in class AbstractElement

startElement

public Element startElement(ParseContext context,
                            java.lang.String uri,
                            java.lang.String lName,
                            org.xml.sax.Attributes attrs)
                     throws org.xml.sax.SAXException
Overrides:
startElement in class AbstractElement

endElement

public Element endElement(ParseContext context,
                          java.lang.String uri,
                          java.lang.String lName)
                   throws org.xml.sax.SAXException
Overrides:
endElement in class AbstractElement

characters

public Element characters(ParseContext context,
                          char[] chars,
                          int offset,
                          int length)
                   throws org.xml.sax.SAXException
Receive notification of character data.

This prevents base class from throwing SAXException.

Overrides:
characters in class AbstractElement

processingInstruction

public Element processingInstruction(ParseContext context,
                                     java.lang.String target,
                                     java.lang.String data)
                              throws org.xml.sax.SAXException
Receive notification of ignorable whitespace in element content.

This prevents base class from throwing SAXException.

Overrides:
processingInstruction in class AbstractElement

skippedEntity

public Element skippedEntity(ParseContext context,
                             java.lang.String name)
                      throws org.xml.sax.SAXException
Receive notification of a processing instruction.

This prevents base class from throwing SAXException.

Overrides:
skippedEntity in class AbstractElement

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Invoke demonstration.

demo for SASAX - 1.5