cs.arizona.tau.xml
Class DoTemporalValidation
java.lang.Object
cs.arizona.tau.xml.DoTemporalValidation
- All Implemented Interfaces:
- IDoTemporalValidation
public class DoTemporalValidation
- extends java.lang.Object
- implements IDoTemporalValidation
- Author:
- sthomas, spjoshi
Method Summary |
java.util.Hashtable |
getItemTable()
|
boolean |
validate(org.w3c.dom.Element temporalRoot)
|
boolean |
validate(java.lang.String temp_data_dir,
java.lang.String temporalDocument)
|
boolean |
validateEdit(java.lang.String temporalDocument)
|
boolean |
validateEdit2(java.lang.String temporalDocument)
|
boolean |
validateVer(org.w3c.dom.Document d)
First of all, the function should create representational schema using Schema Mapper. |
boolean |
validateVer(java.lang.String temp_data_dir,
java.lang.String strTemporalDoc)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DoTemporalValidation
public DoTemporalValidation(org.w3c.dom.Document bundleDoc,
int schemaVersion)
DoTemporalValidation
public DoTemporalValidation(java.lang.String temporalBundle,
int schemaVersion)
- Parameters:
temporalBundle
- schemaVersion
-
DoTemporalValidation
public DoTemporalValidation(java.lang.String snapshotSchema,
java.lang.String temporalAnnotation,
java.lang.String physicalAnnotation,
int schemaVersion)
- Parameters:
snapshotSchema
- temporalAnnotation
- physicalAnnotation
- schemaVersion
-
DoTemporalValidation
public DoTemporalValidation(TargetIdentifier ti,
LogicalAnnotationValidator tav,
PhysicalAnnotationValidator pav,
int schemaVersion)
- Parameters:
spe
- tav
- pav
- schemaVersion
-
validate
public boolean validate(java.lang.String temp_data_dir,
java.lang.String temporalDocument)
- Specified by:
validate
in interface IDoTemporalValidation
validateVer
public boolean validateVer(java.lang.String temp_data_dir,
java.lang.String strTemporalDoc)
validateVer
public boolean validateVer(org.w3c.dom.Document d)
- First of all, the function should create representational schema using Schema Mapper.
Then the document is validated by using conventional validator against representational schema.
If conventional validator validates the document, function collectItems() is called to collect
all the items in itemTable. Then for every item, it calls function validate which internally validates
all the constraints on the item and returns the boolean.
If all the items are validated, the document is valid, else document is not valid.
(non-Javadoc)
- See Also:
cs.arizona.tau.xml.IDoTemporalValidation#validate()
validate
public boolean validate(org.w3c.dom.Element temporalRoot)
getItemTable
public java.util.Hashtable getItemTable()
validateEdit2
public boolean validateEdit2(java.lang.String temporalDocument)
- Parameters:
strTemporalDoc
-
- Returns:
- (Nov 11, 2008) NOTE: Rick suggests another methodology than this. I'll leave this function in
for historical purposes (appended a "2" to the name)
This function validates an edit-based temporal document.
Note: this function currently differs significantly from its version-based
counterpart. Only one temporal constraint is implemented: content-constant periods.
The steps take are:
1. Call unsquash to create a bunch of files
2. Read in all the files
3. Check each file.
There might be a better way (such as doing some complicated analysis on the diff scripts).
validateEdit
public boolean validateEdit(java.lang.String temporalDocument)
- Parameters:
strTemporalDoc
-
- Returns:
- This function validates an edit-based temporal document.
The methodology is as follows:
1. Unsquash the temporal document, resulting in a list of Documents (in memory)
2. Build a item-based representation with these Documents (timestamp at root)
3. Validate item-based-representation the regular way.
This promotes software re-use and simplicity.