org.tridas.io.defaults.values
Class DateTimeDefaultValue

java.lang.Object
  extended by org.tridas.io.defaults.AbstractDefaultValue<org.tridas.schema.DateTime>
      extended by org.tridas.io.defaults.values.DateTimeDefaultValue
All Implemented Interfaces:
Cloneable

public class DateTimeDefaultValue
extends AbstractDefaultValue<org.tridas.schema.DateTime>

Author:
Pete

Constructor Summary
DateTimeDefaultValue()
           
DateTimeDefaultValue(org.tridas.schema.DateTime argValue)
           
DateTimeDefaultValue(org.tridas.schema.DateTime argValue, SimpleDateFormat format)
           
 
Method Summary
 SimpleDateFormat getSimpleDateFormat(SimpleDateFormat format)
          Get the formatter used for saving this DateTime to string
 String getStringValue()
          Gets the string representation of the value.
 org.tridas.schema.DateTime getValue()
          Gets the value.
 void setSimpleDateFormat(SimpleDateFormat format)
          Set the formatter that should be used by the toStringValue function
protected  boolean validateAndSetValue(org.tridas.schema.DateTime argValue)
          Validate and set the value.
protected  boolean validateAndSetValue(Integer day, Integer month, Integer year)
           
 
Methods inherited from class org.tridas.io.defaults.AbstractDefaultValue
clone, getKey, getMaxLength, getMinLength, getParent, isOverriding, isPadRight, setKey, setMaxLength, setMinLength, setOverriding, setOverridingValue, setPadRight, setParent, setValue
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateTimeDefaultValue

public DateTimeDefaultValue()

DateTimeDefaultValue

public DateTimeDefaultValue(org.tridas.schema.DateTime argValue)

DateTimeDefaultValue

public DateTimeDefaultValue(org.tridas.schema.DateTime argValue,
                            SimpleDateFormat format)
Method Detail

setSimpleDateFormat

public void setSimpleDateFormat(SimpleDateFormat format)
Set the formatter that should be used by the toStringValue function

Parameters:
format -

getSimpleDateFormat

public SimpleDateFormat getSimpleDateFormat(SimpleDateFormat format)
Get the formatter used for saving this DateTime to string

Parameters:
format -
Returns:

getValue

public org.tridas.schema.DateTime getValue()
Description copied from class: AbstractDefaultValue
Gets the value.

Specified by:
getValue in class AbstractDefaultValue<org.tridas.schema.DateTime>
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<org.tridas.schema.DateTime>
Returns:

validateAndSetValue

protected boolean validateAndSetValue(org.tridas.schema.DateTime argValue)
Description copied from class: AbstractDefaultValue
Validate and set the value.

Specified by:
validateAndSetValue in class AbstractDefaultValue<org.tridas.schema.DateTime>
Parameters:
argValue - the value, can be null.
Returns:
true if valid and set, false if not set and invalid

validateAndSetValue

protected boolean validateAndSetValue(Integer day,
                                      Integer month,
                                      Integer year)


Copyright © 2011. All Rights Reserved.