@Override public void loadRules() throws XmlLoadException { try { rulesDigester.parse(inputSource); } catch (Exception ex) { throw new XmlLoadException(ex); } } }
@Override public void loadRules() throws XmlLoadException { try { rulesDigester.parse(url.openStream()); } catch (Exception ex) { throw new XmlLoadException(ex); } } }
/** * Create a ValidatorResources object from an InputStream. * * @param streams An array of InputStreams to several validation.xml * configuration files that will be read in order and merged into this object. * It's the client's responsibility to close these streams. * @throws SAXException if the validation XML files are not valid or well * formed. * @throws IOException if an I/O error occurs processing the XML files * @since Validator 1.1 */ public ValidatorResources(InputStream[] streams) throws IOException, SAXException { super(); Digester digester = initDigester(); for (int i = 0; i < streams.length; i++) { if (streams[i] == null) { throw new IllegalArgumentException("Stream[" + i + "] is null"); } digester.push(this); digester.parse(streams[i]); } this.process(); }
digester.addRuleSet(includedSet); digester.push(DigesterRuleParser.this); digester.parse(fileName); includedFiles.remove(fileName);
/** * Create a ValidatorResources object from several uris * * @param uris An array of uris to several validation.xml * configuration files that will be read in order and merged into this object. * @throws SAXException if the validation XML files are not valid or well * formed. * @throws IOException if an I/O error occurs processing the XML files * @since Validator 1.2 */ public ValidatorResources(String[] uris) throws IOException, SAXException { super(); Digester digester = initDigester(); for (int i = 0; i < uris.length; i++) { digester.push(this); digester.parse(uris[i]); } this.process(); }
/** * Create a ValidatorResources object from several URL. * * @param urls An array of URL to several validation.xml * configuration files that will be read in order and merged into this object. * @throws SAXException if the validation XML files are not valid or well * formed. * @throws IOException if an I/O error occurs processing the XML files * @since Validator 1.3.1 */ public ValidatorResources(URL[] urls) throws IOException, SAXException { super(); Digester digester = initDigester(); for (int i = 0; i < urls.length; i++) { digester.push(this); digester.parse(urls[i]); } this.process(); }
/** * Given the digester rules XML file, a class loader, and an input stream, * this method parses the input into Java objects. The class loader * is used by the digester to create the Java objects. * @param digesterRules URL to the XML document defining the digester rules * @param classLoader the ClassLoader to register with the digester * @param input InputStream over the XML file to parse into Java objects * @return an Object which is the root of the network of Java objects * created by digesting fileURL */ public static Object load(URL digesterRules, ClassLoader classLoader, InputStream input) throws IOException, SAXException, DigesterLoadingException { Digester digester = createDigester(digesterRules); digester.setClassLoader(classLoader); try { return digester.parse(input); } catch (XmlLoadException ex) { // This is a runtime exception that can be thrown by // FromXmlRuleSet#addRuleInstances, which is called by the Digester // before it parses the file. throw new DigesterLoadingException(ex.getMessage(), ex); } }
/** * Given the digester rules XML file, a class loader, and an input stream, * this method parses the input into Java objects. The class loader * is used by the digester to create the Java objects. * @param digesterRules URL to the XML document defining the digester rules * @param classLoader the ClassLoader to register with the digester * @param reader Reader over the XML file to parse into Java objects * @return an Object which is the root of the network of Java objects * created by digesting fileURL */ public static Object load( URL digesterRules, ClassLoader classLoader, Reader reader) throws IOException, SAXException, DigesterLoadingException { Digester digester = createDigester(digesterRules); digester.setClassLoader(classLoader); try { return digester.parse(reader); } catch (XmlLoadException ex) { // This is a runtime exception that can be thrown by // FromXmlRuleSet#addRuleInstances, which is called by the Digester // before it parses the file. throw new DigesterLoadingException(ex.getMessage(), ex); } }
digester.parse(xmlreader);
/** * Given the digester rules XML file, a class loader, and an input stream, * this method parses the input into Java objects. The class loader * is used by the digester to create the Java objects. * @param digesterRules URL to the XML document defining the digester rules * @param classLoader the ClassLoader to register with the digester * @param input InputStream over the XML file to parse into Java objects * @param rootObject an Object to push onto the digester's stack, prior * to parsing the input * @return an Object which is the root of the network of Java objects * created by digesting fileURL */ public static Object load(URL digesterRules, ClassLoader classLoader, InputStream input, Object rootObject) throws IOException, SAXException, DigesterLoadingException { Digester digester = createDigester(digesterRules); digester.setClassLoader(classLoader); digester.push(rootObject); try { return digester.parse(input); } catch (XmlLoadException ex) { // This is a runtime exception that can be thrown by // FromXmlRuleSet#addRuleInstances, which is called by the Digester // before it parses the file. throw new DigesterLoadingException(ex.getMessage(), ex); } }
digester.parse(xmlreader);
digester.push(rootObject); try { return digester.parse(input); } catch (XmlLoadException ex) {
digester.parse(new StringReader(configString)); } catch (SAXException e) { java.util.logging.Logger.getGlobal().log(java.util.logging.Level.INFO, "", e);
public Void run() throws Exception { digester.parse(xml); return null; } });
public FacesConfigImpl getFacesConfig(InputStream in, String systemId) throws IOException, SAXException { InputSource is = new InputSource(in); is.setSystemId(systemId); // Fix for http://issues.apache.org/jira/browse/MYFACES-236 FacesConfigImpl config = (FacesConfigImpl) digester.parse(is); postProcessFacesConfig(systemId, config); return config; }
public FacesConfigImpl getFacesConfig(Reader r) throws IOException, SAXException { //InputSource is = new InputSource(in); //is.setSystemId(systemId); // Fix for http://issues.apache.org/jira/browse/MYFACES-236 FacesConfigImpl config = (FacesConfigImpl) digester.parse(r); postProcessFacesConfig(null, config); return config; }
Digester digester = new Digester(); digester.addObjectCreate("Results/Row", MyRowHolder.class); digester.addCallMethod("Results/Row/COL1","addCol", 0); // Similarly for COL2, etc. digester.parse("mydata.xml");
private void loadMetadataFile(InputStream stream) throws Exception { TrackErrorsErrorHandler handler = new TrackErrorsErrorHandler(log); Digester digester = XmlUtils.getNewDigester(handler); digester.push(this); initialize(digester); digester.parse(stream); if (handler.haveErrorsOccurred()) { throw new RuntimeException("XML parsing error(s) encountered; check log for details"); } }
private void readApplicationXml(InputStream istream) throws IOException, SAXException { Digester digester = new Digester(); digester.addCallMethod("application/module/ejb", "add", 1); digester.addCallParam("application/module/ejb", 0); digester.push(ejbJars); digester.parse(istream); }
public TextModification create() throws IOException, SAXException { TextModifications modifications = new TextModifications(); Digester digester = new Digester(); digester.addObjectCreate("text-modifications/replacement", ReplacementTextModification.class); digester.addSetProperties("text-modifications/replacement"); digester.addSetNext("text-modifications/replacement", "addModification"); digester.push(modifications); digester.parse(_resource.getInputStream()); return modifications; } }