Example usage for javax.xml.transform.sax SAXResult getLexicalHandler

List of usage examples for javax.xml.transform.sax SAXResult getLexicalHandler

Introduction

In this page you can find the example usage for javax.xml.transform.sax SAXResult getLexicalHandler.

Prototype

public LexicalHandler getLexicalHandler() 

Source Link

Document

Get a SAX2 org.xml.sax.ext.LexicalHandler for the output.

Usage

From source file:org.springframework.oxm.support.AbstractMarshaller.java

/**
 * Template method for handling {@code SAXResult}s.
 * <p>This implementation delegates to {@code marshalSaxHandlers}.
 * @param graph the root of the object graph to marshal
 * @param saxResult the {@code SAXResult}
 * @throws XmlMappingException if the given object cannot be marshalled to the result
 * @see #marshalSaxHandlers(Object, org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler)
 *///from  www .  ja va  2 s. c  o  m
protected void marshalSaxResult(Object graph, SAXResult saxResult) throws XmlMappingException {
    ContentHandler contentHandler = saxResult.getHandler();
    Assert.notNull(contentHandler, "ContentHandler not set on SAXResult");
    LexicalHandler lexicalHandler = saxResult.getLexicalHandler();
    marshalSaxHandlers(graph, contentHandler, lexicalHandler);
}