Examples of IntegerConverter


Examples of org.apache.wicket.util.convert.converter.IntegerConverter

  /**
   * Test integer conversions.
   */
  public void testIntegerConversions()
  {
    IntegerConverter converter = new IntegerConverter();
    assertEquals("7", converter.convertToString(7, Locale.US));
    assertNull(converter.convertToObject("", Locale.US));
    assertEquals(new Integer(10), converter.convertToObject("10", Locale.US));
    assertEquals("10", converter.convertToString(10, Locale.US));
    try
    {
      converter.convertToObject("whatever", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
    }
    try
    {
      converter.convertToObject("10whatever", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
    }
    try
    {
      converter.convertToObject("" + ((long)Integer.MAX_VALUE + 1), Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
View Full Code Here

Examples of org.apache.wicket.util.convert.converter.IntegerConverter

  /**
   * Test integer conversions.
   */
  public void testIntegerConversions()
  {
    IntegerConverter converter = new IntegerConverter();
    assertEquals(new Integer(10), converter.convertToObject("10", Locale.US));
    assertEquals("10", converter.convertToString(new Integer(10), Locale.US));
    try
    {
      converter.convertToObject("whatever", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
    }
    try
    {
      converter.convertToObject("10whatever", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
    }
    try
    {
      converter.convertToObject("" + ((long)Integer.MAX_VALUE + 1), Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
View Full Code Here

Examples of org.apache.wicket.util.convert.converter.IntegerConverter

  /**
   * Test integer conversions.
   */
  public void testIntegerConversions()
  {
    IntegerConverter converter = new IntegerConverter();
    assertEquals(new Integer(10), converter.convertToObject("10", Locale.US));
    assertEquals("10", converter.convertToString(10, Locale.US));
    try
    {
      converter.convertToObject("whatever", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
    }
    try
    {
      converter.convertToObject("10whatever", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
    }
    try
    {
      converter.convertToObject("" + ((long)Integer.MAX_VALUE + 1), Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // This is correct
View Full Code Here

Examples of org.dmrad.view.util.type.IntegerConverter

      } else if (propertyClass == Integer.class) {
        textField = new TextField("propertyValue", new PropertyModel(
            entity, propertyCode, propertyClass)) {
          static final long serialVersionUID = 200911L;
          public IConverter getConverter() {
            return new IntegerConverter();
          }
        };
        textField.setType(Integer.class);
      } else if (propertyClass == Long.class) {
        textField = new TextField("propertyValue", new PropertyModel(
View Full Code Here

Examples of org.dozer.converters.IntegerConverter

  private IntegerConverter converter;

  @Before
  public void setUp() throws Exception {
    converter = new IntegerConverter();
  }
View Full Code Here

Examples of org.mongodb.morphia.converters.IntegerConverter

        @Override
        public Object decode(final Class targetClass, final Object fromDBObject, final MappedField optionalExtraInfo) {
            if (fromDBObject == null) {
                return null;
            }
            final IntegerConverter intConverter = new IntegerConverter();
            final Integer i = (Integer) intConverter.decode(targetClass, fromDBObject, optionalExtraInfo);
            return (char) i.intValue();
        }
View Full Code Here

Examples of org.more.convert.convert.IntegerConverter

        this.register(Boolean.TYPE, throwException ? new BooleanConverter() : new BooleanConverter(Boolean.FALSE));
        this.register(Byte.TYPE, throwException ? new ByteConverter() : new ByteConverter(ConverterBean.ZERO));
        this.register(Character.TYPE, throwException ? new CharacterConverter() : new CharacterConverter(ConverterBean.SPACE));
        this.register(Double.TYPE, throwException ? new DoubleConverter() : new DoubleConverter(ConverterBean.ZERO));
        this.register(Float.TYPE, throwException ? new FloatConverter() : new FloatConverter(ConverterBean.ZERO));
        this.register(Integer.TYPE, throwException ? new IntegerConverter() : new IntegerConverter(ConverterBean.ZERO));
        this.register(Long.TYPE, throwException ? new LongConverter() : new LongConverter(ConverterBean.ZERO));
        this.register(Short.TYPE, throwException ? new ShortConverter() : new ShortConverter(ConverterBean.ZERO));
    }
View Full Code Here

Examples of org.openpnp.gui.support.IntegerConverter

  }

    @Override
    public void createBindings() {
        LengthConverter lengthConverter = new LengthConverter();
        IntegerConverter intConverter = new IntegerConverter();
        BufferedImageIconConverter imageConverter = new BufferedImageIconConverter();
       
//        bind(UpdateStrategy.READ_WRITE, zippynozzletip, "pixelComp", pixelCompJTF, "location");
       
        MutableLocationProxy nozzleOffsets = new MutableLocationProxy();
View Full Code Here

Examples of org.projectforge.web.wicket.converter.IntegerConverter

          "id"), 0, 99) {
        @SuppressWarnings({ "rawtypes", "unchecked"})
        @Override
        public IConverter getConverter(final Class type)
        {
          return new IntegerConverter(2);
        }
      };
      if (isNew() == false) {
        nummerField.setEnabled(false);
      }
View Full Code Here

Examples of org.soybeanMilk.core.bean.converters.IntegerConverter

    addConverter(String.class, Boolean.class, new BooleanConverter());
    addConverter(String.class, Byte.class, new ByteConverter());
    addConverter(String.class, Character.class, new CharacterConverter());
    addConverter(String.class, Double.class, new DoubleConverter());
    addConverter(String.class, Float.class, new FloatConverter());
    addConverter(String.class, Integer.class, new IntegerConverter());
    addConverter(String.class, Long.class, new LongConverter());
    addConverter(String.class, Short.class, new ShortConverter());
   
    //其他
    addConverter(String.class, java.math.BigDecimal.class, new BigDecimalConverter());
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.