|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.qtitools.qti.node.AbstractNode
org.qtitools.qti.node.AbstractObject
org.qtitools.qti.node.shared.declaration.DefaultValue
public class DefaultValue
Default value of variableDeclaration. Specification of defaultValue is not good. Instead of [1..*] fieldValues, defaultValue should contain 1 baseValue or multiple or ordered or record expression. It would be much more powerful and consistent.
| Field Summary | |
|---|---|
static java.lang.String |
ATTR_INTERPRETATION_DEFAULT_VALUE
Default value of interpretation attribute. |
static java.lang.String |
ATTR_INTERPRETATION_NAME
Name of interpretation attribute in xml schema. |
static java.lang.String |
CLASS_TAG
Name of this class in xml schema. |
| Fields inherited from interface org.qtitools.qti.node.XmlNode |
|---|
INDENT, NEW_LINE, SIMPLE_NAME_INNER_SEPARATOR, SIMPLE_NAMES_SEPARATOR |
| Constructor Summary | |
|---|---|
DefaultValue(VariableDeclaration parent)
Creates object. |
|
DefaultValue(VariableDeclaration parent,
Value value)
Creates object with a given value. |
|
| Method Summary | |
|---|---|
Value |
evaluate()
Evaluates value of this defaultValue. |
BaseType |
getBaseType()
Gets required baseType of result value (when all FieldValues are put together). |
Cardinality |
getCardinality()
Gets required cardinality of result value (when all FieldValues are put together). |
java.lang.String |
getClassTag()
Gets QTI class name of this node. |
java.util.List<FieldValue> |
getFieldValues()
Gets fieldValue children. |
java.lang.String |
getInterpretation()
Gets value of interpretation attribute. |
VariableDeclaration |
getParent()
Gets parent of this node or null (if node is root; for example AssessmentTest). |
Value |
getValue()
Gets value of this defaultValue. |
void |
load(org.w3c.dom.Node sourceNode)
Loads this node from given source node (DOM). |
void |
setInterpretation(java.lang.String interpretation)
Sets new value of interpretation attribute. |
protected ValidationResult |
validateChildren()
Validates children (body) of this node. |
| Methods inherited from class org.qtitools.qti.node.AbstractObject |
|---|
getParentItem, getParentResult, getParentTest, setParent |
| Methods inherited from class org.qtitools.qti.node.AbstractNode |
|---|
attrToXmlString, bodyToXmlString, getAttributes, getFullName, getIndent, getNode, getNode, getNode, getNodeGroups, getParentRoot, getSimpleName, getSourceFile, getSourceNode, getSourceString, getSourceUrl, hasChildNodes, load, load, load, loadAttributes, readChild, readChildren, setParent, setSourceFile, setSourceNode, setSourceString, setSourceUrl, toXmlString, toXmlString, validate, validateAttributes |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.qtitools.qti.node.XmlObject |
|---|
getParentItem, getParentResult, getParentTest, setParent |
| Methods inherited from interface org.qtitools.qti.node.XmlNode |
|---|
getAttributes, getFullName, getNodeGroups, getParentRoot, getSimpleName, getSourceFile, getSourceNode, getSourceString, getSourceUrl, hasChildNodes, load, load, load, setSourceFile, setSourceNode, setSourceString, setSourceUrl, toXmlString, toXmlString |
| Methods inherited from interface org.qtitools.qti.validation.Validatable |
|---|
validate |
| Field Detail |
|---|
public static final java.lang.String CLASS_TAG
public static final java.lang.String ATTR_INTERPRETATION_NAME
public static final java.lang.String ATTR_INTERPRETATION_DEFAULT_VALUE
| Constructor Detail |
|---|
public DefaultValue(VariableDeclaration parent)
parent - parent of this object
public DefaultValue(VariableDeclaration parent,
Value value)
parent - parent of this objectvalue - value to use| Method Detail |
|---|
public VariableDeclaration getParent()
XmlNodeWhile testing some nodes (for example expressions) don't have properly set parent, but it is usable only for testing. (Some nodes cannot exists without parent even for testing).
getParent in interface XmlNodegetParent in interface XmlObjectgetParent in class AbstractObjectpublic java.lang.String getClassTag()
XmlNodeQTI class name has very important role during loading/saving nodes.
For example: Java class name is AssessmentTest; QTI class name is assessmentTest.
getClassTag in interface XmlNodegetClassTag in class AbstractNodepublic java.lang.String getInterpretation()
setInterpretation(java.lang.String)public void setInterpretation(java.lang.String interpretation)
interpretation - new value of interpretation attributegetInterpretation()public java.util.List<FieldValue> getFieldValues()
public Value getValue()
public Cardinality getCardinality()
FieldValueParent
getCardinality in interface FieldValueParentpublic BaseType getBaseType()
FieldValueParent
getBaseType in interface FieldValueParentprotected ValidationResult validateChildren()
AbstractNode
validateChildren in class AbstractNodepublic Value evaluate()
public void load(org.w3c.dom.Node sourceNode)
XmlNode
load in interface XmlNodeload in class AbstractNodesourceNode - source node (DOM) for this node
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||