org.qtitools.qti.node.content.mathml
Class Math

java.lang.Object
  extended by org.qtitools.qti.node.AbstractNode
      extended by org.qtitools.qti.node.AbstractObject
          extended by org.qtitools.qti.node.content.BodyElement
              extended by org.qtitools.qti.node.content.mathml.Math
All Implemented Interfaces:
java.io.Serializable, Block, BlockStatic, Flow, FlowStatic, Inline, InlineStatic, ObjectFlow, XmlNode, XmlObject, Validatable

public class Math
extends BodyElement
implements BlockStatic, FlowStatic, InlineStatic

Implements a QTI MathML block. Only supports children in the form of UnsupportedBlock, so validation of the content is left to the user. (Obviously xml schema validation could help!)

Author:
Jonathon Hare
See Also:
Serialized Form

Field Summary
static java.lang.String ATTR_DEFAULT_NAME_SPACE_NAME
          Name of xmlns attribute in xml schema.
static java.lang.String ATTR_DEFAULT_NAME_SPACE_VALUE
          Value of xmlns attribute.
static java.lang.String CLASS_TAG
          Name of this class in xml schema.
 
Fields inherited from class org.qtitools.qti.node.content.BodyElement
ATTR_CLASS_NAME, ATTR_ID_NAME, ATTR_LABEL_NAME, ATTR_LANG_NAME, DISPLAY_NAME
 
Fields inherited from interface org.qtitools.qti.node.content.basic.BlockStatic
DISPLAY_NAME
 
Fields inherited from interface org.qtitools.qti.node.content.basic.FlowStatic
DISPLAY_NAME
 
Fields inherited from interface org.qtitools.qti.node.content.basic.InlineStatic
DISPLAY_NAME
 
Constructor Summary
Math(XmlObject parent)
          Constructs 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.
 java.util.List<? extends XmlNode> getChildren()
          Get A list of the content child nodes of this element
 java.lang.String getClassTag()
          Gets QTI class name of this node.
 void load(org.w3c.dom.Node sourceNode)
          Loads this node from given source node (DOM).
protected  void readChild(org.w3c.dom.Node node)
          Reads one child from given xml source.
protected  void readChildren(org.w3c.dom.Node node)
          Reads all children nodes and/or content from given xml source.
protected  ValidationResult validateAttributes()
          Validates attributes of this node.
 
Methods inherited from class org.qtitools.qti.node.content.BodyElement
appendChild, evaluate, getClassAttr, getFirstChild, getId, getLabel, getLang, getLastChild, insertBefore, removeChild, replaceChild, search, search, search, setId, setLabel, setLang
 
Methods inherited from class org.qtitools.qti.node.AbstractObject
getParent, getParentItem, getParentResult, getParentTest, setParent
 
Methods inherited from class org.qtitools.qti.node.AbstractNode
attrToXmlString, getAttributes, getFullName, getIndent, getNode, getNode, getNode, getNodeGroups, getParentRoot, getSimpleName, getSourceFile, getSourceNode, getSourceString, getSourceUrl, hasChildNodes, load, load, load, loadAttributes, setParent, setSourceFile, setSourceNode, setSourceString, setSourceUrl, toXmlString, toXmlString, validate, validateChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_TAG

public static java.lang.String CLASS_TAG
Name of this class in xml schema.


ATTR_DEFAULT_NAME_SPACE_NAME

public static final java.lang.String ATTR_DEFAULT_NAME_SPACE_NAME
Name of xmlns attribute in xml schema.

See Also:
Constant Field Values

ATTR_DEFAULT_NAME_SPACE_VALUE

public static final java.lang.String ATTR_DEFAULT_NAME_SPACE_VALUE
Value of xmlns attribute.

See Also:
Constant Field Values
Constructor Detail

Math

public Math(XmlObject parent)
Constructs object.

Parameters:
parent - parent of constructed object
Method Detail

getClassTag

public java.lang.String getClassTag()
Description copied from interface: XmlNode
Gets QTI class name of this node.

QTI class name has very important role during loading/saving nodes.

For example: Java class name is AssessmentTest; QTI class name is assessmentTest.

Specified by:
getClassTag in interface XmlNode
Specified by:
getClassTag in class AbstractNode
Returns:
QTI class name of this node

getChildren

public java.util.List<? extends XmlNode> getChildren()
Description copied from class: BodyElement
Get A list of the content child nodes of this element

Specified by:
getChildren in class BodyElement
Returns:
List of child nodes

readChildren

protected void readChildren(org.w3c.dom.Node node)
Description copied from class: AbstractNode
Reads all children nodes and/or content from given xml source. Every subclass must implement its own children nodes and/or content reading. If there are no children nodes and content do nothing (you don't even need to override this method).

Overrides:
readChildren in class AbstractNode
Parameters:
node - xml source

readChild

protected void readChild(org.w3c.dom.Node node)
Description copied from class: AbstractNode
Reads one child from given xml source. Every subclass must implement its own child reading.

Overrides:
readChild in class AbstractNode
Parameters:
node - xml source

bodyToXmlString

protected java.lang.String bodyToXmlString(int depth,
                                           boolean printDefaultAttributes)
Description copied from class: AbstractNode
Prints body (children and/or text content) of this node into xml string.

Overrides:
bodyToXmlString in class AbstractNode
Parameters:
depth - depth in xml tree (root = 0)
printDefaultAttributes - whether print attributes with default values
Returns:
xml string with printed body (children and/or text content) of this node

load

public void load(org.w3c.dom.Node sourceNode)
Description copied from interface: XmlNode
Loads this node from given source node (DOM).

Specified by:
load in interface XmlNode
Overrides:
load in class AbstractNode
Parameters:
sourceNode - source node (DOM) for this node

validateAttributes

protected ValidationResult validateAttributes()
Description copied from class: AbstractNode
Validates attributes of this node.

Overrides:
validateAttributes in class AbstractNode
Returns:
result of validation


Copyright © 2009. All Rights Reserved.