/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/* $Id: TransformerDefaultHandler.java 830293 2009-10-27 19:07:52Z vhennebert $ */

package org.apache.fop.util;

import javax.xml.transform.sax.TransformerHandler;

import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
import org.xml.sax.ext.DefaultHandler2;
import org.xml.sax.helpers.AttributesImpl;

A DefaultHandler implementation that delegates all the method calls to a TransformerHandler instance.
/** * A DefaultHandler implementation that delegates all the method calls to a * {@link TransformerHandler} instance. */
public class TransformerDefaultHandler extends DefaultHandler2 { private TransformerHandler transformerHandler;
Creates a new instance delegating to the given TransformerHandler object.
Params:
  • transformerHandler – the object to which all the method calls will be delegated
/** * Creates a new instance delegating to the given TransformerHandler object. * * @param transformerHandler the object to which all the method calls will * be delegated */
public TransformerDefaultHandler(TransformerHandler transformerHandler) { this.transformerHandler = transformerHandler; }
Returns the delegate TransformerHandler instance.
Returns:the object to which all method calls are delegated
/** * Returns the delegate TransformerHandler instance. * * @return the object to which all method calls are delegated */
public TransformerHandler getTransformerHandler() { return transformerHandler; }
{@inheritDoc}
/** {@inheritDoc} */
public void setDocumentLocator(Locator locator) { transformerHandler.setDocumentLocator(locator); }
{@inheritDoc}
/** {@inheritDoc} */
public void startDocument() throws SAXException { transformerHandler.startDocument(); }
{@inheritDoc}
/** {@inheritDoc} */
public void endDocument() throws SAXException { transformerHandler.endDocument(); }
{@inheritDoc}
/** {@inheritDoc} */
public void startPrefixMapping(String prefix, String uri) throws SAXException { transformerHandler.startPrefixMapping(prefix, uri); }
{@inheritDoc}
/** {@inheritDoc} */
public void endPrefixMapping(String string) throws SAXException { transformerHandler.endPrefixMapping(string); }
{@inheritDoc}
/** {@inheritDoc} */
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { AttributesImpl ai = new AttributesImpl(attrs); transformerHandler.startElement(uri, localName, qName, ai); }
{@inheritDoc}
/** {@inheritDoc} */
public void endElement(String uri, String localName, String qName) throws SAXException { transformerHandler.endElement(uri, localName, qName); }
{@inheritDoc}
/** {@inheritDoc} */
public void characters(char[] ch, int start, int length) throws SAXException { transformerHandler.characters(ch, start, length); }
{@inheritDoc}
/** {@inheritDoc} */
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { transformerHandler.ignorableWhitespace(ch, start, length); }
{@inheritDoc}
/** {@inheritDoc} */
public void processingInstruction(String target, String data) throws SAXException { transformerHandler.processingInstruction(target, data); }
{@inheritDoc}
/** {@inheritDoc} */
public void skippedEntity(String name) throws SAXException { transformerHandler.skippedEntity(name); }
{@inheritDoc}
/** {@inheritDoc} */
public void notationDecl(String name, String publicId, String systemId) throws SAXException { transformerHandler.notationDecl(name, publicId, systemId); }
{@inheritDoc}
/** {@inheritDoc} */
public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException { transformerHandler.unparsedEntityDecl(name, publicId, systemId, notationName); }
{@inheritDoc}
/** {@inheritDoc} */
public void startDTD(String name, String pid, String lid) throws SAXException { transformerHandler.startDTD(name, pid, lid); }
{@inheritDoc}
/** {@inheritDoc} */
public void endDTD() throws SAXException { transformerHandler.endDTD(); }
{@inheritDoc}
/** {@inheritDoc} */
public void startEntity(String name) throws SAXException { transformerHandler.startEntity(name); }
{@inheritDoc}
/** {@inheritDoc} */
public void endEntity(String name) throws SAXException { transformerHandler.endEntity(name); }
{@inheritDoc}
/** {@inheritDoc} */
public void startCDATA() throws SAXException { transformerHandler.startCDATA(); }
{@inheritDoc}
/** {@inheritDoc} */
public void endCDATA() throws SAXException { transformerHandler.endCDATA(); }
{@inheritDoc}
/** {@inheritDoc} */
public void comment(char[] charArray, int start, int length) throws SAXException { transformerHandler.comment(charArray, start, length); } }