// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v1.0.6-b27-fcs // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2012.06.11 at 10:34:07 AM PDT // package com.sun.identity.saml2.jaxb.assertion.impl.runtime; import java.util.Iterator; import javax.xml.bind.ValidationEvent; import org.xml.sax.Attributes; import org.xml.sax.Locator; import org.xml.sax.SAXException; import com.sun.xml.bind.JAXBAssertionError; import com.sun.xml.bind.unmarshaller.Tracer; /** * 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. * * @optionalRuntime * * @author * Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com) */ public abstract class InterleaveDispatcher implements UnmarshallingEventHandler { /** Parent context. */ private final UnmarshallingContext parent; /** Branches of an interleave. */ protected final Site[] sites; /** Set to true while all the branches are joining. */ private boolean isJoining; /** Counts the depth of the element nesting. */ private int nestLevel = 0; /** When nestLevel>0, all the events shall be sent to this branch. */ private Site currentSite; protected InterleaveDispatcher( UnmarshallingContext context, int size ) { this.parent = context; sites = new Site[size]; for( int i=0; i0 ) return currentSite.getCurrentHandler().owner(); else throw new JAXBAssertionError(); } public void enterElement(String uri, String local, String qname, Attributes atts) throws SAXException { if( nestLevel++==0 ) { int idx = getBranchForElement(uri, local); if(idx==-1) { // unknown element. revert to parent. joinByEnterElement(null, uri, local, qname, atts); return; } currentSite = sites[idx]; } currentSite.getCurrentHandler().enterElement(uri, local, qname, atts); } private void joinByEnterElement( Site source, String uri, String local, String qname, Attributes atts ) throws SAXException { if(isJoining) return; // during a join, child branches send us tokens we sent them. ignore. isJoining = true; // send the token to all the other branches. // since they don't recognize this token, it should try to move // to the final state (or report an error) for( int i=0; i