| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
package net.sf.saxon.event; |
| 10 |
|
| 11 |
import net.sf.saxon.expr.parser.Location; |
| 12 |
import net.sf.saxon.om.Item; |
| 13 |
import net.sf.saxon.om.NamespaceBindingSet; |
| 14 |
import net.sf.saxon.om.NodeName; |
| 15 |
import net.sf.saxon.trans.XPathException; |
| 16 |
import net.sf.saxon.type.SchemaType; |
| 17 |
import net.sf.saxon.type.SimpleType; |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
public class EventMonitor extends ProxyReceiver { |
| 27 |
|
| 28 |
boolean written = false; |
| 29 |
|
| 30 |
public EventMonitor(Receiver next){ |
| 31 |
super(next); |
| 32 |
} |
| 33 |
|
| 34 |
@Override |
| 35 |
public void startElement(NodeName elemName, SchemaType typeCode, Location location, int properties) throws XPathException { |
| 36 |
written = true; |
| 37 |
super.startElement(elemName, typeCode, location, properties); |
| 38 |
} |
| 39 |
|
| 40 |
@Override |
| 41 |
public void namespace(NamespaceBindingSet namespaceBindings, int properties) throws XPathException { |
| 42 |
written = true; |
| 43 |
super.namespace(namespaceBindings, properties); |
| 44 |
} |
| 45 |
|
| 46 |
@Override |
| 47 |
public void attribute(NodeName attName, SimpleType typeCode, CharSequence value, Location location, int properties) throws XPathException { |
| 48 |
written = true; |
| 49 |
super.attribute(attName, typeCode, value, location, properties); |
| 50 |
} |
| 51 |
|
| 52 |
@Override |
| 53 |
public void characters(CharSequence chars, Location location, int properties) throws XPathException { |
| 54 |
written = true; |
| 55 |
super.characters(chars, location, properties); |
| 56 |
} |
| 57 |
|
| 58 |
@Override |
| 59 |
public void processingInstruction(String name, CharSequence data, Location location, int properties) throws XPathException { |
| 60 |
written = true; |
| 61 |
super.processingInstruction(name, data, location, properties); |
| 62 |
} |
| 63 |
|
| 64 |
@Override |
| 65 |
public void comment(CharSequence content, Location location, int properties) throws XPathException { |
| 66 |
written = true; |
| 67 |
super.comment(content, location, properties); |
| 68 |
} |
| 69 |
|
| 70 |
@Override |
| 71 |
public void append(Item item, Location location, int properties) throws XPathException { |
| 72 |
written = true; |
| 73 |
super.append(item, location, properties); |
| 74 |
} |
| 75 |
|
| 76 |
public boolean hasBeenWrittenTo() { |
| 77 |
return written; |
| 78 |
} |
| 79 |
} |
| 80 |
|