@Override public void begin(String namespace, String name, Attributes attributes) throws Exception { Object instance = clazz.newInstance(); digester.push(instance); }
/** * Process the beginning of this element. * * @param attributes The attribute list of this element */ @Override public void begin(Attributes attributes) throws Exception { // Identify the name of the class to instantiate String realClassName = className; if (attributeName != null) { String value = attributes.getValue(attributeName); if (value != null) { realClassName = value; } } if (digester.log.isDebugEnabled()) { digester.log.debug("[ObjectCreateRule]{" + digester.match + "}New " + realClassName); } // Instantiate the new object and push it on the context stack Class<?> clazz = digester.getClassLoader().loadClass(realClassName); Object instance = clazz.newInstance(); digester.push(instance); }
Digester digester = new Digester(); digester.addRuleSet(includedSet); digester.push(DigesterRuleParser.this); digester.parse(fileName); includedFiles.remove(fileName);
/** * 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(); }
/** * 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(); }
rulesDigester.push(parser);
/** * Checks whether control needs to be returned to Digester. * * @param namespaceURI the namespace URI * @param localName the local name * @param qName the qualified (prefixed) name * @throws SAXException if the DOM implementation throws an exception */ @Override public void endElement(String namespaceURI, String localName, String qName) throws SAXException { addTextIfPresent(); try { if (depth == 0) { getDigester().setCustomContentHandler(oldContentHandler); getDigester().push(root); getDigester().endElement(namespaceURI, localName, qName); } top = top.getParentNode(); depth--; } catch (DOMException e) { throw new SAXException(e.getMessage()); } }
digester.push(parsed); digester.addCallMethod( "RatingServiceSelectionResponse/Response/Error",
/** * 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.push(parsed);
getDigester().push(instance); if (debug) { log.debug(
Digester digester = createDigester(digesterRules); digester.setClassLoader(classLoader); digester.push(rootObject); try { return digester.parse(input);
configDto.setBaseSchemasUrl(dataStoreConfigUrl.toExternalForm()); digester.push(configDto);
@Override public void begin(String namespace, String name, Attributes attributes) throws Exception { Object instance = clazz.newInstance(); digester.push(instance); }
/** * Parses the XML file on the supplied input stream into a scene model instance. */ public SimpleMisoSceneModel parseScene (InputStream in) throws IOException, SAXException { _model = null; _digester.push(this); _digester.parse(in); return _model; }
public void begin(String namespace, String name, Attributes attributes) { RenderKitFactory factory = (RenderKitFactory) FactoryFinder .getFactory(FactoryFinder.RENDER_KIT_FACTORY); getDigester().push( factory.getRenderKit(null, RenderKitFactory.HTML_BASIC_RENDER_KIT)); }
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); }