org.apache.tika.sax
Class AppendableAdaptor

java.lang.Object
  extended by org.apache.tika.sax.AppendableAdaptor
All Implemented Interfaces:
java.lang.Appendable

public class AppendableAdaptor
extends java.lang.Object
implements java.lang.Appendable

Adaptor which turns a ContentHandler into an Appendable.

Version:
$Revision$
See Also:
ContentHandler

Constructor Summary
AppendableAdaptor(org.xml.sax.ContentHandler handler)
          Creates a adaptor for the given SAX event handler.
 
Method Summary
 java.lang.Appendable append(char c)
          Write a single character to the underling content handler.
 java.lang.Appendable append(java.lang.CharSequence charSeq)
          Write a character sequence to the underling content handler.
 java.lang.Appendable append(java.lang.CharSequence charSeq, int start, int end)
          Write the specified characters to the underling content handler.
 org.xml.sax.ContentHandler getHandler()
          Return the content handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppendableAdaptor

public AppendableAdaptor(org.xml.sax.ContentHandler handler)
Creates a adaptor for the given SAX event handler.

Parameters:
handler - SAX event handler to be decorated, throws IllegalArgumentException if null.
Method Detail

getHandler

public org.xml.sax.ContentHandler getHandler()
Return the content handler.

Returns:
The content handler

append

public java.lang.Appendable append(char c)
                            throws java.io.IOException
Write a single character to the underling content handler.

Specified by:
append in interface java.lang.Appendable
Parameters:
c - The character to write
Returns:
This appendabale instance
Throws:
java.io.IOException - if an error occurs writing to the content handler

append

public java.lang.Appendable append(java.lang.CharSequence charSeq)
                            throws java.io.IOException
Write a character sequence to the underling content handler.

Specified by:
append in interface java.lang.Appendable
Parameters:
charSeq - The sequence of characters, ignored if null
Returns:
This appendabale instance
Throws:
java.io.IOException - if an error occurs writing to the content handler

append

public java.lang.Appendable append(java.lang.CharSequence charSeq,
                                   int start,
                                   int end)
                            throws java.io.IOException
Write the specified characters to the underling content handler.

Specified by:
append in interface java.lang.Appendable
Parameters:
charSeq - The sequence of characters, ignored if null
start - The starting index of the characters to write
end - The index of the last character +1 to write
Returns:
This appendabale instance
Throws:
java.io.IOException - if a SAXException occurs writing to the content handler


Copyright © 2008 The Apache Software Foundation. All Rights Reserved.