public static Object newInstance(String type, Class expectedType) throws FacesException { return newInstance(type, expectedType == null ? null : new Class[] {expectedType}); }
public static Object newInstance(String type, Class expectedType) throws FacesException { return newInstance(type, expectedType == null ? null : new Class[] {expectedType}); }
public static Object newInstance(String type, Class expectedType) throws FacesException { return newInstance(type, expectedType == null ? null : new Class[] {expectedType}); }
private Object createClass(String className, ExternalContext externalContext) throws InstantiationException, IllegalAccessException, InvocationTargetException, ClassNotFoundException { Class<?> clazz = ClassUtils.classForName(className); try { return ClassUtils.newInstance(clazz, new Class<?>[]{ ExternalContext.class }, externalContext); } catch (NoSuchMethodException e) { return ClassUtils.newInstance(clazz); } }
private Object createClass(String className, ExternalContext externalContext) throws InstantiationException, IllegalAccessException, InvocationTargetException, ClassNotFoundException { Class<?> clazz = ClassUtils.classForName(className); try { return ClassUtils.newInstance(clazz, new Class<?>[]{ ExternalContext.class }, externalContext); } catch (NoSuchMethodException e) { return ClassUtils.newInstance(clazz); } }
public static Object newInstance(String type) throws FacesException { if (type == null) return null; return newInstance(simpleClassForName(type)); }
public static Object newInstance(String type) throws FacesException { if (type == null) return null; return newInstance(simpleClassForName(type)); }
public void restoreState(FacesContext context, Object state) { if (state instanceof ValueBinding) { _valueBinding = (ValueBinding) state; } else if (state != null) { Object[] stateArray = (Object[]) state; _valueBinding = (ValueBinding) ClassUtils.newInstance((String) stateArray[0], ValueBinding.class); ((StateHolder) _valueBinding).restoreState(context, stateArray[1]); } }
public static Object newInstance(String type) throws FacesException { if (type == null) return null; return newInstance(simpleClassForName(type)); }
public void restoreState(FacesContext context, Object state) { if (state instanceof ValueBinding) { _valueBinding = (ValueBinding) state; } else if (state != null) { Object[] stateArray = (Object[]) state; _valueBinding = (ValueBinding) ClassUtils.newInstance((String) stateArray[0], ValueBinding.class); ((StateHolder) _valueBinding).restoreState(context, stateArray[1]); } }
public void restoreState(FacesContext context, Object state) { if (state instanceof ValueBinding) { _valueBinding = (ValueBinding) state; } else if (state != null) { Object[] stateArray = (Object[]) state; _valueBinding = (ValueBinding) ClassUtils.newInstance((String) stateArray[0], ValueBinding.class); ((StateHolder) _valueBinding).restoreState(context, stateArray[1]); } }
public static Object build(ExternalContext ectx, Class spiClass, String defaultImpl) { List<String> classList = ServiceProviderFinderFactory.getServiceProviderFinder(ectx).getServiceProviderList(spiClass.getName()); if (classList != null && !classList.isEmpty()) { if (classList.size() > 1) { getLogger().log(Level.WARNING, "More than one SPI interface for "+spiClass.getName()+ " found :" + classList.toString() + ". Setting up the first one found."); } return ClassUtils.newInstance(classList.get(0)); } return ClassUtils.newInstance(defaultImpl); }
public void restoreState(FacesContext facesContext, Object state) { if (state != null) { if (state instanceof ValueExpression) { _valueExpression = (ValueExpression) state; } else { Object[] stateArray = (Object[]) state; _valueExpression = (ValueExpression) ClassUtils.newInstance((String) stateArray[0], ValueExpression.class); ((StateHolder) _valueExpression).restoreState(facesContext, stateArray[1]); } } }
public void restoreState(FacesContext facesContext, Object state) { if (state != null) { if (state instanceof ValueExpression) { _valueExpression = (ValueExpression) state; } else { Object[] stateArray = (Object[]) state; _valueExpression = (ValueExpression) ClassUtils.newInstance((String) stateArray[0], ValueExpression.class); ((StateHolder) _valueExpression).restoreState(facesContext, stateArray[1]); } } }
public static Object build(ExternalContext ectx, Class spiClass, String defaultImpl) { List<String> classList = ServiceProviderFinderFactory.getServiceProviderFinder(ectx).getServiceProviderList(spiClass.getName()); if (classList != null && !classList.isEmpty()) { if (classList.size() > 1) { getLogger().log(Level.WARNING, "More than one SPI interface for "+spiClass.getName()+ " found :" + classList.toString() + ". Setting up the first one found."); } return ClassUtils.newInstance(classList.get(0)); } return ClassUtils.newInstance(defaultImpl); }
public void restoreState(FacesContext facesContext, Object state) { if (state != null) { if (state instanceof ValueExpression) { _valueExpression = (ValueExpression) state; } else { Object[] stateArray = (Object[]) state; _valueExpression = (ValueExpression) ClassUtils.newInstance((String) stateArray[0], ValueExpression.class); ((StateHolder) _valueExpression).restoreState(facesContext, stateArray[1]); } } }
public static Object newInstance(String type, Class[] expectedTypes) { if (type == null) return null; Class clazzForName = simpleClassForName(type); if(expectedTypes != null) { for (int i = 0, size = expectedTypes.length; i < size; i++) { if (!expectedTypes[i].isAssignableFrom(clazzForName)) { throw new FacesException("'" + type + "' does not implement expected type '" + expectedTypes[i] + "'"); } } } return newInstance(clazzForName); }
public static Object newInstance(String type, Class[] expectedTypes) { if (type == null) return null; Class clazzForName = simpleClassForName(type); if(expectedTypes != null) { for (int i = 0, size = expectedTypes.length; i < size; i++) { if (!expectedTypes[i].isAssignableFrom(clazzForName)) { throw new FacesException("'" + type + "' does not implement expected type '" + expectedTypes[i] + "'"); } } } return newInstance(clazzForName); }
public static Object newInstance(String type, Class[] expectedTypes) { if (type == null) return null; Class clazzForName = simpleClassForName(type); if(expectedTypes != null) { for (int i = 0, size = expectedTypes.length; i < size; i++) { if (!expectedTypes[i].isAssignableFrom(clazzForName)) { throw new FacesException("'" + type + "' does not implement expected type '" + expectedTypes[i] + "'"); } } } return newInstance(clazzForName); }
private PhaseListener getPhaseListnerInstance(ValueExpression binding, ValueExpression type) { FacesContext currentFacesContext = FacesContext.getCurrentInstance(); Object phasesInstance = null; if (binding != null) { phasesInstance = binding.getValue(currentFacesContext.getELContext()); } else if (type != null) { try { phasesInstance = ClassUtils.newInstance((String)type.getValue(currentFacesContext.getELContext())); } catch (FacesException ex) { throw new AbortProcessingException(ex.getMessage(), ex); } } return (PhaseListener) phasesInstance; }