/** * @param delegateClass the name of the delegate used by the * <code>InjectionProvider</code> implementation. * @return returns <code>true</code> if the * <code>InjectionProvider</code> instance * is appropriate for the container its currently * deployed within, otherwise return <code>false</code> */ public static boolean isInjectionFeatureAvailable(String delegateClass) { try { Util.loadClass(delegateClass, null); return true; } catch (Exception e) { return false; } }
/** * @param delegateClass the name of the delegate used by the * <code>InjectionProvider</code> implementation. * @return returns <code>true</code> if the * <code>InjectionProvider</code> instance * is appropriate for the container its currently * deployed within, otherwise return <code>false</code> */ public static boolean isInjectionFeatureAvailable(String delegateClass) { try { Util.loadClass(delegateClass, null); return true; } catch (Exception e) { return false; } }
/** * @param delegateClass the name of the delegate used by the * <code>InjectionProvider</code> implementation. * @return returns <code>true</code> if the * <code>InjectionProvider</code> instance * is appropriate for the container its currently * deployed within, otherwise return <code>false</code> */ public static boolean isInjectionFeatureAvailable(String delegateClass) { try { Util.loadClass(delegateClass, null); return true; } catch (Exception e) { return false; } }
@SuppressWarnings("unchecked") public void setInputClassName( String inputClassName ) { try { inputComponentClass = Util.loadClass( inputClassName, null ); } catch ( ClassNotFoundException e ) { e.printStackTrace(); } }
private static Class<?> loadClass(String className, Object fallback, Class<?> expectedType) throws ClassNotFoundException { Class<?> clazz = Util.loadClass(className, fallback); if (expectedType != null && !expectedType.isAssignableFrom(clazz)) { throw new ClassCastException(); } return clazz; }
protected Class<?> loadClass(String className, Object fallback, Class<?> expectedType) throws ClassNotFoundException { Class<?> clazz = Util.loadClass(className, fallback); if (expectedType != null && !expectedType.isAssignableFrom(clazz)) { throw new ClassCastException(); } return clazz; }
private static Class<?> loadClass(String className, Object fallback, Class<?> expectedType) throws ClassNotFoundException { Class<?> clazz = Util.loadClass(className, fallback); if (expectedType != null && !expectedType.isAssignableFrom(clazz)) { throw new ClassCastException(); } return clazz; }
private static Class<?> loadClass(String className, Object fallback, Class<?> expectedType) throws ClassNotFoundException { Class<?> clazz = Util.loadClass(className, fallback); if (expectedType != null && !expectedType.isAssignableFrom(clazz)) { throw new ClassCastException(); } return clazz; }
private static Class<?> loadClass(String className, Object fallback, Class<?> expectedType) throws ClassNotFoundException { Class<?> clazz = Util.loadClass(className, fallback); if (expectedType != null && !expectedType.isAssignableFrom(clazz)) { throw new ClassCastException(); } return clazz; }
@Override public UIComponent createComponent(FaceletContext ctx) { UIComponent result = null; try { Class clazz = Util.loadClass("com.sun.faces.component.PassthroughElement", this); result = (UIComponent)clazz.newInstance(); } catch (ClassNotFoundException | IllegalAccessException | InstantiationException cnfe) { throw new FacesException(cnfe); } return result; }
public Class<?> loadScript(String name) { try { String script = name; if (script.endsWith(".groovy")) { script = script.substring(0, script.indexOf(".groovy")); } //return engine.loadScriptByName(script); return Util.loadClass(script, this); } catch (Exception e) { throw new FacesException(e); } }
@Override public UIComponent createComponent(FaceletContext ctx) { UIComponent result = null; try { Class clazz = Util.loadClass("com.sun.faces.component.PassthroughElement", this); result = (UIComponent)clazz.newInstance(); } catch (ClassNotFoundException | IllegalAccessException | InstantiationException cnfe) { throw new FacesException(cnfe); } return result; }
public Class<?> loadScript(String name) { try { String script = name; if (script.endsWith(".groovy")) { script = script.substring(0, script.indexOf(".groovy")); } //return engine.loadScriptByName(script); return Util.loadClass(script, this); } catch (Exception e) { throw new FacesException(e); } }
@Override public UIComponent createComponent(FaceletContext ctx) { UIComponent result = null; try { Class clazz = Util.loadClass("com.sun.faces.component.PassthroughElement", this); result = (UIComponent)clazz.newInstance(); } catch (ClassNotFoundException | IllegalAccessException | InstantiationException cnfe) { throw new FacesException(cnfe); } return result; }
public Class<? extends SystemEvent> getNamedEvent(String name) { Class<? extends SystemEvent> namedEvent = namedEvents.get(name); if (namedEvent == null) { try { namedEvent = Util.loadClass(name, this); } catch (ClassNotFoundException ex) { throw new FacesException ("An unknown event type was specified: " + name, ex); } } if (!ComponentSystemEvent.class.isAssignableFrom(namedEvent)) { throw new ClassCastException(); } return namedEvent; }
@SuppressWarnings("unchecked") public Class<? extends SystemEvent> getNamedEvent(String name) { Class<? extends SystemEvent> namedEvent = namedEvents.get(name); if (namedEvent == null) { try { namedEvent = (Class<? extends SystemEvent>) loadClass(name, this); } catch (ClassNotFoundException ex) { throw new FacesException("An unknown event type was specified: " + name, ex); } } if (!ComponentSystemEvent.class.isAssignableFrom(namedEvent)) { throw new ClassCastException(); } return namedEvent; }
@SuppressWarnings("unchecked") public Class<? extends SystemEvent> getNamedEvent(String name) { Class<? extends SystemEvent> namedEvent = namedEvents.get(name); if (namedEvent == null) { try { namedEvent = (Class<? extends SystemEvent>) loadClass(name, this); } catch (ClassNotFoundException ex) { throw new FacesException("An unknown event type was specified: " + name, ex); } } if (!ComponentSystemEvent.class.isAssignableFrom(namedEvent)) { throw new ClassCastException(); } return namedEvent; }
public static Object newInstance(String name, Class<?> type, Object root) throws Exception { Class<?> delegate = Util.loadClass(name, GroovyHelper.class); try { Constructor decorationCtor = requiresDecoration(delegate, type, root); if (decorationCtor != null) { return decorationCtor.newInstance(root); } else { return delegate.newInstance(); } } catch (Exception e) { throw new FacesException(e); } }
public static Object newInstance(String name, Class<?> type, Object root) throws Exception { Class<?> delegate = Util.loadClass(name, GroovyHelper.class); try { Constructor decorationCtor = requiresDecoration(delegate, type, root); if (decorationCtor != null) { return decorationCtor.newInstance(root); } else { return delegate.newInstance(); } } catch (Exception e) { throw new FacesException(e); } }
@Override public UIComponent createComponent(FaceletContext ctx) { UIComponent result = null; try { Class clazz = Util.loadClass("com.sun.faces.component.PassthroughElement", this); result = (UIComponent)clazz.newInstance(); } catch (ClassNotFoundException cnfe) { throw new FacesException(cnfe); } catch (IllegalAccessException iae) { throw new FacesException(iae); } catch (InstantiationException ie) { throw new FacesException(ie); } return result; }