net.sf.saxon.trace

Class ExpressionPresenter

public class ExpressionPresenter extends Object

This class handles the display of an abstract expression tree in an XML format with some slight resemblence to XQueryX
Field Summary
intdepth
Constructor Summary
ExpressionPresenter(Configuration config)
Make an ExpressionPresenter that writes indented output to System.err
ExpressionPresenter(Configuration config, OutputStream out)
Make an ExpressionPresenter that writes indented output to a specified output stream
ExpressionPresenter(Configuration config, Receiver receiver)
Make an ExpressionPresenter for a given Configuration using a user-supplied Receiver to accept the output
Method Summary
voidclose()
Close the output
static ReceiverdefaultDestination(Configuration config, OutputStream out)
Make a receiver, using default output properties, with serialized output going to a specified OutputStream
voidemitAttribute(String name, String value)
Output an attribute node
intendElement()
End an element in the expression tree
voidendSubsidiaryElement()
End a child element in the output
ConfigurationgetConfiguration()
Get the Saxon configuration
NamePoolgetNamePool()
Get the name pool
TypeHierarchygetTypeHierarchy()
Get the type hierarchy cache
static PropertiesmakeDefaultProperties()
Make a Properties object containing defaulted serialization attributes for the expression tree
intstartElement(String name)
Start an element
voidstartSubsidiaryElement(String name)
Start a child element in the output

Field Detail

depth

int depth

Constructor Detail

ExpressionPresenter

public ExpressionPresenter(Configuration config)
Make an ExpressionPresenter that writes indented output to System.err

Parameters: config the Saxon configuration

ExpressionPresenter

public ExpressionPresenter(Configuration config, OutputStream out)
Make an ExpressionPresenter that writes indented output to a specified output stream

Parameters: config the Saxon configuration out the output stream

ExpressionPresenter

public ExpressionPresenter(Configuration config, Receiver receiver)
Make an ExpressionPresenter for a given Configuration using a user-supplied Receiver to accept the output

Parameters: config the Configuration receiver the user-supplied Receiver

Method Detail

close

public void close()
Close the output

defaultDestination

public static Receiver defaultDestination(Configuration config, OutputStream out)
Make a receiver, using default output properties, with serialized output going to a specified OutputStream

Parameters: config the Configuration out the OutputStream

Returns: a Receiver that directs serialized output to this output stream

Throws: XPathException

emitAttribute

public void emitAttribute(String name, String value)
Output an attribute node

Parameters: name the name of the attribute value the value of the attribute

endElement

public int endElement()
End an element in the expression tree

Returns: the depth of the tree after ending this element. For diagnostics, this can be compared with the value returned by startElement()

endSubsidiaryElement

public void endSubsidiaryElement()
End a child element in the output

getConfiguration

public Configuration getConfiguration()
Get the Saxon configuration

Returns: the Saxon configuration

getNamePool

public NamePool getNamePool()
Get the name pool

Returns: the name pool

getTypeHierarchy

public TypeHierarchy getTypeHierarchy()
Get the type hierarchy cache

Returns: the type hierarchy cache

makeDefaultProperties

public static Properties makeDefaultProperties()
Make a Properties object containing defaulted serialization attributes for the expression tree

Returns: a default set of properties

startElement

public int startElement(String name)
Start an element

Parameters: name the name of the element

Returns: the depth of the tree before this element: for diagnostics, this can be compared with the value returned by endElement

startSubsidiaryElement

public void startSubsidiaryElement(String name)
Start a child element in the output

Parameters: name the name of the child element