Examples of Coercion


Examples of org.apache.tapestry.ioc.services.Coercion

        // Is a coercion even necessary? Not if the target type is assignable from the
        // input value.

        if (effectiveTargetType.isAssignableFrom(sourceType)) return input;

        Coercion coercion = findCoercion(sourceType, effectiveTargetType);

        Object result;

        try
        {
            result = coercion.coerce(input);
        }
        catch (Exception ex)
        {
            throw new RuntimeException(ServiceMessages.failedCoercion(
                    input,
View Full Code Here

Examples of org.apache.tapestry.ioc.services.Coercion

        // Is a coercion even necessary? Not if the target type is assignable from the
        // input value.

        if (effectiveTargetType.isAssignableFrom(inputType)) return "";

        Coercion coercion = findCoercion(inputType, effectiveTargetType);

        return coercion.toString();
    }
View Full Code Here

Examples of org.apache.tapestry.ioc.services.Coercion

    private Coercion findCoercion(Class sourceType, Class targetType)
    {
        CacheKey key = new CacheKey(sourceType, targetType);

        Coercion result = _cache.get(key);

        if (result == null)
        {
            result = findOrCreateCoercion(sourceType, targetType);
            _cache.put(key, result);
View Full Code Here

Examples of org.apache.tapestry.ioc.services.Coercion

                // The intermediateTuple coercer gets from S --> I1 (an intermediate type).
                // The current tuple's coercer gets us from I2 --> X. where I2 is assignable
                // from I1 (i.e., I2 is a superclass/superinterface of I1) and X is a new
                // intermediate type, hopefully closer to our eventual target type.

                Coercion compoundCoercer = new CompoundCoercion(intermediateTuple.getCoercion(),
                        tuple.getCoercion());

                CoercionTuple compoundTuple = new CoercionTuple(sourceType, newIntermediateType,
                        compoundCoercer, false);
View Full Code Here

Examples of org.apache.tapestry.ioc.services.Coercion

        // Is a coercion even necessary? Not if the target type is assignable from the
        // input value.

        if (effectiveTargetType.isAssignableFrom(sourceType)) return input;

        Coercion coercion = findCoercion(sourceType, effectiveTargetType);

        Object result;

        try
        {
            result = coercion.coerce(input);
        }
        catch (Exception ex)
        {
            throw new RuntimeException(ServiceMessages.failedCoercion(
                    input,
View Full Code Here

Examples of org.apache.tapestry.ioc.services.Coercion

        // Is a coercion even necessary? Not if the target type is assignable from the
        // input value.

        if (effectiveTargetType.isAssignableFrom(inputType)) return "";

        Coercion coercion = findCoercion(inputType, effectiveTargetType);

        return coercion.toString();
    }
View Full Code Here

Examples of org.apache.tapestry.ioc.services.Coercion

    private Coercion findCoercion(Class sourceType, Class targetType)
    {
        CacheKey key = new CacheKey(sourceType, targetType);

        Coercion result = _cache.get(key);

        if (result == null)
        {
            result = findOrCreateCoercion(sourceType, targetType);
            _cache.put(key, result);
View Full Code Here

Examples of org.apache.tapestry.ioc.services.Coercion

                // The intermediateTuple coercer gets from S --> I1 (an intermediate type).
                // The current tuple's coercer gets us from I2 --> X. where I2 is assignable
                // from I1 (i.e., I2 is a superclass/superinterface of I1) and X is a new
                // intermediate type, hopefully closer to our eventual target type.

                Coercion compoundCoercer = new CompoundCoercion(intermediateTuple.getCoercion(),
                                                                tuple.getCoercion());

                CoercionTuple compoundTuple = new CoercionTuple(sourceType, newIntermediateType,
                                                                compoundCoercer, false);
View Full Code Here

Examples of org.apache.tapestry.ioc.services.Coercion

        // Is a coercion even necessary? Not if the target type is assignable from the
        // input value.

        if (effectiveTargetType.isAssignableFrom(sourceType)) return input;

        Coercion coercion = findCoercion(sourceType, effectiveTargetType);

        Object result;

        try
        {
            result = coercion.coerce(input);
        }
        catch (Exception ex)
        {
            throw new RuntimeException(ServiceMessages.failedCoercion(
                    input,
View Full Code Here

Examples of org.apache.tapestry.ioc.services.Coercion

        // Is a coercion even necessary? Not if the target type is assignable from the
        // input value.

        if (effectiveTargetType.isAssignableFrom(inputType)) return "";

        Coercion coercion = findCoercion(inputType, effectiveTargetType);

        return coercion.toString();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.