1 43 44 package org.jfree.xml.parser.coretypes; 45 46 import org.jfree.xml.parser.AbstractXmlReadHandler; 47 import org.jfree.xml.parser.XmlReaderException; 48 import org.xml.sax.Attributes ; 49 import org.xml.sax.SAXException ; 50 51 54 public class StringReadHandler extends AbstractXmlReadHandler 55 { 56 57 60 private StringBuffer buffer; 61 62 65 private String result; 66 67 70 public StringReadHandler () 71 { 72 super(); 73 } 74 75 81 protected void startParsing (final Attributes attrs) 82 throws SAXException 83 { 84 this.buffer = new StringBuffer (); 85 } 86 87 95 public void characters (final char[] ch, final int start, final int length) 96 throws SAXException 97 { 98 this.buffer.append(ch, start, length); 99 } 100 101 107 protected void doneParsing () 108 throws SAXException , XmlReaderException 109 { 110 this.result = this.buffer.toString(); 111 this.buffer = null; 112 } 113 114 public String getResult () 115 { 116 return result; 117 } 118 119 124 public Object getObject () 125 { 126 return this.result; 127 } 128 } 129 | Popular Tags |