org.qtitools.qti.node.block
Class ContainerBlock

java.lang.Object
  extended by org.qtitools.qti.node.AbstractNode
      extended by org.qtitools.qti.node.AbstractObject
          extended by org.qtitools.qti.node.block.ContainerBlock
All Implemented Interfaces:
java.io.Serializable, XmlNode, XmlObject, Validatable
Direct Known Subclasses:
Identification, UnsupportedBlock

public abstract class ContainerBlock
extends AbstractObject

Container block. Contains other blocks and no text content (it can contain one or more TextBlocks).

Author:
Jonathon Hare, Jiri Kajaba
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.qtitools.qti.node.XmlNode
INDENT, NEW_LINE, SIMPLE_NAME_INNER_SEPARATOR, SIMPLE_NAMES_SEPARATOR
 
Constructor Summary
ContainerBlock(XmlObject parent)
          Constructs block.
 
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<XmlNode> getChildren()
          Gets children of this block.
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 validateChildren()
          Validates children (body) of this node.
 
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, getClassTag, getFullName, getIndent, getNode, getNode, getNode, getNodeGroups, getParentRoot, getSimpleName, getSourceFile, getSourceNode, getSourceString, getSourceUrl, hasChildNodes, load, load, load, load, loadAttributes, 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.XmlNode
getAttributes, getClassTag, getFullName, getNodeGroups, getParentRoot, getSimpleName, 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
 

Constructor Detail

ContainerBlock

public ContainerBlock(XmlObject parent)
Constructs block.

Parameters:
parent - parent of this block
Method Detail

getChildren

public java.util.List<XmlNode> getChildren()
Gets children of this block.

Returns:
children of this block

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

validateChildren

protected ValidationResult validateChildren()
Description copied from class: AbstractNode
Validates children (body) of this node.

Overrides:
validateChildren in class AbstractNode
Returns:
result of validation


Copyright © 2009. All Rights Reserved.