1*1a37d047SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*1a37d047SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*1a37d047SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*1a37d047SAndrew Rist  * distributed with this work for additional information
6*1a37d047SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*1a37d047SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*1a37d047SAndrew Rist  * "License"); you may not use this file except in compliance
9*1a37d047SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*1a37d047SAndrew Rist  *
11*1a37d047SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*1a37d047SAndrew Rist  *
13*1a37d047SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*1a37d047SAndrew Rist  * software distributed under the License is distributed on an
15*1a37d047SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1a37d047SAndrew Rist  * KIND, either express or implied.  See the License for the
17*1a37d047SAndrew Rist  * specific language governing permissions and limitations
18*1a37d047SAndrew Rist  * under the License.
19*1a37d047SAndrew Rist  *
20*1a37d047SAndrew Rist  *************************************************************/
21*1a37d047SAndrew Rist 
22*1a37d047SAndrew Rist 
23cdf0e10cSrcweir package com.sun.star.report.pentaho.parser.text;
24cdf0e10cSrcweir 
25cdf0e10cSrcweir import org.jfree.report.structure.Section;
26cdf0e10cSrcweir import org.jfree.report.structure.StaticText;
27cdf0e10cSrcweir 
28cdf0e10cSrcweir import org.xml.sax.SAXException;
29cdf0e10cSrcweir 
30cdf0e10cSrcweir /**
31cdf0e10cSrcweir  * This is a generic implementation that accepts all input and adds special
32cdf0e10cSrcweir  * handlers for the report-elements.
33cdf0e10cSrcweir  *
34cdf0e10cSrcweir  * @author Thomas Morgner
35cdf0e10cSrcweir  */
36cdf0e10cSrcweir public class TextContentReadHandler extends NoCDATATextContentReadHandler
37cdf0e10cSrcweir {
38cdf0e10cSrcweir 
TextContentReadHandler(final Section section, final boolean copyType)39cdf0e10cSrcweir     public TextContentReadHandler(final Section section, final boolean copyType)
40cdf0e10cSrcweir     {
41cdf0e10cSrcweir         super(section, copyType);
42cdf0e10cSrcweir     }
43cdf0e10cSrcweir 
TextContentReadHandler(final Section section)44cdf0e10cSrcweir     public TextContentReadHandler(final Section section)
45cdf0e10cSrcweir     {
46cdf0e10cSrcweir         super(section);
47cdf0e10cSrcweir     }
48cdf0e10cSrcweir 
TextContentReadHandler()49cdf0e10cSrcweir     public TextContentReadHandler()
50cdf0e10cSrcweir     {
51cdf0e10cSrcweir     }
52cdf0e10cSrcweir 
53cdf0e10cSrcweir     /**
54cdf0e10cSrcweir      * This method is called to process the character data between element tags.
55cdf0e10cSrcweir      *
56cdf0e10cSrcweir      * @param ch     the character buffer.
57cdf0e10cSrcweir      * @param start  the start index.
58cdf0e10cSrcweir      * @param length the length.
59cdf0e10cSrcweir      * @throws org.xml.sax.SAXException if there is a parsing error.
60cdf0e10cSrcweir      */
characters(final char[] ch, final int start, final int length)61cdf0e10cSrcweir     public void characters(final char[] ch, final int start, final int length)
62cdf0e10cSrcweir             throws SAXException
63cdf0e10cSrcweir     {
64cdf0e10cSrcweir         getChildren().add(new StaticText(new String(ch, start, length)));
65cdf0e10cSrcweir     }
66cdf0e10cSrcweir }
67