Package org.jdbf.castor

Examples of org.jdbf.castor.TypeConvertor


       

        //first convert from java.sql.Date to java.util.Date

        TypeConvertor convertor = Types.getConvertor(fromClass,toClass);           

        propertyValue = convertor.convert(propertyValue,null);           

        fromClass = toClass;

        toClass = ReflectionManager.getPropertyType(object,item.getPropertyName());

       

        //then convert from java.util.Date in specific class

        convertor = Types.getConvertor(fromClass,toClass);

        String formatPattern = item.getFormatPattern();

        propertyValue = convertor.convert(propertyValue,formatPattern);       

    }

    catch(ClassNotFoundException e){

       logger.throwing(className,"convertValue()",

           new MappingException(e));

       //throw new MappingException(e);

    }

      }

      else{

          TypeConvertor convertor = Types.getConvertor(fromClass,toClass);           

    propertyValue = convertor.convert(propertyValue,null);     

      }

  }
View Full Code Here

TOP

Related Classes of org.jdbf.castor.TypeConvertor

Copyright © 2018 www.massapicom. 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.