Package org.apache.shale.util

Examples of org.apache.shale.util.ConverterHelper.asString()


    // test how Clay would use it to convert a string property into a target String[]
    public void testDefaults() {
        ConverterHelper helper = new ConverterHelper();
        String[] partialTriggers = {"one", "two", "three"};
        String asString = helper.asString(facesContext, String[].class, partialTriggers);
       
        assertNotNull(asString);
        assertEquals("one two three", asString);
       
        String[] asObject = (String[]) helper.asObject(facesContext, String[].class, asString);
View Full Code Here


      // target type is String
      if (cl == String.class) {
          if (obj instanceof String) {
             return obj;
          } else {
             return converterHelper.asString(context, obj.getClass(), obj);
          }
      }
     
      if (obj instanceof String) {  
          // String to object
View Full Code Here

      if (obj instanceof String) {  
          // String to object
          return converterHelper.asObject(context, cl, (String) obj)
      } else {
          //Object to String
          String source = converterHelper.asString(context, obj.getClass(), obj);
          // String to Object
          return converterHelper.asObject(context, cl, source);
      }

   }
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.