org.qtitools.qti.attribute.value
Class DateAttribute

java.lang.Object
  extended by org.qtitools.qti.attribute.AbstractAttribute
      extended by org.qtitools.qti.attribute.SingleAttribute
          extended by org.qtitools.qti.attribute.value.DateAttribute
All Implemented Interfaces:
java.io.Serializable, Attribute, Validatable

public class DateAttribute
extends SingleAttribute

Attribute with Date value.

Author:
Jiri Kajaba
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.qtitools.qti.attribute.AbstractAttribute
logger
 
Constructor Summary
DateAttribute(XmlNode parent, java.lang.String name)
          Constructs attribute.
DateAttribute(XmlNode parent, java.lang.String name, java.util.Date defaultValue)
          Constructs attribute.
DateAttribute(XmlNode parent, java.lang.String name, java.util.Date value, java.util.Date defaultValue, boolean required)
          Constructs attribute.
 
Method Summary
 java.lang.String defaultValueToString()
          Gets attribute's defaultValue converted to string.
 java.util.Date getDefaultValue()
          Gets default value of attribute.
 java.util.Date getValue()
          Gets value of attribute.
protected  java.util.Date parseValue(java.lang.String value)
          Parses value from given string.
 void setDefaultValue(java.util.Date defaultValue)
          Sets new default value of attribute.
 void setValue(java.util.Date value)
          Sets new value of attribute.
 java.lang.String valueToString()
          Gets attribute's value converted to string.
 
Methods inherited from class org.qtitools.qti.attribute.SingleAttribute
load, load, setDefaultValue, setValue
 
Methods inherited from class org.qtitools.qti.attribute.AbstractAttribute
getFullName, getLoadedValue, getLoadingProblem, getName, getParent, isRequired, isSupported, setLoadedValue, setLoadingProblem, setSupported, toString, toXmlString, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DateAttribute

public DateAttribute(XmlNode parent,
                     java.lang.String name)
Constructs attribute.

Parameters:
parent - attribute's parent
name - attribute's name

DateAttribute

public DateAttribute(XmlNode parent,
                     java.lang.String name,
                     java.util.Date defaultValue)
Constructs attribute.

Parameters:
parent - attribute's parent
name - attribute's name
defaultValue - attribute's default value

DateAttribute

public DateAttribute(XmlNode parent,
                     java.lang.String name,
                     java.util.Date value,
                     java.util.Date defaultValue,
                     boolean required)
Constructs attribute.

Parameters:
parent - attribute's parent
name - attribute's name
value - attribute's value
defaultValue - attribute's default value
required - is this attribute required
Method Detail

getValue

public java.util.Date getValue()
Description copied from class: SingleAttribute
Gets value of attribute.

Overrides:
getValue in class SingleAttribute
Returns:
value of attribute
See Also:
SingleAttribute.setValue(java.lang.Object)

setValue

public void setValue(java.util.Date value)
Sets new value of attribute.

Parameters:
value - new value of attribute
See Also:
getValue()

getDefaultValue

public java.util.Date getDefaultValue()
Description copied from class: SingleAttribute
Gets default value of attribute.

Overrides:
getDefaultValue in class SingleAttribute
Returns:
default value of attribute
See Also:
SingleAttribute.setDefaultValue(java.lang.Object)

setDefaultValue

public void setDefaultValue(java.util.Date defaultValue)
Sets new default value of attribute.

Parameters:
defaultValue - new default value of attribute
See Also:
getDefaultValue()

parseValue

protected java.util.Date parseValue(java.lang.String value)
Description copied from class: SingleAttribute
Parses value from given string.

Specified by:
parseValue in class SingleAttribute
Parameters:
value - string value
Returns:
parsed value

valueToString

public java.lang.String valueToString()
Description copied from interface: Attribute
Gets attribute's value converted to string. If value is not defined, returns empty (but not null) string.

Specified by:
valueToString in interface Attribute
Overrides:
valueToString in class SingleAttribute
Returns:
attribute's value converted to string

defaultValueToString

public java.lang.String defaultValueToString()
Description copied from interface: Attribute
Gets attribute's defaultValue converted to string. If defaultValue is not defined, returns empty (but not null) string.

Specified by:
defaultValueToString in interface Attribute
Overrides:
defaultValueToString in class SingleAttribute
Returns:
attribute's defaultValue converted to string


Copyright © 2009. All Rights Reserved.