/** * 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); }
rulesClass = digester.getClassLoader().loadClass(rulesClassName); } catch(ClassNotFoundException cnfe) {
"} New factory " + realClassName); Class<?> clazz = digester.getClassLoader().loadClass(realClassName); creationFactory = (ObjectCreationFactory) clazz.newInstance();
/** * Set the associated digester. * If needed, this class loads the parameter classes from their names. */ @Override public void setDigester(Digester digester) { // call superclass super.setDigester(digester); // if necessary, load parameter classes if (this.paramClassNames != null) { this.paramTypes = new Class[paramClassNames.length]; for (int i = 0; i < this.paramClassNames.length; i++) { try { this.paramTypes[i] = digester.getClassLoader().loadClass(this.paramClassNames[i]); } catch (ClassNotFoundException e) { // use the digester log digester.getLogger().error("(CallMethodRule) Cannot load class " + this.paramClassNames[i], e); this.paramTypes[i] = null; // Will cause NPE later } } } }
if (paramType != null) { paramTypes[0] = digester.getClassLoader().loadClass(paramType); } else { paramTypes[0] = child.getClass();
digester.getClassLoader().loadClass(pluginClassName); } catch(ClassNotFoundException cnfe) { throw new PluginException(
if (paramType != null) { paramTypes[0] = digester.getClassLoader().loadClass(paramType); } else { paramTypes[0] = parent.getClass();
if (paramType != null) { paramTypes[0] = digester.getClassLoader().loadClass(paramType); } else { paramTypes[0] = child.getClass();
digester.getClassLoader().loadClass(ruleClassName); } catch(ClassNotFoundException cnfe) { throw new PluginException(
/** * <p>Create a new {@link ListEntryConfig} and push it on to the * Digester stack.</p> * * @param namespace Namespace URI of the matching element * @param name Local name of the matching element * @param attributes Attribute list of the matching element * * @exception Exception if a parsing error occurs */ public void begin(String namespace, String name, Attributes attributes) throws Exception { Class clazz = digester.getClassLoader().loadClass(CLASS_NAME); digester.push(clazz.newInstance()); }
/** * <p>Create a new {@link ListEntriesConfig} and push it on to the * Digester stack.</p> * * @param namespace Namespace URI of the matching element * @param name Local name of the matching element * @param attributes Attribute list of the matching element * * @exception Exception if a parsing error occurs */ public void begin(String namespace, String name, Attributes attributes) throws Exception { Class clazz = digester.getClassLoader().loadClass(CLASS_NAME); digester.push(clazz.newInstance()); }
/** * <p>Create a new {@link MapEntriesConfig} and push it on to the * Digester stack.</p> * * @param namespace Namespace URI of the matching element * @param name Local name of the matching element * @param attributes Attribute list of the matching element * * @exception Exception if a parsing error occurs */ public void begin(String namespace, String name, Attributes attributes) throws Exception { Class clazz = digester.getClassLoader().loadClass(CLASS_NAME); digester.push(clazz.newInstance()); }
/** * <p>Create a new {@link ManagedPropertyConfig} and push it on to the * Digester stack.</p> * * @param namespace Namespace URI of the matching element * @param name Local name of the matching element * @param attributes Attribute list of the matching element * * @exception Exception if a parsing error occurs */ public void begin(String namespace, String name, Attributes attributes) throws Exception { Class clazz = digester.getClassLoader().loadClass(CLASS_NAME); digester.push(clazz.newInstance()); }
/** * <p>Create a new {@link MapEntryConfig} and push it on to the * Digester stack.</p> * * @param namespace Namespace URI of the matching element * @param name Local name of the matching element * @param attributes Attribute list of the matching element * * @exception Exception if a parsing error occurs */ public void begin(String namespace, String name, Attributes attributes) throws Exception { Class clazz = digester.getClassLoader().loadClass(CLASS_NAME); digester.push(clazz.newInstance()); }
/** * <p>Create a new {@link ManagedBeanConfig} and push it on to the * Digester stack.</p> * * @param namespace Namespace URI of the matching element * @param name Local name of the matching element * @param attributes Attribute list of the matching element * * @exception Exception if a parsing error occurs */ public void begin(String namespace, String name, Attributes attributes) throws Exception { Class clazz = digester.getClassLoader().loadClass(CLASS_NAME); digester.push(clazz.newInstance()); }
/** * Process the beginning of this element. * * @param attributes The attribute list of this element */ 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); }
/** * Set the associated digester. * If needed, this class loads the parameter classes from their names. */ public void setDigester(Digester digester) { // call superclass super.setDigester(digester); // if necessary, load parameter classes if (this.paramClassNames != null) { this.paramTypes = new Class[paramClassNames.length]; for (int i = 0; i < this.paramClassNames.length; i++) { try { this.paramTypes[i] = digester.getClassLoader().loadClass(this.paramClassNames[i]); } catch (ClassNotFoundException e) { // use the digester log digester.getLogger().error("(CallMethodRule) Cannot load class " + this.paramClassNames[i], e); this.paramTypes[i] = null; // Will cause NPE later } } } }
/** * <p>Create an empty instance of <code>RenderKitBean</code> * and push it on to the object stack.</p> * * @param namespace the namespace URI of the matching element, or an * empty string if the parser is not namespace aware or the element has * no namespace * @param name the local name if the parser is namespace aware, or just * the element name otherwise * @param attributes The attribute list of this element * * @exception IllegalStateException if the parent stack element is not * of type FacesConfigBean */ public void begin(String namespace, String name, Attributes attributes) throws Exception { assert (digester.peek() instanceof FacesConfigBean); if (digester.getLogger().isDebugEnabled()) { digester.getLogger().debug("[RenderKitRule]{" + digester.getMatch() + "} Push " + CLASS_NAME); } Class clazz = digester.getClassLoader().loadClass(CLASS_NAME); RenderKitBean rkb = (RenderKitBean) clazz.newInstance(); digester.push(rkb); }
/** * <p>Create an empty instance of <code>NavigationCaseBean</code> * and push it on to the object stack.</p> * * @param namespace the namespace URI of the matching element, or an * empty string if the parser is not namespace aware or the element has * no namespace * @param name the local name if the parser is namespace aware, or just * the element name otherwise * @param attributes The attribute list of this element * * @exception IllegalStateException if the parent stack element is not * of type NavigationRuleBean */ public void begin(String namespace, String name, Attributes attributes) throws Exception { assert digester.peek() instanceof NavigationRuleBean : "Assertion Error: Expected NavigationRuleBean to be at the top of the stack"; if (digester.getLogger().isDebugEnabled()) { digester.getLogger().debug("[NavigationCaseRule]{" + digester.getMatch() + "} Push " + CLASS_NAME); } Class clazz = digester.getClassLoader().loadClass(CLASS_NAME); NavigationCaseBean ncb = (NavigationCaseBean) clazz.newInstance(); digester.push(ncb); }
/** * <p>Create an empty instance of <code>ConverterBean</code> * and push it on to the object stack.</p> * * @param namespace the namespace URI of the matching element, or an * empty string if the parser is not namespace aware or the element has * no namespace * @param name the local name if the parser is namespace aware, or just * the element name otherwise * @param attributes The attribute list of this element * * @exception IllegalStateException if the parent stack element is not * of type FacesConfigBean */ public void begin(String namespace, String name, Attributes attributes) throws Exception { assert digester.peek() instanceof FacesConfigBean : "Assertion Error: Expected FacesConfigBean to be at the top of the stack"; if (digester.getLogger().isDebugEnabled()) { digester.getLogger().debug("[ConverterRule]{" + digester.getMatch() + "} Push " + CLASS_NAME); } Class clazz = digester.getClassLoader().loadClass(CLASS_NAME); ConverterBean cb = (ConverterBean) clazz.newInstance(); digester.push(cb); }