Package net.sf.saxon.s9api
Class MessageListenerProxy
- java.lang.Object
-
- net.sf.saxon.event.SequenceReceiver
-
- net.sf.saxon.event.SequenceWriter
-
- net.sf.saxon.s9api.MessageListenerProxy
-
- All Implemented Interfaces:
javax.xml.transform.Result,Receiver
class MessageListenerProxy extends SequenceWriter
This class implements a Receiver that can receive xsl:message output and send it to a user-supplied MessageListener.
-
-
Field Summary
-
Fields inherited from class net.sf.saxon.event.SequenceReceiver
pipelineConfiguration, previousAtomic, systemId
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMessageListenerProxy(MessageListener listener, PipelineConfiguration pipe)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(Item item, Location locationId, int copyNamespaces)Append an item to the sequence, performing any necessary type-checking and conversionvoidcharacters(java.lang.CharSequence s, Location locationId, int properties)Produce text content output.MessageListenergetMessageListener()Get the wrapped MessageListenervoidprocessingInstruction(java.lang.String target, java.lang.CharSequence data, Location locationId, int properties)Output a processing instructionvoidstartDocument(int properties)Start of a document node.voidstartElement(NodeName elemName, SchemaType type, AttributeMap attributes, NamespaceMap namespaces, Location location, int properties)Output an element start tag.voidwrite(Item item)Abstract method to be supplied by subclasses: output one item in the sequence.-
Methods inherited from class net.sf.saxon.event.SequenceWriter
close, comment, endDocument, endElement, getTreeModel, setTreeModel, setUnparsedEntity, usesTypeAnnotations
-
Methods inherited from class net.sf.saxon.event.SequenceReceiver
append, decompose, flatten, getConfiguration, getErrorCodeForDecomposingFunctionItems, getNamePool, getPipelineConfiguration, getSystemId, handlesAppend, open, setPipelineConfiguration, setSystemId
-
-
-
-
Constructor Detail
-
MessageListenerProxy
protected MessageListenerProxy(MessageListener listener, PipelineConfiguration pipe)
-
-
Method Detail
-
getMessageListener
public MessageListener getMessageListener()
Get the wrapped MessageListener- Returns:
- the wrapped MessageListener
-
startDocument
public void startDocument(int properties) throws XPathExceptionStart of a document node.- Specified by:
startDocumentin interfaceReceiver- Overrides:
startDocumentin classSequenceWriter- Parameters:
properties-- Throws:
XPathException- if an error occurs
-
startElement
public void startElement(NodeName elemName, SchemaType type, AttributeMap attributes, NamespaceMap namespaces, Location location, int properties) throws XPathException
Output an element start tag.- Specified by:
startElementin interfaceReceiver- Overrides:
startElementin classSequenceWriter- Parameters:
elemName- the name of the element.type- the type annotation of the element.attributes- the attributes of this elementnamespaces- the in-scope namespaces of this element: generally this is all the in-scope namespaces, without relying on inheriting namespaces from parent elementslocation- an object providing information about the module, line, and column where the node originatedproperties- bit-significant properties of the element node. If there are no relevant properties, zero is supplied. The definitions of the bits are in classReceiverOption- Throws:
XPathException- if an error occurs
-
processingInstruction
public void processingInstruction(java.lang.String target, java.lang.CharSequence data, Location locationId, int properties) throws XPathExceptionDescription copied from interface:ReceiverOutput a processing instruction- Specified by:
processingInstructionin interfaceReceiver- Overrides:
processingInstructionin classSequenceWriter- Parameters:
target- The PI name. This must be a legal name (it will not be checked).data- The data portion of the processing instructionlocationId- provides information such as line number and system ID.properties- Additional information about the PI.- Throws:
XPathException- if an error occurs
-
characters
public void characters(java.lang.CharSequence s, Location locationId, int properties) throws XPathExceptionProduce text content output.- Specified by:
charactersin interfaceReceiver- Overrides:
charactersin classSequenceWriter- Parameters:
s- The String to be outputlocationId- the location of the node in the source, or of the instruction that created itproperties- bit-significant flags for extra information, e.g. disable-output-escaping @throws net.sf.saxon.trans.XPathException- Throws:
XPathException- if an error occurs
-
append
public void append(Item item, Location locationId, int copyNamespaces) throws XPathException
Append an item to the sequence, performing any necessary type-checking and conversion- Specified by:
appendin interfaceReceiver- Overrides:
appendin classSequenceWriter- Parameters:
item- the item to be appendedlocationId- the location of the calling instruction, for diagnosticscopyNamespaces- if the item is an element node, this indicates whether its namespaces need to be copied. Values areReceiverOption.ALL_NAMESPACES; the default (0) means- Throws:
XPathException- if an error occurs
-
write
public void write(Item item) throws XPathException
Abstract method to be supplied by subclasses: output one item in the sequence.- Specified by:
writein classSequenceWriter- Parameters:
item- the item to be written to the sequence- Throws:
XPathException- if any failure occurs while writing the item
-
-