1 33 46 47 package com.hp.hpl.jena.rdf.arp; 48 import org.xml.sax.ErrorHandler ; 49 import org.xml.sax.SAXException ; 50 import java.io.IOException ; 51 import org.xml.sax.InputSource ; 52 import org.xml.sax.Locator ; 53 import java.io.InputStream ; 54 import java.io.Reader ; 55 56 57 89 public class ARP implements ARPConfig 90 { 91 92 final private SingleThreadedParser arpf; 93 94 97 public ARP() { 98 arpf = SingleThreadedParser.create(); 99 } 100 107 public Locator getLocator() { 108 return arpf.getLocator(); 109 } 110 111 117 public void load(Reader in,String xmlBase) throws SAXException , IOException { 118 InputSource inputS = new InputSource (in); 119 inputS.setSystemId(xmlBase); 120 arpf.parse(inputS); 121 } 122 void load(InputSource is) throws SAXException , IOException { 123 arpf.parse(is); 124 } 125 131 public void load(InputStream in,String xmlBase) throws SAXException , 132 IOException { 133 InputSource inputS = new InputSource (in); 135 inputS.setSystemId(xmlBase); 136 arpf.parse(inputS, xmlBase); 137 } 138 143 public void load(InputStream in) 144 throws SAXException , IOException { 145 load(in,""); 146 } 147 152 public void load(Reader in) throws SAXException , IOException { 153 load(in,""); 154 } 155 169 public ARPHandlers getHandlers() { 170 return arpf.getHandlers(); 171 } 172 180 public void setHandlersWith(ARPHandlers handlers){ 181 arpf.setHandlersWith(handlers); 182 } 183 200 201 public ARPOptions getOptions(){ 202 return arpf.getOptions(); 203 } 204 205 213 public void setOptionsWith(ARPOptions opts){ 214 arpf.setOptionsWith(opts); 215 } 216 219 public ExtendedHandler setExtendedHandler(ExtendedHandler eh) { 220 221 return getHandlers().setExtendedHandler(eh); 222 } 223 226 public NamespaceHandler setNamespaceHandler(NamespaceHandler nh) { 227 228 return getHandlers().setNamespaceHandler(nh); 229 } 230 233 public StatementHandler setStatementHandler(StatementHandler sh) { 234 235 return getHandlers().setStatementHandler(sh); 236 } 237 240 public void setErrorHandler(ErrorHandler eh) { 241 getHandlers().setErrorHandler(eh); 242 } 243 246 public int setErrorMode(int errno, int mode) { 247 return 248 getOptions().setErrorMode(errno,mode); 249 250 } 251 254 public void setDefaultErrorMode() { 255 256 getOptions().setDefaultErrorMode(); 257 } 258 261 public void setLaxErrorMode() { 262 263 getOptions().setLaxErrorMode(); 264 } 265 268 public void setStrictErrorMode() { 269 270 getOptions().setStrictErrorMode(); 271 } 272 275 public void setStrictErrorMode(int nonErrorMode) { 276 277 getOptions().setStrictErrorMode(nonErrorMode); 278 } 279 282 public void setEmbedding(boolean embed) { 283 284 getOptions().setEmbedding(embed); 285 } 286 } 287 | Popular Tags |