Package org.apache.tapestry5.ioc.util

Examples of org.apache.tapestry5.ioc.util.UnknownValueException


            if (adapter == null)
            {
                List<String> names = classAdapter.getPropertyNames();

                throw new UnknownValueException(String.format(
                        "Class %s does not contain a property (or public field) named '%s'.", activeType.getName(),
                        propertyName), new AvailableValues("Properties (and public fields)", names));
            }

            return createExpressionTermInfoForProperty(adapter);
View Full Code Here


        }

        // This is a minor misuse of the UnknownValueException but the exception reporting
        // is too useful to pass up.

        throw new UnknownValueException(
                String
                        .format(
                                "Unable to create a client URL for classpath resource %s: The resource path was not within an aliased path.",
                                resourcePath), new AvailableValues("Aliased paths", aliasToPathPrefix.values()));
    }
View Full Code Here

        guesses.size() == 1 ? "matching" : "matching any of",

        InternalUtils.joinSorted(guesses));

        throw new UnknownValueException(message, new AvailableValues("Formal parameters", model
                .getDeclaredParameterNames()));
    }
View Full Code Here

    private PersistentFieldStrategy getStrategy(String strategyName)
    {
        PersistentFieldStrategy result = strategies.get(strategyName);

        if (result == null)
            throw new UnknownValueException(String.format("'%s' is not a defined persistent strategy.", strategyName),
                    new AvailableValues("Configured persistent field strategies", strategies));

        return result;
    }
View Full Code Here

        if (embeddedElement == null)
        {
            Set<String> ids = InternalUtils.keys(children);

            throw new UnknownValueException(String.format("Component %s does not contain embedded component '%s'.",
                    getCompleteId(), embeddedId), new AvailableValues("Embedded components", ids));
        }

        return embeddedElement;
    }
View Full Code Here

    public Translator get(String name)
    {
        Translator result = nameToTranslator.get(name);

        if (result == null)
            throw new UnknownValueException(String.format("Unknown translator type '%s'.", name), new AvailableValues(
                    "Configured translators", nameToTranslator));

        return result;
    }
View Full Code Here

    {
        NullFieldStrategy result = configuration.get(name);

        if (result != null) return result;
       
        throw new UnknownValueException(String.format("Unrecognized name '%s' locating a null field strategy.", name),
                new AvailableValues("Configured null field strategies", configuration));

    }
View Full Code Here

            return null;

        T result = stringToEnum.get(input);

        if (result == null)
            throw new UnknownValueException(
                    PublicUtilMessages.missingEnumValue(input, enumClass, stringToEnum.keySet()), new AvailableValues(
                            enumClass.getName() + " enum constants", stringToEnum));

        return result;
    }
View Full Code Here

    private Module locateModuleForService(String serviceId)
    {
        Module module = serviceIdToModule.get(serviceId);

        if (module == null)
            throw new UnknownValueException(String.format("Service id '%s' is not defined by any module.", serviceId),
                    new AvailableValues("Defined service ids", serviceIdToModule));

        return module;
    }
View Full Code Here

        }

        // Not found anywhere. Identify the source and target type and a (sorted) list of
        // all the known coercions.

        throw new UnknownValueException(String.format("Could not find a coercion from type %s to type %s.",
                sourceType.getName(), targetType.getName()), buildCoercionCatalog());
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.ioc.util.UnknownValueException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.