edu.wpi.cs.DSRG.xmldb.DTDWrapper
Class Reference
java.lang.Object
|
+--edu.wpi.cs.DSRG.xmldb.DTDWrapper.Reference
- public class Reference
- extends java.lang.Object
getRatio() and getOptional() together could used to describe the different occurrence property
indicator ratio optional maxOccurs minOccurs
no indicator: 1:1 false ^ ^
? 1:1 true ^ 0
+ 1:n false * ^
* 1:n true * 0
This is not a design fault that I seperate the reference the element that is reference to.
We keep as it is, and we leave the design changing in the future....
Well, it is changed a little bit:
indicator ratio(multiple) optional maxOccurs minOccurs
no indicator: false false ^ ^
? false true ^ 0
+ true false * ^
* true true * 0
Now, the value of ratio is the boolean value of multiple. We keep the naming confusion here.
Becaust, it's too hard to change the coding interface.
Field Summary |
(package private) edu.wpi.cs.DSRG.xmldb.DTDWrapper.Element |
reference_node
The node used to get the reference information from the XML Schema DOM Tree. |
Constructor Summary |
Reference(edu.wpi.cs.DSRG.xmldb.DTDWrapper.Element reference_root)
Create a reference object which can used to browse the DOM tree to get what we need. |
Method Summary |
boolean |
getOptional()
Get whether this reference is optional. |
java.lang.String |
getRatio()
Get where this Ratio of this reference. |
Item |
getTo()
Get where this reference refer to. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
reference_node
edu.wpi.cs.DSRG.xmldb.DTDWrapper.Element reference_node
- The node used to get the reference information from the XML Schema DOM Tree.
XQL: it could be child of Group or ElementTypeDeclaration.
We use whatever it is as the "./" in the following methods.
Reference
public Reference(edu.wpi.cs.DSRG.xmldb.DTDWrapper.Element reference_root)
- Create a reference object which can used to browse the DOM tree to get what we need.
Keep that root node.
getTo
public Item getTo()
- Get where this reference refer to. It could be either an ElementTypeReference,
or a group.
XQL: ./
process:
if (./@TagName == "group") return Group object.
else if (./@TagName == "element") return Element object.
getRatio
public java.lang.String getRatio()
- Get where this Ratio of this reference. It could be either "1:1", or "1:n".
XQL: ./@maxOccurs
process:
if (./@maxOccurs == "*") return "1:n"
else return "1:1"
getOptional
public boolean getOptional()
- Get whether this reference is optional.
./@minOccurs
process:
if (./@minOccurs == "0") return true
else return false