org.apache.hivemind.schema.rules
Class ServiceTranslator

java.lang.Object
  extended by org.apache.hivemind.schema.rules.ServiceTranslator
All Implemented Interfaces:
Translator

public class ServiceTranslator
extends java.lang.Object
implements Translator

Used to translate a value into a reference to a HiveMind service within the registry.

Author:
Howard Lewis Ship

Constructor Summary
ServiceTranslator()
           
 
Method Summary
 java.lang.Object translate(Module contributingModule, java.lang.Class propertyType, java.lang.String inputValue, Location location)
          Returns null if the input is null or empty.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceTranslator

public ServiceTranslator()
Method Detail

translate

public java.lang.Object translate(Module contributingModule,
                                  java.lang.Class propertyType,
                                  java.lang.String inputValue,
                                  Location location)
Returns null if the input is null or empty. Returns the service with the given name otherwise. Will log an error and return null if an exception is thrown. If the input value is not qualified, the contributing module's id is added as a prefix.

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