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 protected
MessageListenerProxy(MessageListener listener, PipelineConfiguration pipe)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
append(Item item, Location locationId, int copyNamespaces)
Append an item to the sequence, performing any necessary type-checking and conversionvoid
characters(java.lang.CharSequence s, Location locationId, int properties)
Produce text content output.MessageListener
getMessageListener()
Get the wrapped MessageListenervoid
processingInstruction(java.lang.String target, java.lang.CharSequence data, Location locationId, int properties)
Output a processing instructionvoid
startDocument(int properties)
Start of a document node.void
startElement(NodeName elemName, SchemaType type, AttributeMap attributes, NamespaceMap namespaces, Location location, int properties)
Output an element start tag.void
write(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 XPathException
Start of a document node.- Specified by:
startDocument
in interfaceReceiver
- Overrides:
startDocument
in 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:
startElement
in interfaceReceiver
- Overrides:
startElement
in 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 XPathException
Description copied from interface:Receiver
Output a processing instruction- Specified by:
processingInstruction
in interfaceReceiver
- Overrides:
processingInstruction
in 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 XPathException
Produce text content output.- Specified by:
characters
in interfaceReceiver
- Overrides:
characters
in 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:
append
in interfaceReceiver
- Overrides:
append
in 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:
write
in classSequenceWriter
- Parameters:
item
- the item to be written to the sequence- Throws:
XPathException
- if any failure occurs while writing the item
-
-