|
||||||||||
| 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.expression.AbstractExpression
org.qtitools.qti.node.expression.general.LookupExpression
public abstract class LookupExpression
Parent of correct, default and variable expression.
| Field Summary | |
|---|---|
static java.lang.String |
ATTR_IDENTIFIER_NAME
Name of identifier attribute in xml schema. |
static java.lang.String |
IDENTIFIER_SEPARATOR
Separator between two parts of compound identifier. |
| Fields inherited from class org.qtitools.qti.node.expression.AbstractExpression |
|---|
logger |
| Fields inherited from interface org.qtitools.qti.node.expression.Expression |
|---|
DISPLAY_NAME |
| Fields inherited from interface org.qtitools.qti.node.XmlNode |
|---|
INDENT, NEW_LINE, SIMPLE_NAME_INNER_SEPARATOR, SIMPLE_NAMES_SEPARATOR |
| Constructor Summary | |
|---|---|
LookupExpression(ExpressionParent parent)
Constructs expression. |
|
| Method Summary | |
|---|---|
protected java.lang.String |
getFirstPart()
Gets first part of compound identifier or whole identifier if identifier is not compound. |
java.lang.String |
getIdentifier()
Gets value of identifier attribute. |
BaseType[] |
getProducedBaseTypes()
Gets list of all possible produced baseTypes after evaluation (possible baseTypes of evaluated result). |
Cardinality[] |
getProducedCardinalities()
Gets list of all possible produced cardinalities after evaluation (possible cardinalities of evaluated result). |
protected java.lang.String |
getSecondPart()
Gets second part of compound identifier or null if identifier is not compound. |
protected boolean |
hasMoreParts()
Returns true if identifier is compound from two parts separated with dot; false otherwise. |
protected boolean |
isValid(ValidationResult result)
Returns true if identifier is valid; false otherwise. |
boolean |
isVariable()
Returns true if value of evaluation can change every evaluation call; false otherwise. |
protected VariableDeclaration |
lookupDeclaration()
|
protected VariableDeclaration |
lookupDeclaration(AssessmentItem item,
java.lang.String identifier)
Looks up for variable declaration. |
void |
setIdentifier(java.lang.String identifier)
Sets new value of identifier attribute. |
| Methods inherited from class org.qtitools.qti.node.expression.AbstractExpression |
|---|
evaluate, evaluateSelf, getBaseType, getCardinality, getChildren, getFirstChild, getParent, getParentRequiredBaseTypes, getParentRequiredCardinalities, getProducedNumericalBaseTypes, getRequiredBaseTypes, getRequiredCardinalities, getRequiredSameBaseTypes, getRequiredSameCardinalities, getSecondChild, getType, getValue, isAnyChildNull, isNull, reset, toString, validate |
| 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, getClassTag, getFullName, getIndent, getNode, getNode, getNode, getNodeGroups, getParentRoot, getSimpleName, getSourceFile, getSourceNode, getSourceString, getSourceUrl, hasChildNodes, load, load, load, load, loadAttributes, readChild, readChildren, setParent, setSourceFile, setSourceNode, setSourceString, setSourceUrl, toXmlString, toXmlString, validateAttributes, validateChildren |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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, getClassTag, getFullName, getNodeGroups, getParentRoot, getSimpleName, getSourceFile, getSourceNode, getSourceString, getSourceUrl, hasChildNodes, load, load, load, load, setSourceFile, setSourceNode, setSourceString, setSourceUrl, toXmlString, toXmlString |
| Field Detail |
|---|
public static final java.lang.String ATTR_IDENTIFIER_NAME
public static final java.lang.String IDENTIFIER_SEPARATOR
| Constructor Detail |
|---|
public LookupExpression(ExpressionParent parent)
parent - parent of this expression| Method Detail |
|---|
public java.lang.String getIdentifier()
setIdentifier(java.lang.String)public void setIdentifier(java.lang.String identifier)
identifier - new value of identifier attributegetIdentifier()protected boolean hasMoreParts()
protected java.lang.String getFirstPart()
protected java.lang.String getSecondPart()
protected boolean isValid(ValidationResult result)
This method checks:
result - validation result where to store eventual validation messages
protected VariableDeclaration lookupDeclaration(AssessmentItem item,
java.lang.String identifier)
item - where to look upidentifier - identifier of requested variable declaration
public boolean isVariable()
Expression
isVariable in interface ExpressionisVariable in class AbstractExpressionprotected VariableDeclaration lookupDeclaration()
public BaseType[] getProducedBaseTypes()
ExpressionStatic example is expression or. Expression or can produce only boolean baseType and it cannot change.
Dynamic example is expression variable. Expression variable can produce any baseType before evaluation. After evaluation it produces baseType of its result (and it can change every evaluation call!).
Null expression, empty containers (multiple, ordered, record), or NULL values produces all baseTypes. So they are compatible with anything.
getProducedBaseTypes in interface ExpressiongetProducedBaseTypes in class AbstractExpressionpublic Cardinality[] getProducedCardinalities()
ExpressionStatic example is expression or. Expression or can produce only single cardinality and it cannot change.
Dynamic example is expression variable. Expression variable can produce any cardinality before evaluation. After evaluation it produces cardinality of its result (and it can change every evaluation call!).
Null expression, empty containers (multiple, ordered, record), or NULL values produces all cardinalities. So they are compatible with anything.
getProducedCardinalities in interface ExpressiongetProducedCardinalities in class AbstractExpression
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||