|
||||||||||
| 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.FieldValue
public class FieldValue
A class that can represent A single value of any baseType in variable declarations and result reports. The base-type is defined by the baseType attribute of the declaration except in the case of variables with record cardinality.
This class has different name (fieldValue instead of value) in specification. Name value was already taken.
| Field Summary | |
|---|---|
static BaseType |
ATTR_BASE_TYPE_DEFAULT_VALUE
Default value of baseType attribute. |
static java.lang.String |
ATTR_BASE_TYPE_NAME
Name of baseType attribute in xml schema. |
static java.lang.String |
ATTR_IDENTIFIER_DEFAULT_VALUE
Default value of fieldIdentifier attribute. |
static java.lang.String |
ATTR_IDENTIFIER_NAME
Name of fieldIdentifier 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 | |
|---|---|
FieldValue(FieldValueParent parent)
Creates object. |
|
| Method Summary | |
|---|---|
protected java.lang.String |
bodyToXmlString(int depth,
boolean printDefaultAttributes)
Prints body (children and/or text content) of this node into xml string. |
BaseType |
getBaseType()
Gets baseType of this fieldValue. |
BaseType |
getBaseTypeAttrValue()
Gets value of baseType attribute. |
java.lang.String |
getClassTag()
Gets QTI class name of this node. |
java.lang.String |
getIdentifier()
Gets value of fieldIdentifier attribute. |
FieldValueParent |
getParent()
Gets parent of this node or null (if node is root; for example AssessmentTest). |
java.lang.String |
getSimpleName()
Gets simple name of this node. |
SingleValue |
getSingleValue()
Gets single value of this fieldValue. |
static Value |
getValue(Cardinality cardinality,
java.util.List<FieldValue> values)
Constructs value (of any cardinality) from given list of fieldValues (list of single values). |
static java.util.List<FieldValue> |
getValues(FieldValueParent parent,
Value value)
Constructs list of fieldValues (list of single values) from given value (of any cardinality). |
protected void |
readChildren(org.w3c.dom.Node node)
Reads all children nodes and/or content from given xml source. |
void |
setBaseTypeAttrValue(BaseType baseType)
Sets new value of baseType attribute. |
void |
setIdentifier(java.lang.String identifier)
Sets new value of fieldIdentifier attribute. |
void |
setSingleValue(SingleValue singleValue)
Sets new single value of this fieldValue. |
protected ValidationResult |
validateAttributes()
Validates attributes of this node. |
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, getAttributes, getFullName, getIndent, getNode, getNode, getNode, getNodeGroups, getParentRoot, getSourceFile, getSourceNode, getSourceString, getSourceUrl, hasChildNodes, load, load, load, load, loadAttributes, readChild, setParent, setSourceFile, setSourceNode, setSourceString, setSourceUrl, toXmlString, toXmlString, validate |
| 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.XmlNode |
|---|
getAttributes, getFullName, getNodeGroups, getParentRoot, getSourceFile, getSourceNode, getSourceString, getSourceUrl, hasChildNodes, load, 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_IDENTIFIER_NAME
public static final java.lang.String ATTR_IDENTIFIER_DEFAULT_VALUE
public static final java.lang.String ATTR_BASE_TYPE_NAME
public static final BaseType ATTR_BASE_TYPE_DEFAULT_VALUE
| Constructor Detail |
|---|
public FieldValue(FieldValueParent parent)
parent - parent of this object| Method Detail |
|---|
public FieldValueParent 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 getSimpleName()
XmlNodeSimple name is not so important like QTI class name. It servers mostly for displaying informations and in messages.
For example: simple name can be assessmentTest:Test (QTI class name (assessmentTest) + identifier (Test)).
getSimpleName in interface XmlNodegetSimpleName in class AbstractNodeXmlNode.getFullName()public java.lang.String getIdentifier()
setIdentifier(java.lang.String)public void setIdentifier(java.lang.String identifier)
identifier - new value of fieldIdentifier attributegetIdentifier()public BaseType getBaseTypeAttrValue()
setBaseTypeAttrValue(org.qtitools.qti.value.BaseType)public void setBaseTypeAttrValue(BaseType baseType)
baseType - new value of baseType attributegetBaseTypeAttrValue()public BaseType getBaseType()
public SingleValue getSingleValue()
setSingleValue(org.qtitools.qti.value.SingleValue)public void setSingleValue(SingleValue singleValue)
singleValue - new single value of this fieldValuegetSingleValue()protected void readChildren(org.w3c.dom.Node node)
AbstractNode
readChildren in class AbstractNodenode - xml source
protected java.lang.String bodyToXmlString(int depth,
boolean printDefaultAttributes)
AbstractNode
bodyToXmlString in class AbstractNodedepth - depth in xml tree (root = 0)printDefaultAttributes - whether print attributes with default values
protected ValidationResult validateAttributes()
AbstractNode
validateAttributes in class AbstractNodeprotected ValidationResult validateChildren()
AbstractNode
validateChildren in class AbstractNode
public static Value getValue(Cardinality cardinality,
java.util.List<FieldValue> values)
cardinality - requested cardinalityvalues - given list of fieldValues (list of single values)
getValues(org.qtitools.qti.node.shared.FieldValueParent, org.qtitools.qti.value.Value)
public static java.util.List<FieldValue> getValues(FieldValueParent parent,
Value value)
parent - parent of constructed fieldValuesvalue - given value (of any cardinality)
getValue(org.qtitools.qti.value.Cardinality, java.util.List)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||