Examples of coerce()


Examples of org.apache.tapestry5.ioc.services.TypeCoercer.coerce()

    @Test
    public void string_to_select_model_type_coercion_integration()
    {
        TypeCoercer coercer = getService(TypeCoercer.class);

        SelectModel selectModel = coercer.coerce(" UK , USA , DE=Germany ", SelectModel.class);

        assertNull(selectModel.getOptionGroups());
        assertEquals(selectModel.getOptions().size(), 3);

        // Waste of effort to re-test each individual option model.
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.TypeCoercer.coerce()

    {
        TypeCoercer coercer = getObject(TypeCoercer.class, null);

        String input = "\\s+";

        Pattern pattern = coercer.coerce(input, Pattern.class);

        assertEquals(pattern.toString(), input);
    }

    @Test
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.TypeCoercer.coerce()

        TypeCoercer coercer = getObject(TypeCoercer.class, null);

        replay();

        ComponentResources actual = coercer.coerce(input, ComponentResources.class);

        assertSame(actual, resources);

        verify();
    }
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.TypeCoercer.coerce()

        // Force the state of a few services.

        TypeCoercer tc = r.getService("TypeCoercer", TypeCoercer.class);

        tc.coerce("123", Integer.class);

        r.getService("BlueGreeter", Greeter.class);

        // Now get the activity list and poke around.
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.TypeCoercer.coerce()

    @Test
    public void string_to_select_model_type_coercion_integration()
    {
        TypeCoercer coercer = getService(TypeCoercer.class);

        SelectModel selectModel = coercer.coerce(" UK , USA , DE=Germany ", SelectModel.class);

        assertNull(selectModel.getOptionGroups());
        assertEquals(selectModel.getOptions().size(), 3);

        // Waste of effort to re-test each individual option model.
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.TypeCoercer.coerce()

    {
        TypeCoercer coercer = getObject(TypeCoercer.class, null);

        String input = "\\s+";

        Pattern pattern = coercer.coerce(input, Pattern.class);

        assertEquals(pattern.toString(), input);
    }

    @Test
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.TypeCoercer.coerce()

        TypeCoercer coercer = getObject(TypeCoercer.class, null);

        replay();

        ComponentResources actual = coercer.coerce(input, ComponentResources.class);

        assertSame(actual, resources);

        verify();
    }
View Full Code Here

Examples of org.eclipse.jst.jsf.context.symbol.IObjectSymbol.coerce()

                if (prop != null)
                {
                    return prop;
                }
               
                typeDesc = objSymbol.coerce(TypeConstants.TYPE_MAP);

                // handle string keys into maps that contain dots.  Because type descriptor
                // handle dotted property ids (i.e. 'x.y.z') as separate properties with
                // intermediate parts, we need to handle this specially.
                if (propertyId instanceof String && ((String)propertyId).indexOf('.')>-1)
View Full Code Here

Examples of org.jboss.util.coerce.CoercionHandler.coerce()

      // find a handler that can take a type object, let it decide if it
      // can actually coerce the correct object from value
      if (CoercionHandler.isInstalled(type)) {
         CoercionHandler handler = CoercionHandler.create(type);
         return handler.coerce(value, type);
      }

      // see if type has a construct that takes a value object
      //
      // NOTE: Just because the target type has a compatible constructor
View Full Code Here

Examples of org.jruby.util.TypeCoercer.coerce()

       
        if (coercer == null) {
            throw ruby.newTypeError("Cannot coerce Fixnum to " + javaClass.getCanonicalName());
        }
       
        return coercer.coerce(self);
    }
   
    private static final Map<Class, TypeCoercer> JAVA_COERCERS = new HashMap<Class, TypeCoercer>();
   
    static {
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.