Examples of canConvert()


Examples of gluebooster.spring.convert.HandlerMappingConversionService.canConvert()

    if (DocumentationResourecesId.DOCUMENTATION_TECHNICAL.equals(type)){
      BoostedNode mappingNode = BookUtils.createChapter(documentationRoot, mapping.getClass().getSimpleName());
     
     
      HandlerMappingConversionService conversion = HandlerMappingConversionService.createToStringMapConverter();
      if (conversion.canConvert(mapping.getClass(), Map.class)){
        Map<String, ?>mappings = conversion.convert(mapping, Map.class);
        for (String key: mappings.keySet()){
          BookUtils.createDiv(mappingNode, key);
        }
      }
View Full Code Here

Examples of net.buffalo.protocal.converters.Converter.canConvert()

 
  public void testShouldOutputBoolean() throws Exception {
    Converter serializer = new BooleanConverter();
    assertEquals("<boolean>1</boolean>", marshal(serializer, Boolean.TRUE));
    assertEquals("<boolean>0</boolean>", marshal(serializer, Boolean.FALSE));
    assertTrue(serializer.canConvert(Boolean.class));
    assertFalse(serializer.canConvert(Long.class));
  }
 
  public void testMethodInvokation() throws Exception {
    Calculator c = new Calculator();
View Full Code Here

Examples of net.buffalo.protocal.converters.SqlDateConverter.canConvert()

public class SqlDateConverterTest extends TestCase {
  public void testShouldConverterSqlDate() throws Exception {
    java.sql.Date sdate = new java.sql.Date(new java.util.Date(2006-1900, 10, 1).getTime());
    SqlDateConverter converter = new SqlDateConverter();
   
    assertTrue(converter.canConvert(sdate.getClass()));
    assertFalse(converter.canConvert(java.util.Date.class));
   
    StringWriter stringWriter = new StringWriter();
    StreamWriter streamWriter = new FastStreamWriter(stringWriter);
   
View Full Code Here

Examples of net.buffalo.protocal.converters.basic.BooleanConverter.canConvert()

 
  public void testShouldOutputBoolean() throws Exception {
    Converter serializer = new BooleanConverter();
    assertEquals("<boolean>1</boolean>", marshal(serializer, Boolean.TRUE));
    assertEquals("<boolean>0</boolean>", marshal(serializer, Boolean.FALSE));
    assertTrue(serializer.canConvert(Boolean.class));
    assertFalse(serializer.canConvert(Long.class));
  }
 
  public void testMethodInvokation() throws Exception {
    Calculator c = new Calculator();
View Full Code Here

Examples of net.buffalo.protocal.converters.basic.DateConverter.canConvert()

    assertEquals("<string>c</string>", marshal(serializer, character));
  }
 
  public void testCanOutputDate() throws Exception {
    DateConverter ds = new DateConverter();
    assertTrue(ds.canConvert(Date.class));
    assertFalse(ds.canConvert(null));
   
    Calendar cal = Calendar.getInstance();
    cal.set(2006, 7, 1, 17, 54, 21);
    Date d = cal.getTime();
View Full Code Here

Examples of net.buffalo.protocal.converters.basic.DoubleConverter.canConvert()

   
  }
 
  public void testDoubleSerializerCanOutputFloatAndDouble() throws Exception {
    DoubleConverter ds = new DoubleConverter();
    assertTrue(ds.canConvert(Double.class));
    assertTrue(ds.canConvert(Float.class));
  }
 
  public void testShouldOutputLong() {
    LongConverter serializer = new LongConverter();
View Full Code Here

Examples of net.buffalo.protocal.converters.basic.IntegerConverter.canConvert()

 
  public void testShouldOutputInt() {
    IntegerConverter serializer = new IntegerConverter();
    assertEquals("<int>123</int>", marshal(new IntegerConverter(), new Integer(123)));
    assertEquals("<int>234</int>", marshal(new IntegerConverter(), new Integer(234)));
    assertTrue(serializer.canConvert(Integer.class));
    assertFalse(serializer.canConvert(Long.class));
  }
 
  public void testShouldOutputShortAndByteToInt() {
    IntegerConverter serializer = new IntegerConverter();
View Full Code Here

Examples of net.buffalo.protocal.converters.basic.LongConverter.canConvert()

 
  public void testShouldOutputLong() {
    LongConverter serializer = new LongConverter();
    assertEquals("<long>123</long>", marshal(serializer, new Long(123)));
    assertEquals("<long>234</long>", marshal(serializer, new Long(234)));
    assertTrue(serializer.canConvert(Long.class));
    assertFalse(serializer.canConvert(String.class));
  }
 
  public void testShouldOutputNull() {
    NullConverter serializer = new NullConverter();
View Full Code Here

Examples of net.buffalo.protocal.converters.basic.NullConverter.canConvert()

  }
 
  public void testShouldOutputNull() {
    NullConverter serializer = new NullConverter();
    assertEquals("<null></null>", marshal(serializer, null));
    assertTrue(serializer.canConvert(null));
    assertFalse(serializer.canConvert(ArrayList.class));
  }
 
  public void testShouldOutputString() {
    StringConverter serializer = new StringConverter();
View Full Code Here

Examples of net.buffalo.protocal.converters.basic.StringConverter.canConvert()

  }
 
  public void testShouldOutputString() {
    StringConverter serializer = new StringConverter();
    assertEquals("<string>hello, world</string>", marshal(serializer, "hello, world"));
    assertTrue(serializer.canConvert(String.class));
    assertFalse(serializer.canConvert(null));
  }
 
  public void testShouldEscapeXmlString() {
    StringConverter serializer = new StringConverter();
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.