001: package net.sf.saxon.event;
002:
003: import net.sf.saxon.trans.XPathException;
004:
005: /**
006: * A Sink is an Receiver that discards all information passed to it
007: */
008:
009: public class Sink implements Receiver {
010: private PipelineConfiguration pipe;
011: private String systemId;
012:
013: public void setSystemId(String systemId) {
014: this .systemId = systemId;
015: }
016:
017: public String getSystemId() {
018: return systemId;
019: }
020:
021: /**
022: * Set the pipeline configuration
023: */
024:
025: public void setPipelineConfiguration(PipelineConfiguration pipe) {
026: this .pipe = pipe;
027: }
028:
029: /**
030: * Get the pipeline configuration
031: */
032:
033: public PipelineConfiguration getPipelineConfiguration() {
034: return pipe;
035: }
036:
037: /**
038: * Start of event stream
039: */
040:
041: public void open() throws XPathException {
042: }
043:
044: /**
045: * End of event stream
046: */
047:
048: public void close() throws XPathException {
049: }
050:
051: /**
052: * Start of a document node.
053: */
054:
055: public void startDocument(int properties) throws XPathException {
056: }
057:
058: /**
059: * Notify the end of a document node
060: */
061:
062: public void endDocument() throws XPathException {
063: }
064:
065: /**
066: * Notify the start of an element
067: *
068: * @param nameCode integer code identifying the name of the element within the name pool.
069: * @param typeCode integer code identifying the element's type within the name pool.
070: * @param properties for future use. Should be set to zero.
071: */
072:
073: public void startElement(int nameCode, int typeCode,
074: int locationId, int properties) throws XPathException {
075: }
076:
077: /**
078: * Notify a namespace. Namespaces are notified <b>after</b> the startElement event, and before
079: * any children for the element. The namespaces that are reported are only required
080: * to include those that are different from the parent element; however, duplicates may be reported.
081: * A namespace must not conflict with any namespaces already used for element or attribute names.
082: *
083: * @param namespaceCode an integer: the top half is a prefix code, the bottom half a URI code.
084: * These may be translated into an actual prefix and URI using the name pool. A prefix code of
085: * zero represents the empty prefix (that is, the default namespace). A URI code of zero represents
086: * a URI of "", that is, a namespace undeclaration.
087: * @throws java.lang.IllegalStateException:
088: * attempt to output a namespace when there is no open element
089: * start tag
090: */
091:
092: public void namespace(int namespaceCode, int properties)
093: throws XPathException {
094:
095: }
096:
097: /**
098: * Notify an attribute. Attributes are notified after the startElement event, and before any
099: * children. Namespaces and attributes may be intermingled.
100: *
101: * @param nameCode The name of the attribute, as held in the name pool
102: * @param typeCode The type of the attribute, as held in the name pool
103: * @param properties Bit significant value. The following bits are defined:
104: * <dd>DISABLE_ESCAPING</dd> <dt>Disable escaping for this attribute</dt>
105: * <dd>NO_SPECIAL_CHARACTERS</dd> <dt>Attribute value contains no special characters</dt>
106: * @throws java.lang.IllegalStateException:
107: * attempt to output an attribute when there is no open element
108: * start tag
109: */
110:
111: public void attribute(int nameCode, int typeCode,
112: CharSequence value, int locationId, int properties)
113: throws XPathException {
114: }
115:
116: /**
117: * Notify the start of the content, that is, the completion of all attributes and namespaces.
118: * Note that the initial receiver of output from XSLT instructions will not receive this event,
119: * it has to detect it itself. Note that this event is reported for every element even if it has
120: * no attributes, no namespaces, and no content.
121: */
122:
123: public void startContent() throws XPathException {
124: }
125:
126: /**
127: * End of element
128: */
129:
130: public void endElement() throws XPathException {
131: }
132:
133: /**
134: * Character data
135: */
136:
137: public void characters(CharSequence chars, int locationId,
138: int properties) throws XPathException {
139: }
140:
141: /**
142: * Processing Instruction
143: */
144:
145: public void processingInstruction(String target, CharSequence data,
146: int locationId, int properties) throws XPathException {
147: }
148:
149: /**
150: * Output a comment
151: */
152:
153: public void comment(CharSequence chars, int locationId,
154: int properties) throws XPathException {
155: }
156:
157: /**
158: * Set the URI for an unparsed entity in the document.
159: */
160:
161: public void setUnparsedEntity(String name, String uri,
162: String publicId) throws XPathException {
163: }
164:
165: }
166:
167: //
168: // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
169: // you may not use this file except in compliance with the License. You may obtain a copy of the
170: // License at http://www.mozilla.org/MPL/
171: //
172: // Software distributed under the License is distributed on an "AS IS" basis,
173: // WITHOUT WARRANTY OF ANY KIND, either express or implied.
174: // See the License for the specific language governing rights and limitations under the License.
175: //
176: // The Original Code is: all this file.
177: //
178: // The Initial Developer of the Original Code is Michael H. Kay
179: //
180: // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
181: //
182: // Contributor(s): none.
183: //
|