/** * Creates an instance of a class with the given fully qualified class name. * * @param <T> The generic object type. * @param className fully qualified class name of the class for which an instance needs to be created * @return an instance of the class denoted by className * @throws IllegalStateException if the class cannot be found */ @SuppressWarnings("unchecked") public static <T> T instance(String className) { return (T) instance(toClass(className)); }
/** * Creates an instance of a class with the given fully qualified class name. * * @param <T> The generic object type. * @param className fully qualified class name of the class for which an instance needs to be created * @return an instance of the class denoted by className * @throws IllegalStateException if the class cannot be found */ @SuppressWarnings("unchecked") public static <T> T instance(String className) { return (T) instance(toClass(className)); }
/** * Creates an instance of a class with the given fully qualified class name. * * @param <T> The generic object type. * @param className fully qualified class name of the class for which an instance needs to be created * @return an instance of the class denoted by className * @throws IllegalStateException if the class cannot be found */ @SuppressWarnings("unchecked") public static <T> T instance(String className) { return (T) instance(toClass(className)); }
public static Copier getCopier(FacesContext context, String copierType) { Copier copier = null; if (!isEmpty(copierType)) { // TODO: or should validate only against {"MultiStrategyCopier", "SerializationCopier", // "NewInstanceCopier", "CopyCtorCopier", "CloneCopier"} strings / enum if (isCopierTypeSimpleName(copierType)) { copierType = COPIER_PREFIX.concat(copierType); } else if (!isName(copierType)) { throw new IllegalArgumentException(ERROR_COPIER_NAME); } Object expressionResult = evaluateExpressionGet(context, copierType); if (expressionResult instanceof Copier) { copier = (Copier) expressionResult; } else if (expressionResult instanceof String) { copier = instance((String) expressionResult); } } if (copier == null) { copier = new MultiStrategyCopier(); } return copier; }
public static Copier getCopier(FacesContext context, String copierType) { Copier copier = null; if (!isEmpty(copierType)) { // TODO: or should validate only against {"MultiStrategyCopier", "SerializationCopier", // "NewInstanceCopier", "CopyCtorCopier", "CloneCopier"} strings / enum if (isCopierTypeSimpleName(copierType)) { copierType = COPIER_PREFIX.concat(copierType); } else if (!isName(copierType)) { throw new IllegalArgumentException(ERROR_COPIER_NAME); } Object expressionResult = evaluateExpressionGet(context, copierType); if (expressionResult instanceof Copier) { copier = (Copier) expressionResult; } else if (expressionResult instanceof String) { copier = instance((String) expressionResult); } } if (copier == null) { copier = new MultiStrategyCopier(); } return copier; }
public static Copier getCopier(FacesContext context, String copierType) { Copier copier = null; if (!isEmpty(copierType)) { // TODO: or should validate only against {"MultiStrategyCopier", "SerializationCopier", // "NewInstanceCopier", "CopyCtorCopier", "CloneCopier"} strings / enum if (isCopierTypeSimpleName(copierType)) { copierType = COPIER_PREFIX.concat(copierType); } else if (!isName(copierType)) { throw new IllegalArgumentException(ERROR_COPIER_NAME); } Object expressionResult = evaluateExpressionGet(context, copierType); if (expressionResult instanceof Copier) { copier = (Copier) expressionResult; } else if (expressionResult instanceof String) { copier = instance((String) expressionResult); } } if (copier == null) { copier = new MultiStrategyCopier(); } return copier; }