org.qtitools.qti.node
Interface XmlNode
- All Superinterfaces:
- java.io.Serializable, Validatable
- All Known Subinterfaces:
- AssociableHotspotContainer, AtomicBlock, AtomicInline, Block, BlockStatic, ChoiceContainer, Expression, ExpressionParent, FieldValueParent, Flow, FlowStatic, GapChoiceContainer, HotspotChoiceContainer, Inline, InlineStatic, ObjectFlow, SimpleAssociableChoiceContainer, SimpleBlock, SimpleChoiceContainer, SimpleInline, SimpleMatchSetContainer, TextOrVariable, XmlObject
- All Known Implementing Classes:
- A, Abbr, AbstractAtomicBlock, AbstractExpression, AbstractJump, AbstractNode, AbstractObject, AbstractPart, AbstractResult, AbstractSimpleBlock, AbstractSimpleInline, Acronym, Address, And, AnyN, AreaMapEntry, AreaMapping, AssessmentItem, AssessmentItemRef, AssessmentResult, AssessmentSection, AssessmentTest, AssociableChoice, AssociableHotspot, AssociateInteraction, B, BaseValue, Big, BlockInteraction, Blockquote, BodyElement, Br, BranchRule, CandidateComment, CandidateResponse, Caption, Choice, ChoiceInteraction, Cite, Code, Col, Colgroup, ContainerBlock, ContainerSize, Contains, Context, ControlObject, Correct, CorrectResponse, CustomInteraction, CustomOperator, Dd, Default, DefaultValue, Delete, Dfn, Div, Divide, Dl, DlElement, DrawingInteraction, Dt, DurationGte, DurationLt, Em, EndAttemptInteraction, Equal, EqualRounded, ExitResponse, ExitTemplate, ExitTest, ExtendedTextInteraction, FeedbackBlock, FeedbackElement, FeedbackInline, FieldValue, FieldValue, Gap, GapChoice, GapImg, GapMatchInteraction, GapText, GraphicAssociateInteraction, GraphicGapMatchInteraction, GraphicInteraction, GraphicOrderInteraction, Gt, Gte, H1, H2, H3, H4, H5, H6, HotspotChoice, HotspotInteraction, Hottext, HottextInteraction, Hr, I, Identification, Img, Index, InlineChoice, InlineChoiceInteraction, InlineInteraction, Inside, IntegerDivide, IntegerModulus, IntegerToFloat, Interaction, InterpolationTable, InterpolationTableEntry, IsNull, ItemBody, ItemResult, ItemSessionControl, ItemSubset, ItemVariable, Kbd, Li, LookupExpression, LookupOutcomeValue, LookupOutcomeValue, LookupTable, LookupTableEntry, Lt, Lte, MapEntry, Mapping, MapResponse, MapResponsePoint, Match, MatchInteraction, MatchTable, MatchTableEntry, Math, MediaInteraction, Member, ModalFeedback, Multiple, Not, Null, NumberCorrect, NumberIncorrect, NumberPresented, NumberResponded, NumberSelected, Object, Ol, Or, Ordered, Ordering, OrderInteraction, OutcomeCondition, OutcomeConditionChild, OutcomeConditionExpressionChild, OutcomeDeclaration, OutcomeElse, OutcomeElseIf, OutcomeIf, OutcomeMaximum, OutcomeMinimum, OutcomeMinMax, OutcomeProcessing, OutcomeProcessingFragment, OutcomeRule, OutcomeVariable, P, Param, PatternMatch, PositionObjectInteraction, PositionObjectStage, Power, Pre, PreCondition, PrintedVariable, ProcessOutcomeValue, ProcessResponseValue, ProcessTemplateValue, Product, Prompt, Q, Random, RandomEx, RandomExpression, RandomFloat, RandomFloatEx, RandomInteger, RandomIntegerEx, RecordEx, ResponseCondition, ResponseConditionChild, ResponseConditionExpressionChild, ResponseDeclaration, ResponseElse, ResponseElseIf, ResponseIf, ResponseProcessing, ResponseProcessingFragment, ResponseRule, ResponseVariable, Round, RubricBlock, Samp, SectionPart, Selection, SelectPointInteraction, SessionIdentifier, SetCorrectResponse, SetDefaultValue, SetOutcomeValue, SetOutcomeValue, SetTemplateValue, SimpleAssociableChoice, SimpleChoice, SimpleMatchSet, SliderInteraction, Small, Span, StringMatch, Strong, Stylesheet, Sub, Substring, Subtract, Sum, Sup, Table, TableCell, Tbody, Td, TemplateBlock, TemplateCondition, TemplateConditionChild, TemplateConditionExpressionChild, TemplateDeclaration, TemplateDefault, TemplateElement, TemplateElse, TemplateElseIf, TemplateIf, TemplateInline, TemplateProcessing, TemplateRule, TemplateVariable, TestFeedback, TestPart, TestResult, TestVariables, TextEntryInteraction, TextRun, Tfoot, Th, Thead, TimeLimit, Tr, Truncate, Tt, Ul, UniqueObject, UnsupportedBlock, UploadInteraction, Var, Variable, VariableDeclaration, VariableMapping, Weight
public interface XmlNode
- extends Validatable
Parent of all xml nodes.
- Author:
- Jiri Kajaba
|
Method Summary |
AttributeList |
getAttributes()
Gets list (container) of all attributes. |
java.lang.String |
getClassTag()
Gets QTI class name of this node. |
java.lang.String |
getFullName()
Gets full name of this node. |
NodeGroupList |
getNodeGroups()
Gets list (container) of all child groups. |
XmlNode |
getParent()
Gets parent of this node or null (if node is root; for example AssessmentTest). |
XmlNode |
getParentRoot()
Gets root of this node or node itself (if node is root; for example AssessmentTest). |
java.lang.String |
getSimpleName()
Gets simple name of this node. |
java.io.File |
getSourceFile()
Gets source file of this node. |
org.w3c.dom.Node |
getSourceNode()
Gets source node (DOM) of this node. |
java.lang.String |
getSourceString()
Gets source string of this node. |
java.net.URL |
getSourceUrl()
Gets source url of this node. |
boolean |
hasChildNodes()
This is A convenience method to allow easy determination of whether A node has any children. |
void |
load(java.io.File sourceFile)
Loads this node from given source file. |
void |
load(org.w3c.dom.Node sourceNode)
Loads this node from given source node (DOM). |
void |
load(java.lang.String sourceString)
Loads this node from given source string. |
void |
load(java.net.URL sourceUrl)
Loads this node from given source url. |
void |
setSourceFile(java.io.File sourceFile)
Sets new source file of this node. |
void |
setSourceNode(org.w3c.dom.Node sourceNode)
Sets new source node (DOM) of this node. |
void |
setSourceString(java.lang.String sourceString)
Sets new source string of this node. |
void |
setSourceUrl(java.net.URL sourceUrl)
Sets new source url of this node. |
java.lang.String |
toXmlString()
Prints this node and all its children into string. |
java.lang.String |
toXmlString(int depth,
boolean printDefaultAttributes)
Prints this node and all its children into string. |
NEW_LINE
static final java.lang.String NEW_LINE
- New line string. Depends on OS settings.
INDENT
static final java.lang.String INDENT
- Default indent.
- See Also:
- Constant Field Values
SIMPLE_NAMES_SEPARATOR
static final java.lang.String SIMPLE_NAMES_SEPARATOR
- Separator between names (nodes).
- See Also:
- Constant Field Values
SIMPLE_NAME_INNER_SEPARATOR
static final java.lang.String SIMPLE_NAME_INNER_SEPARATOR
- Separator between parts of name.
- See Also:
- Constant Field Values
getParent
XmlNode getParent()
- Gets parent of this node or null (if node is root; for example AssessmentTest).
While 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).
- Returns:
- parent of this node or null (if node is root; for example AssessmentTest)
getParentRoot
XmlNode getParentRoot()
- Gets root of this node or node itself (if node is root; for example AssessmentTest).
While 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).
- Returns:
- root of this node or node itself (if node is root; for example AssessmentTest)
getAttributes
AttributeList getAttributes()
- Gets list (container) of all attributes.
- Returns:
- list (container) of all attributes of this node
getNodeGroups
NodeGroupList getNodeGroups()
- Gets list (container) of all child groups.
For example AssessmentTest contains (one) testPart group. And this (one) group contains all testParts.
Group approach is useful for defining some rules to all testParts
(for example required number of testParts in AssessmentTest).
- Returns:
- list (container) of all child group
load
void load(java.net.URL sourceUrl)
- Loads this node from given source url.
- Parameters:
sourceUrl - source url for this node
getSourceUrl
java.net.URL getSourceUrl()
- Gets source url of this node.
- Returns:
- source url of this node.
- See Also:
setSourceUrl(java.net.URL)
setSourceUrl
void setSourceUrl(java.net.URL sourceUrl)
- Sets new source url of this node.
- Parameters:
sourceUrl - new source url of this node- See Also:
getSourceUrl()
load
void load(java.io.File sourceFile)
- Loads this node from given source file.
- Parameters:
sourceFile - source file for this node
getSourceFile
java.io.File getSourceFile()
- Gets source file of this node.
- Returns:
- source file of this node.
- See Also:
setSourceFile(java.io.File)
setSourceFile
void setSourceFile(java.io.File sourceFile)
- Sets new source file of this node.
- Parameters:
sourceFile - new source file of this node- See Also:
getSourceFile()
load
void load(java.lang.String sourceString)
- Loads this node from given source string.
- Parameters:
sourceString - source string for this node
getSourceString
java.lang.String getSourceString()
- Gets source string of this node.
- Returns:
- source string of this node
- See Also:
setSourceString(java.lang.String)
setSourceString
void setSourceString(java.lang.String sourceString)
- Sets new source string of this node.
- Parameters:
sourceString - new source string of this node- See Also:
getSourceString()
load
void load(org.w3c.dom.Node sourceNode)
- Loads this node from given source node (DOM).
- Parameters:
sourceNode - source node (DOM) for this node
getSourceNode
org.w3c.dom.Node getSourceNode()
- Gets source node (DOM) of this node.
- Returns:
- source node (DOM) of this node
- See Also:
setSourceNode(org.w3c.dom.Node)
setSourceNode
void setSourceNode(org.w3c.dom.Node sourceNode)
- Sets new source node (DOM) of this node.
- Parameters:
sourceNode - new source node (DOM) of this node- See Also:
getSourceNode()
toXmlString
java.lang.String toXmlString()
- Prints this node and all its children into string.
Calls toXmlString(0, false).
- Returns:
- xml string of this node and all its children
- See Also:
toXmlString(int, boolean)
toXmlString
java.lang.String toXmlString(int depth,
boolean printDefaultAttributes)
- Prints this node and all its children into string.
- Parameters:
depth - indent (0 = no indent)printDefaultAttributes - whether print attribute's default values
- Returns:
- xml string of this node and all its children
- See Also:
toXmlString()
getClassTag
java.lang.String getClassTag()
- 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.
- Returns:
- QTI class name of this node
getSimpleName
java.lang.String getSimpleName()
- Gets simple name of this node. Simple name contains QTI class name and some additional information to help
identify node (if these informations are available).
Simple 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)).
- Returns:
- simple name of this node
- See Also:
getFullName()
getFullName
java.lang.String getFullName()
- Gets full name of this node. Full name is chain of simple names from root node to this node.
Full name is not so important like QTI class name. It serves mostly for displaying informations and in messages.
For example: assessmentTest:Test->testPart:Part3->assessmentSection:SectionB->assessmnetItemRef:Item05.
- Returns:
- full name of this node
- See Also:
getSimpleName()
hasChildNodes
boolean hasChildNodes()
- This is A convenience method to allow easy determination of whether A node has any children.
- Returns:
- true if the node has any children, false if the node has no children.
Copyright © 2009. All Rights Reserved.