|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.qtitools.qti.group.AbstractNodeGroup
public abstract class AbstractNodeGroup
Parent of all groups.
| Constructor Summary | |
|---|---|
AbstractNodeGroup(XmlNode parent,
java.lang.String name,
boolean required)
Constructs group with maximum set to 1. |
|
AbstractNodeGroup(XmlNode parent,
java.lang.String name,
java.lang.Integer minimum,
java.lang.Integer maximum)
Constructs group. |
|
| Method Summary | |
|---|---|
java.util.List<java.lang.String> |
getAllSupportedClasses()
Returns list of all possible QTI class names (all possible children in this group). |
XmlNode |
getChild()
Gets first child or null. |
java.util.List<XmlNode> |
getChildren()
Gets list of all children. |
java.util.List<java.lang.String> |
getCurrentSupportedClasses(int index)
Returns list of all currently possible QTI class names (all currently possible children in this group). |
java.lang.String |
getFullName()
Gets full name of group (full path from root node up to node's parent and node's name). |
java.lang.Integer |
getMaximum()
Gets allowed maximum number of children or null. |
java.lang.Integer |
getMinimum()
Gets required minimum number of children or null. |
java.lang.String |
getName()
Gets name of group. |
XmlNode |
getParent()
Gets parent node of group. |
boolean |
isGeneral()
Returns true if group can contain children with different QTI class name; false otherwise. |
void |
load(org.w3c.dom.Node node)
Loads children from given source node (DOM). |
protected void |
setChild(XmlNode child)
Sets new child. |
java.lang.String |
toXmlString(int depth,
boolean printDefaultAttributes)
Prints all children into string. |
ValidationResult |
validate()
Validates this object. |
| 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.group.NodeGroup |
|---|
create |
| Constructor Detail |
|---|
public AbstractNodeGroup(XmlNode parent,
java.lang.String name,
boolean required)
This is convenient constructor for group with only one child.
parent - parent of created groupname - name of created grouprequired - if true, minimum is set to 1, if false, minimum is set to 0
public AbstractNodeGroup(XmlNode parent,
java.lang.String name,
java.lang.Integer minimum,
java.lang.Integer maximum)
parent - parent of created groupname - name of created groupminimum - minimum required children of created groupmaximum - maximum allowed children of created group| Method Detail |
|---|
public XmlNode getParent()
NodeGroup
getParent in interface NodeGrouppublic java.lang.String getName()
NodeGroupName of group is typically QTI class name of its children (if it is same for all children).
For example: name of TestPartNodeGroup is testPart.
If group can contain children with different QTI class name, name is display name of abstract parent.
For example: name of ExpressionNodeGroup is expression (expression is not QTI class name for any node).
getName in interface NodeGrouppublic java.lang.String getFullName()
NodeGroup
getFullName in interface NodeGrouppublic boolean isGeneral()
NodeGroup
isGeneral in interface NodeGrouppublic java.util.List<java.lang.String> getAllSupportedClasses()
NodeGroupThis list will not change in time (it contains every possible QTI class name).
For example: SectionPartNodegroups returns assessmentSection and assessmentItemRef.
getAllSupportedClasses in interface NodeGroupNodeGroup.getCurrentSupportedClasses(int)public java.util.List<java.lang.String> getCurrentSupportedClasses(int index)
NodeGroupThis list can change in time (it contains every possible QTI class name for current time (conditions)).
For example: expression delete can contain on first position only expressions which produce single value and on second position only expressions which produce multiple or ordered cardinality.
getCurrentSupportedClasses in interface NodeGroupindex - index of children in group
public XmlNode getChild()
setChild(org.qtitools.qti.node.XmlNode)protected void setChild(XmlNode child)
Removes all children from list first!
This method should be used only on groups with one child (maximum = 1), because it clears list before setting new child.
child - new childgetChild()public java.util.List<XmlNode> getChildren()
NodeGroup
getChildren in interface NodeGrouppublic java.lang.Integer getMinimum()
NodeGroup
getMinimum in interface NodeGrouppublic java.lang.Integer getMaximum()
NodeGroup
getMaximum in interface NodeGrouppublic void load(org.w3c.dom.Node node)
NodeGroup
load in interface NodeGroupnode - source node (DOM)
public java.lang.String toXmlString(int depth,
boolean printDefaultAttributes)
NodeGroup
toXmlString in interface NodeGroupdepth - depth indent (0 = no indent)printDefaultAttributes - whether print attribute's default values
public ValidationResult validate()
Validatable
validate in interface Validatable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||