Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.hivemind.schema.rules
Class BooleanTranslator  view BooleanTranslator download BooleanTranslator.java

java.lang.Object
  extended byorg.apache.hivemind.schema.rules.BooleanTranslator
All Implemented Interfaces:
org.apache.hivemind.schema.Translator

public class BooleanTranslator
extends java.lang.Object
implements org.apache.hivemind.schema.Translator

Translates a string value to a boolean value. "true" and "false" are acceptible values. Other values are logged as errors and treated as false. Null is simply considered false.


Field Summary
private  java.lang.Boolean _defaultValue
           
 
Constructor Summary
BooleanTranslator()
           
BooleanTranslator(java.lang.String initializer)
          Initializes the translator, recognizing key "default" as the default value for the translator when the input is blank.
 
Method Summary
 java.lang.Object translate(org.apache.hivemind.internal.Module contributingModule, java.lang.Class propertyType, java.lang.String inputValue, org.apache.hivemind.Location location)
          Invoked by a org.apache.hivemind.schema.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
 

Field Detail

_defaultValue

private java.lang.Boolean _defaultValue
Constructor Detail

BooleanTranslator

public BooleanTranslator()

BooleanTranslator

public BooleanTranslator(java.lang.String initializer)
Initializes the translator, recognizing key "default" as the default value for the translator when the input is blank.

Method Detail

translate

public java.lang.Object translate(org.apache.hivemind.internal.Module contributingModule,
                                  java.lang.Class propertyType,
                                  java.lang.String inputValue,
                                  org.apache.hivemind.Location location)
Description copied from interface: org.apache.hivemind.schema.Translator
Invoked by a org.apache.hivemind.schema.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 org.apache.hivemind.schema.Translator