net.sf.jour.rt.view.config.impl.runtime
Class InterleaveDispatcher

java.lang.Object
  extended bynet.sf.jour.rt.view.config.impl.runtime.InterleaveDispatcher
All Implemented Interfaces:
UnmarshallingEventHandler

public abstract class InterleaveDispatcher
extends java.lang.Object
implements UnmarshallingEventHandler

Splits the unmarshalling events to bracnhes to support XML Schema's <all> and RELAX NG's <interleave>

This class will be extended by the generated code.

Author:
Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)

Field Summary
protected  net.sf.jour.rt.view.config.impl.runtime.InterleaveDispatcher.Site[] sites
          Branches of an interleave.
 
Constructor Summary
protected InterleaveDispatcher(UnmarshallingContext context, int size)
           
 
Method Summary
 void enterAttribute(java.lang.String uri, java.lang.String local, java.lang.String qname)
           
 void enterElement(java.lang.String uri, java.lang.String local, java.lang.String qname, org.xml.sax.Attributes atts)
           
protected abstract  int getBranchForAttribute(java.lang.String uri, java.lang.String local)
          Returns the branch number that consumes the given attribute, or -1 if the name is not recognized.
protected abstract  int getBranchForElement(java.lang.String uri, java.lang.String local)
          Returns the branch number that consumes the given element, or -1 if the name is not recognized.
protected abstract  int getBranchForText()
          Returns the branch number that consumes the text events, or -1 if no branch is expected to consume it.
protected  void init(UnmarshallingEventHandler[] handlers)
           
 void leaveAttribute(java.lang.String uri, java.lang.String local, java.lang.String qname)
           
 void leaveChild(int nextState)
           
 void leaveElement(java.lang.String uri, java.lang.String local, java.lang.String qname)
           
 java.lang.Object owner()
          Returns the content-tree object for which this unmarshaller is working for.
 void text(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sites

protected final net.sf.jour.rt.view.config.impl.runtime.InterleaveDispatcher.Site[] sites
Branches of an interleave.

Constructor Detail

InterleaveDispatcher

protected InterleaveDispatcher(UnmarshallingContext context,
                               int size)
Method Detail

init

protected void init(UnmarshallingEventHandler[] handlers)

getBranchForElement

protected abstract int getBranchForElement(java.lang.String uri,
                                           java.lang.String local)
Returns the branch number that consumes the given element, or -1 if the name is not recognized.


getBranchForAttribute

protected abstract int getBranchForAttribute(java.lang.String uri,
                                             java.lang.String local)
Returns the branch number that consumes the given attribute, or -1 if the name is not recognized.


getBranchForText

protected abstract int getBranchForText()
Returns the branch number that consumes the text events, or -1 if no branch is expected to consume it.


owner

public java.lang.Object owner()
Description copied from interface: UnmarshallingEventHandler
Returns the content-tree object for which this unmarshaller is working for.

Specified by:
owner in interface UnmarshallingEventHandler

enterElement

public void enterElement(java.lang.String uri,
                         java.lang.String local,
                         java.lang.String qname,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
Specified by:
enterElement in interface UnmarshallingEventHandler
Throws:
org.xml.sax.SAXException

leaveElement

public void leaveElement(java.lang.String uri,
                         java.lang.String local,
                         java.lang.String qname)
                  throws org.xml.sax.SAXException
Specified by:
leaveElement in interface UnmarshallingEventHandler
Throws:
org.xml.sax.SAXException

text

public void text(java.lang.String s)
          throws org.xml.sax.SAXException
Specified by:
text in interface UnmarshallingEventHandler
Throws:
org.xml.sax.SAXException

enterAttribute

public void enterAttribute(java.lang.String uri,
                           java.lang.String local,
                           java.lang.String qname)
                    throws org.xml.sax.SAXException
Specified by:
enterAttribute in interface UnmarshallingEventHandler
Throws:
org.xml.sax.SAXException

leaveAttribute

public void leaveAttribute(java.lang.String uri,
                           java.lang.String local,
                           java.lang.String qname)
                    throws org.xml.sax.SAXException
Specified by:
leaveAttribute in interface UnmarshallingEventHandler
Throws:
org.xml.sax.SAXException

leaveChild

public void leaveChild(int nextState)
                throws org.xml.sax.SAXException
Specified by:
leaveChild in interface UnmarshallingEventHandler
Throws:
org.xml.sax.SAXException


Copyright © 2004 sourceforge. All Rights Reserved.