| //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
| // Copyright (c) 2018-2023 Saxonica Limited | |
| // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. | |
| // If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
| // This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. | |
| //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
| package net.sf.saxon.event; | |
| import net.sf.saxon.om.*; | |
| import net.sf.saxon.s9api.Location; | |
| import net.sf.saxon.str.UnicodeString; | |
| import net.sf.saxon.trans.XPathException; | |
| import net.sf.saxon.type.SchemaType; | |
| /** | |
| * A Sink is a Receiver that discards all information passed to it | |
| */ | |
| public class Sink extends SequenceReceiver { | |
| public Sink(PipelineConfiguration pipe) { | |
| super(pipe); | |
| } | |
| /** | |
| * Start of event stream | |
| */ | |
| @Override | |
| public void open() { | |
| } | |
| /** | |
| * End of event stream | |
| */ | |
| @Override | |
| public void close() { | |
| } | |
| /** | |
| * Start of a document node. | |
| */ | |
| @Override | |
| public void startDocument(int properties) { | |
| } | |
| /** | |
| * Notify the end of a document node | |
| */ | |
| @Override | |
| public void endDocument() { | |
| } | |
| /** | |
| * Notify the start of an element | |
| */ | |
| @Override | |
| public void startElement(NodeName elemName, SchemaType type, | |
| AttributeMap attributes, NamespaceMap namespaces, | |
| Location location, int properties) | |
| throws XPathException { | |
| } | |
| /** | |
| * End of element | |
| */ | |
| @Override | |
| public void endElement() { | |
| } | |
| /** | |
| * Character data | |
| */ | |
| @Override | |
| public void characters(UnicodeString chars, Location locationId, int properties) { | |
| } | |
| /** | |
| * Processing Instruction | |
| */ | |
| @Override | |
| public void processingInstruction(String target, UnicodeString data, Location locationId, int properties) { | |
| } | |
| /** | |
| * Output a comment | |
| */ | |
| @Override | |
| public void comment(UnicodeString chars, Location locationId, int properties) { | |
| } | |
| /** | |
| * Append an arbitrary item (node or atomic value) to the output | |
| * @param item the item to be appended | |
| * @param locationId the location of the calling instruction, for diagnostics | |
| * @param copyNamespaces if the item is an element node, this indicates whether its namespaces | |
| * need to be copied. Values are {@link ReceiverOption#ALL_NAMESPACES}; the default (0) means | |
| */ | |
| @Override | |
| public void append(Item item, Location locationId, int copyNamespaces) { | |
| } | |
| /** | |
| * Set the URI for an unparsed entity in the document. | |
| */ | |
| @Override | |
| public void setUnparsedEntity(String name, String uri, String publicId) { | |
| } | |
| /** | |
| * Ask whether this Receiver (or the downstream pipeline) makes any use of the type annotations | |
| * supplied on element and attribute events | |
| * | |
| * @return true if the Receiver makes any use of this information. If false, the caller | |
| * may supply untyped nodes instead of supplying the type annotation | |
| */ | |
| @Override | |
| public boolean usesTypeAnnotations() { | |
| return false; | |
| } | |
| } | |