/** * Find the bean name of the supplied class. This method will try to resolve * the bean name by calling all registered implementations of * {@link ELBeanNameResolver}. This method will either return the resolved name * or throw an {@link IllegalStateException}, if no resolver knows the name * of the bean. * * @param clazz The class of the bean * @return The resolved bean name * @throws IllegalStateException If the name of the bean cannot be resolved */ public String findBeanName(Class<?> clazz) throws IllegalStateException { // process all resolvers for (ELBeanNameResolver resolver : resolvers) { // try to resolve bean name with current resolver String name = resolver.getBeanName(clazz); // return the bean name, if the resolver was successful if (name != null) { return name; } } // No resolver knows the name of the bean throw new IllegalStateException("Cannot find name of bean '" + clazz.getName() + "'! You should place a @URLBeanName annotation on this class to let PrettyFaces know its name."); }
/** * Find the bean name of the supplied class. This method will try to resolve * the bean name by calling all registered implementations of * {@link ELBeanNameResolver}. This method will either return the resolved name * or throw an {@link IllegalStateException}, if no resolver knows the name * of the bean. * * @param clazz The class of the bean * @return The resolved bean name * @throws IllegalStateException If the name of the bean cannot be resolved */ public String findBeanName(Class<?> clazz) throws IllegalStateException { // process all resolvers for (ELBeanNameResolver resolver : resolvers) { // try to resolve bean name with current resolver String name = resolver.getBeanName(clazz); // return the bean name, if the resolver was successful if (name != null) { return name; } } // No resolver knows the name of the bean throw new IllegalStateException("Cannot find name of bean '" + clazz.getName() + "'! You should place a @URLBeanName annotation on this class to let PrettyFaces know its name."); }
/** * Find the bean name of the supplied class. This method will try to resolve * the bean name by calling all registered implementations of * {@link ELBeanNameResolver}. This method will either return the resolved name * or throw an {@link IllegalStateException}, if no resolver knows the name * of the bean. * * @param clazz The class of the bean * @return The resolved bean name * @throws IllegalStateException If the name of the bean cannot be resolved */ public String findBeanName(Class<?> clazz) throws IllegalStateException { // process all resolvers for (ELBeanNameResolver resolver : resolvers) { // try to resolve bean name with current resolver String name = resolver.getBeanName(clazz); // return the bean name, if the resolver was successful if (name != null) { return name; } } // No resolver knows the name of the bean throw new IllegalStateException("Cannot find name of bean '" + clazz.getName() + "'! You should place a @URLBeanName annotation on this class to let PrettyFaces know its name."); }