org.tridas.io.defaults.values
Class StringDefaultValue

java.lang.Object
  extended by org.tridas.io.defaults.AbstractDefaultValue<String>
      extended by org.tridas.io.defaults.values.StringDefaultValue
All Implemented Interfaces:
Cloneable

public class StringDefaultValue
extends AbstractDefaultValue<String>

Author:
Daniel

Constructor Summary
StringDefaultValue()
           
StringDefaultValue(String argValue)
           
StringDefaultValue(String argValue, int argMinLength, int argMaxLength)
           
 
Method Summary
 String getStringValue()
          Gets the string representation of the value.
 String getValue()
          Gets the value.
 void setMaxLength(int argMaxLength)
          Sets the maximum string length.
 void setMinLength(int argMinLength)
          Sets the minimum string length.
protected  boolean validateAndSetValue(String argValue)
          Validate and set the value.
 
Methods inherited from class org.tridas.io.defaults.AbstractDefaultValue
clone, getKey, getMaxLength, getMinLength, getParent, isOverriding, isPadRight, setKey, setOverriding, setOverridingValue, setPadRight, setParent, setValue
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringDefaultValue

public StringDefaultValue()

StringDefaultValue

public StringDefaultValue(String argValue)

StringDefaultValue

public StringDefaultValue(String argValue,
                          int argMinLength,
                          int argMaxLength)
Method Detail

getValue

public String getValue()
Description copied from class: AbstractDefaultValue
Gets the value.

Specified by:
getValue in class AbstractDefaultValue<String>
Returns:
the value. can be null
See Also:
org.tridas.io.defaults.IDefaultValue#getValue()

getStringValue

public String getStringValue()
Description copied from class: AbstractDefaultValue
Gets the string representation of the value. If AbstractDefaultValue.setMinLength(int) is set, then the string will be padded. If AbstractDefaultValue.getValue() is null, an empty string is returned (if minLength is set, then it is padded as well).

Overrides:
getStringValue in class AbstractDefaultValue<String>
Returns:

validateAndSetValue

protected boolean validateAndSetValue(String argValue)
Description copied from class: AbstractDefaultValue
Validate and set the value.

Specified by:
validateAndSetValue in class AbstractDefaultValue<String>
Parameters:
argValue - the value, can be null.
Returns:
true if valid and set, false if not set and invalid
See Also:
AbstractDefaultValue.validateAndSetValue(java.lang.Object)

setMaxLength

public void setMaxLength(int argMaxLength)
Description copied from class: AbstractDefaultValue
Sets the maximum string length. Use '-1' to not enforce this

Overrides:
setMaxLength in class AbstractDefaultValue<String>
See Also:
AbstractDefaultValue.setMaxLength(int)

setMinLength

public void setMinLength(int argMinLength)
Description copied from class: AbstractDefaultValue
Sets the minimum string length. Use '-1' to not enforce this

Overrides:
setMinLength in class AbstractDefaultValue<String>
See Also:
AbstractDefaultValue.setMinLength(int)


Copyright © 2011. All Rights Reserved.