Package org.soybeanMilk.core.bean

Examples of org.soybeanMilk.core.bean.GenericConverter


  @Test
  public void parse_genericConverter_noClassAttr() throws Exception
  {
    config=new ConfigurationParser().parse("org/soybeanMilk/test/unit/core/TestConfigurationParser-genericConverter-noClassAttr.xml");
   
    GenericConverter gc=config.getGenericConverter();
   
    Assert.assertEquals(DefaultGenericConverter.class, gc.getClass());
    Assert.assertEquals(TestConverter.class, gc.getConverter(String.class, int.class).getClass());
    Assert.assertEquals(TestConverter.class, gc.getConverter(String.class, float.class).getClass());
  }
View Full Code Here


  @Test
  public void parse_genericConverter_hasClassAttr() throws Exception
  {
    config=new ConfigurationParser().parse("org/soybeanMilk/test/unit/core/TestConfigurationParser-genericConverter-hasClassAttr.xml");
   
    GenericConverter gc=config.getGenericConverter();
   
    Assert.assertEquals(MyGenericConverter.class, gc.getClass());
  }
View Full Code Here

  protected Object convertGotObject(Object sourceObj, Type targetType) throws ObjectSourceException
  {
    if(targetType==null)
      return sourceObj;
   
    GenericConverter converter=getGenericConverter();
   
    if(converter == null)
      return sourceObj;
    else
    {
View Full Code Here

  {
    Element cvtEl = getSingleElementByTagName(parent, TAG_GENERIC_CONVERTER);
   
    String clazz = cvtEl==null ? null : getAttributeValueIngoreEmpty(cvtEl, TAG_GENERIC_CONVERTER_ATTR_CLASS);
   
    GenericConverter genericConverter = configuration.getGenericConverter();
    if(genericConverter == null)
    {
      if(clazz==null || clazz.length()==0)
        genericConverter = createGenericConverterInstance();
      else
View Full Code Here

TOP

Related Classes of org.soybeanMilk.core.bean.GenericConverter

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.