Hello,

 

    The interface that I’m implementing has 2 getter methods that return type “Class” and it blows up every time on the getXXXX method calls.  So I did some digging around with the Smart Translator and there is no editor for type Class which is by design.

 

Is there a reason for the Smart Translator not supporting other java fundamental types (i.e. Class)?  

 

I modified the  SmartTranslator.java  translate method  and it seemed to work and it passed all Unit Tests.

 

public Object translate(Module contributingModule, Class propertyType, String inputValue)

{

 

  if (e == null)

  {

    if( propertyType.getName().equals("java.lang.Class") )

    {

      ClassResolver resolver = contributingModule.getClassResolver();

      return resolver.findClass(inputValue);

    }

    else

    {

        throw new AplicationRuntimeException(RulesMessages.noPropertyEditor(propertyType));

    }

  }

 

}

 

My hivemodule.sdl

 

      service-point ( id=LockingConfiguration

                      interface=org.apache.ojb.odmg.locking.LockingConfiguration)

      {

            invoke-factory( service-id=hivemind.BuilderFactory )

            {

                  construct (class=com.etranscor.hivemind.ojb.configuration.LockingConfigurationImpl)

                  {

                      set ( property=lockManagerClass value=${ojb.lockmanager.class} )   

                      set ( property=lockMapClass     value=${ojb.lockmap.class} )

                  }          

            }

      }

 

      contribution (configuration-id=hivemind.FactoryDefaults)

      {

            default (symbol=ojb.lockmanager.class  value=org.apache.ojb.odmg.locking.LockManagerDefaultImpl)

            default (symbol=ojb.lockmap.class      value=org.apache.ojb.odmg.locking.InMemoryLockMapImpl)

      }

 

-kurt h

 

Reply via email to