org.qtitools.qti.attribute.value
Class SingleValueAttribute

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

public class SingleValueAttribute
extends SingleAttribute

Attribute with single value.

Author:
Jiri Kajaba
See Also:
Serialized Form

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

Constructor Detail

SingleValueAttribute

public SingleValueAttribute(XmlNode parent,
                            java.lang.String name,
                            BaseType baseType)
Constructs attribute.

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

SingleValueAttribute

public SingleValueAttribute(XmlNode parent,
                            java.lang.String name,
                            BaseType baseType,
                            SingleValue defaultValue)
Constructs attribute.

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

SingleValueAttribute

public SingleValueAttribute(XmlNode parent,
                            java.lang.String name,
                            BaseType baseType,
                            SingleValue value,
                            SingleValue defaultValue,
                            boolean required)
Constructs attribute.

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

getBaseType

public BaseType getBaseType()
Gets baseType of attribute.

Returns:
baseType of attribute
See Also:
setBaseType(org.qtitools.qti.value.BaseType)

setBaseType

public void setBaseType(BaseType baseType)
Sets new baseType of attribute.

Parameters:
baseType - new baseType of attribute
See Also:
getBaseType()

getValue

public SingleValue 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(SingleValue value)
Sets new value of attribute.

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

getDefaultValue

public SingleValue 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(SingleValue defaultValue)
Sets new default value of attribute.

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

parseValue

protected SingleValue 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

validate

public ValidationResult validate()
Description copied from interface: Validatable
Validates this object.

Specified by:
validate in interface Validatable
Overrides:
validate in class AbstractAttribute
Returns:
validation result


Copyright © 2009. All Rights Reserved.