org.apache.hivemind.service.impl
Class ObjectTranslator

java.lang.Object
  extended by org.apache.hivemind.service.impl.ObjectTranslator
All Implemented Interfaces:
Translator

public class ObjectTranslator
extends java.lang.Object
implements Translator

Implementation of the indirect translator. This translator allows the contributor, not the schema, to define where object values come from, and is fully extensible. Perhaps I'll have an inspiration and find a better name than "indirect".

Author:
Howard Lewis Ship

Constructor Summary
ObjectTranslator()
           
 
Method Summary
 void setContributions(java.util.Map map)
           
 void setErrorLog(ErrorLog errorLog)
           
 java.lang.Object translate(Module contributingModule, java.lang.Class propertyType, java.lang.String inputValue, Location location)
          Invoked by a Rule to translate an inputValue into an appropriate object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectTranslator

public ObjectTranslator()
Method Detail

translate

public java.lang.Object translate(Module contributingModule,
                                  java.lang.Class propertyType,
                                  java.lang.String inputValue,
                                  Location location)
Description copied from interface: Translator
Invoked by a Rule to translate an inputValue into an appropriate object. Substitution symbols will already have been expanded before this method is invoked.

Specified by:
translate in interface Translator
Parameters:
contributingModule - the module from which the input value originates
propertyType - the type of the property to be assigned by this translator; smart translators may be able to automatically convert from string to the correct type
inputValue - the value to be translated, either an attribute value or the content of the element
location - the location of the inputValue; used to set the location of created objects, or when reporting errors

setContributions

public void setContributions(java.util.Map map)

setErrorLog

public void setErrorLog(ErrorLog errorLog)
Since:
1.1