Top Description Fields Constructors Methods
com.sun.xml.xsom.impl.parser.state

public abstract Class NGCCInterleaveFilter

extends Object
implements NGCCEventSource, NGCCEventReceiver
Class Inheritance
All Implemented Interfaces
com.sun.xml.xsom.impl.parser.state.NGCCEventReceiver, com.sun.xml.xsom.impl.parser.state.NGCCEventSource
Imports
org.xml.sax.Attributes, .SAXException

Dispatches incoming events into sub handlers appropriately so that the interleaving semantics will be correctly realized.
Author
Kohsuke Kawaguchi ([email protected])

Field Summary

Modifier and TypeField and Description
private final int
_cookie

Cookie given by the parent.

private final NGCCHandler
_parent

Parent handler.

protected NGCCEventReceiver[]
_receivers

event receiverse.

private boolean
isJoining

Set to true when this handler is in the process of joining all branches.

private int
lockCount

Nest level.

private int
lockedReceiver

Receiver that is being locked and therefore receives all the events.

Constructor Summary

AccessConstructor and Description
protected
NGCCInterleaveFilter(NGCCHandler parent, int cookie)

Method Summary

Modifier and TypeMethod and Description
public void
public void
protected abstract int
findReceiverOfAttribute(String uri, String local)

Returns the handler that can receive the given attribute, or null.

protected abstract int

Returns:

Thread ID of the receiver that can handle this event, or -1 if none.
findReceiverOfElement
(String uri, String local)

Implemented by the generated code to determine the handler that can receive the given element.

protected abstract int
findReceiverOfText()

Returns the handler that can receive text events, or null.

public void
public void
joinByEnterElement(NGCCEventReceiver
If this method is called by one of the child receivers, the receiver object. If this method is called by itself, null.
source
,
String uri, String local, String qname, Attributes atts)

Joins all the child receivers.

public void
public void
public void
public void
public void
public int
replace(NGCCEventReceiver oldHandler, NGCCEventReceiver newHandler)

Implements com.sun.xml.xsom.impl.parser.state.NGCCEventSource.replace.

Replaces an old handler with a new handler, and returns ID of the EventReceiver thread.

public void
public void
sendEnterElement(int threadId, String uri, String local, String qname, Attributes atts)

Implements com.sun.xml.xsom.impl.parser.state.NGCCEventSource.sendEnterElement.

Sends an enter element event to the specified EventReceiver thread.

public void
public void
public void
protected void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_parentback to summary
private final NGCCHandler _parent

Parent handler.

_receiversback to summary
protected NGCCEventReceiver[] _receivers

event receiverse.

isJoiningback to summary
private boolean isJoining

Set to true when this handler is in the process of joining all branches.

lockCountback to summary
private int lockCount

Nest level. Lock will be release when the lockCount becomes 0.

lockedReceiverback to summary
private int lockedReceiver

Receiver that is being locked and therefore receives all the events.

<interleave>
  <element name="foo"/>
  <element name="bar">
    <element name="foo"/>
  </element>
</interlaeve>
When processing inside the bar element, this receiver is "locked" so that it can correctly receive its child foo element.

Constructor Detail

NGCCInterleaveFilterback to summary
protected NGCCInterleaveFilter(NGCCHandler parent, int cookie)

Method Detail

enterAttributeback to summary
public void enterAttribute(String uri, String localName, String qname) throws SAXException

Implements com.sun.xml.xsom.impl.parser.state.NGCCEventReceiver.enterAttribute.

enterElementback to summary
public void enterElement(String uri, String localName, String qname, Attributes atts) throws SAXException

Implements com.sun.xml.xsom.impl.parser.state.NGCCEventReceiver.enterElement.

findReceiverOfAttributeback to summary
protected abstract int findReceiverOfAttribute(String uri, String local)

Returns the handler that can receive the given attribute, or null.

findReceiverOfElementback to summary
protected abstract int findReceiverOfElement(String uri, String local)

Implemented by the generated code to determine the handler that can receive the given element.

Returns:int

Thread ID of the receiver that can handle this event, or -1 if none.

findReceiverOfTextback to summary
protected abstract int findReceiverOfText()

Returns the handler that can receive text events, or null.

joinByEnterAttributeback to summary
public void joinByEnterAttribute(NGCCEventReceiver source, String uri, String local, String qname) throws SAXException
joinByEnterElementback to summary
public void joinByEnterElement(NGCCEventReceiver source, String uri, String local, String qname, Attributes atts) throws SAXException

Joins all the child receivers.

This method is called by a child receiver when it sees something that it cannot handle, or by this object itself when it sees an event that it can't process.

This method forces children to move to its final state, then revert to the parent.

Parameters
source:NGCCEventReceiver

If this method is called by one of the child receivers, the receiver object. If this method is called by itself, null.

joinByLeaveAttributeback to summary
public void joinByLeaveAttribute(NGCCEventReceiver source, String uri, String local, String qname) throws SAXException
joinByLeaveElementback to summary
public void joinByLeaveElement(NGCCEventReceiver source, String uri, String local, String qname) throws SAXException
joinByTextback to summary
public void joinByText(NGCCEventReceiver source, String value) throws SAXException
leaveAttributeback to summary
public void leaveAttribute(String uri, String localName, String qname) throws SAXException

Implements com.sun.xml.xsom.impl.parser.state.NGCCEventReceiver.leaveAttribute.

leaveElementback to summary
public void leaveElement(String uri, String localName, String qname) throws SAXException

Implements com.sun.xml.xsom.impl.parser.state.NGCCEventReceiver.leaveElement.

replaceback to summary
public int replace(NGCCEventReceiver oldHandler, NGCCEventReceiver newHandler)

Implements com.sun.xml.xsom.impl.parser.state.NGCCEventSource.replace.

Doc from com.sun.xml.xsom.impl.parser.state.NGCCEventSource.replace.

Replaces an old handler with a new handler, and returns ID of the EventReceiver thread.

sendEnterAttributeback to summary
public void sendEnterAttribute(int threadId, String uri, String local, String qname) throws SAXException

Implements com.sun.xml.xsom.impl.parser.state.NGCCEventSource.sendEnterAttribute.

sendEnterElementback to summary
public void sendEnterElement(int threadId, String uri, String local, String qname, Attributes atts) throws SAXException

Implements com.sun.xml.xsom.impl.parser.state.NGCCEventSource.sendEnterElement.

Doc from com.sun.xml.xsom.impl.parser.state.NGCCEventSource.sendEnterElement.

Sends an enter element event to the specified EventReceiver thread.

sendLeaveAttributeback to summary
public void sendLeaveAttribute(int threadId, String uri, String local, String qname) throws SAXException

Implements com.sun.xml.xsom.impl.parser.state.NGCCEventSource.sendLeaveAttribute.

sendLeaveElementback to summary
public void sendLeaveElement(int threadId, String uri, String local, String qname) throws SAXException

Implements com.sun.xml.xsom.impl.parser.state.NGCCEventSource.sendLeaveElement.

sendTextback to summary
public void sendText(int threadId, String value) throws SAXException

Implements com.sun.xml.xsom.impl.parser.state.NGCCEventSource.sendText.

setHandlersback to summary
protected void setHandlers(NGCCEventReceiver[] receivers)
textback to summary
public void text(String value) throws SAXException

Implements com.sun.xml.xsom.impl.parser.state.NGCCEventReceiver.text.