Examples of ValueConverter


Examples of com.coderskitchen.cdiproperties.converter.spi.ValueConverter

  public void inject(T instance, CreationalContext<T> ctx) {
    it.inject(instance, ctx);
    for (Field field : injectableValues.keySet()) {
      Object value = injectableValues.get(field);
      Class<?> type = field.getType();
      ValueConverter acceptingConverter = ValueConverterFactory.findConverterForFieldType(type);
      setFieldValueOrAddDefinitionError(instance, field, value, acceptingConverter);
    }
  }
View Full Code Here

Examples of com.inspiresoftware.lib.dto.geda.adapter.ValueConverter

  @Test
  public void testWithConversion() throws GeDAException {
    final TestDto3Class dto = new TestDto3Class();
    final TestEntity3Class entity = new TestEntity3Class();
    entity.setDecision(true);
    final ValueConverter conv3toDto = new TestConverter3();
    final Map<String, Object> converters = new HashMap<String, Object>();
    converters.put("boolToEnum", conv3toDto);
   
    final Assembler assembler =
      DTOAssembler.newCustomAssembler(TestDto3Class.class, TestEntity3Class.class, synthesizer);
View Full Code Here

Examples of org.apache.sis.xml.ValueConverter

         * Try to guess if the UOM is a URN or URL. We looks for character that are usually
         * part of URI but not part of unit symbols, for example ':'. We can not search for
         * '/' and '.' since they are part of UCUM representation.
         */
        final Context context = Context.current();
        final ValueConverter converter = Context.converter(context);
        if (uom.indexOf(':') >= 0) {
            final URI uri = converter.toURI(context, uom);
            String part = uri.getFragment();
            if (part != null) {
                uom = part;
                int i = uom.lastIndexOf("@gml:id=");
                if (i >= 0) {
                    i += 8; // 8 is the length of "@gml:id="
                    for (final int length=uom.length(); i<length;) {
                        final int c = uom.codePointAt(i);
                        if (!Character.isWhitespace(c)) {
                            if (c == '\'') i++;
                            break;
                        }
                        i += Character.charCount(c);
                    }
                    final int stop = uom.lastIndexOf('\'');
                    uom = CharSequences.trimWhitespaces((stop > i) ? uom.substring(i, stop) : uom.substring(i));
                }
            } else if ((part = uri.getPath()) != null) {
                uom = new File(part).getName();
            }
        }
        unit = converter.toUnit(context, uom);
    }
View Full Code Here

Examples of org.apache.tapestry.coerce.ValueConverter

    }

    public void testGetObject()
    {
        Map map = newMap("foo.bar", "baz");
        ValueConverter vc = newConverter();
        PortletRequest request = newRequest(map);
        Location l = newLocation();

        replayControls();
View Full Code Here

Examples of org.apache.tapestry.coerce.ValueConverter

        verifyControls();
    }

    public void testGetObjectNoUserInfo()
    {
        ValueConverter vc = newConverter();
        PortletRequest request = newRequest(null);
        Location l = newLocation();

        replayControls();
View Full Code Here

Examples of org.apache.tapestry.coerce.ValueConverter

        String valueConverted = "CONVERTED";

        Map map = new HashMap();

        MockControl converterc = newControl(ValueConverter.class);
        ValueConverter converter = (ValueConverter) converterc.getMock();
        PortletRequest request = newRequest(map);
        Location l = newLocation();

        converter.coerceValue(newValue, String.class);
        converterc.setReturnValue(valueConverted);

        replayControls();

        IBinding b = newBinding("description", converter, l, request, "foo.bar");
View Full Code Here

Examples of org.apache.tapestry.coerce.ValueConverter

*/
public class TestBeanBinding extends HiveMindTestCase
{
    public void testCreate()
    {
        ValueConverter vc = (ValueConverter) newMock(ValueConverter.class);

        MockControl componentc = newControl(IComponent.class);
        IComponent component = (IComponent) componentc.getMock();

        MockControl beanProviderc = newControl(IBeanProvider.class);
View Full Code Here

Examples of org.apache.tapestry.coerce.ValueConverter

        cc.setReturnValue(lm);

        lm.getListener("foo");
        lmc.setReturnValue(listener);

        ValueConverter vc = newValueConverter();

        Location l = newLocation();

        replayControls();
View Full Code Here

Examples of org.apache.tapestry.coerce.ValueConverter

        InjectedValueProvider provider = (InjectedValueProvider) control.getMock();

        provider.obtainValue("spring:bean", l);
        control.setReturnValue(injectedValue);

        ValueConverter converter = newValueConverter();

        replayControls();

        IBinding binding = newBinding(converter, provider, "spring:bean", l);
View Full Code Here

Examples of org.apache.tapestry.coerce.ValueConverter

    public void testObject()
    {
        InjectSpecification spec = newSpec("fooBar", "foo.bar");

        ComponentPropertySource source = newSource();
        ValueConverter converter = (ValueConverter) newMock(ValueConverter.class);

        MockControl control = newControl(EnhancementOperation.class);
        EnhancementOperation op = (EnhancementOperation) control.getMock();

        op.getPropertyType("fooBar");
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.