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

Quick Search    Search Deep

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

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

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

Translates strings to long values.


Field Summary
private  long _defaultValue
           
private  boolean _isMaxValue
           
private  boolean _isMinValue
           
private  long _maxValue
           
private  long _minValue
           
 
Constructor Summary
LongTranslator()
           
LongTranslator(java.lang.String initializer)
          Initializers: default: default value for empty or invalid input min: minimum acceptible value max: maximum acceptible value
 
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)
          Converts the string to an Long.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_minValue

private long _minValue

_isMinValue

private boolean _isMinValue

_maxValue

private long _maxValue

_isMaxValue

private boolean _isMaxValue

_defaultValue

private long _defaultValue
Constructor Detail

LongTranslator

public LongTranslator()

LongTranslator

public LongTranslator(java.lang.String initializer)
Initializers:
  • default: default value for empty or invalid input
  • min: minimum acceptible value
  • max: maximum acceptible value

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)
Converts the string to an Long. The empty string is returned as zero. On failure, an error is logged and the method returns zero.

Specified by:
translate in interface org.apache.hivemind.schema.Translator