* 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
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.

package org.apache.axiom.ext.stax;



 * Optional interface implemented by {@link}
 * implementations that support writing character data directly to a
 * {@link Writer}.
 * <p>
 * All the requirements outlined in {@link org.apache.axiom.ext.stax} apply to
 * this extension interface. In particular, to get a reference to the extension,
 * the consumer MUST call {@link}
 * with {@link #PROPERTY} as the property name.
public interface CharacterDataReader {
     * The name of the property used to look up this extension interface from a
     * {@link} implementation.
    String PROPERTY = CharacterDataReader.class.getName();
     * Output the character data for the current event to the given writer. In
     * general, the implementation behaves such that
     * <code>reader.writeTextTo(writer)</code> has the same effect as
     * <code>writer.write(reader.getText())</code>. However, the implementation
     * MAY choose to split the character data differently. E.g. it MAY write the
     * character data in multiple chunks or it MAY choose to process more
     * character data in a single event than would be returned by
     * {@link}. Therefore, using this
     * method together with {@link},
     * {@link},
     * {@link},
     * {@link} or
     * {@link, char[], int, int)}
     * is not supported and may lead to undefined results.
     * <p>
     * The implementation SHOULD avoid any unnecessary conversions between
     * strings and character arrays.
     * @param writer
     *            the writer to write the character data to
     * @throws XMLStreamException
     *             if the underlying XML source is not well-formed
     * @throws IOException
     *             if an I/O error occurs when writing the character data
     * @throws IllegalStateException
     *             if this state is not a valid text state.
    void writeTextTo(Writer writer) throws XMLStreamException, IOException;