cs.arizona.tau.xml
Class PhysicalAnnotationValidator
java.lang.Object
cs.arizona.tau.xml.GenericValidator
cs.arizona.tau.xml.PhysicalAnnotationValidator
- All Implemented Interfaces:
- IPhysicalAnnotationValidator
public class PhysicalAnnotationValidator
- extends GenericValidator
- implements IPhysicalAnnotationValidator
- Author:
- spjoshi
TODO :
1) Remove hard-coding from function parseSnapshotSchema.
2) Remove hard-coding from function parsePhysicalAnnotation.
3) Exception handling.
4) Remove all the references to variable topLevelRepItemPrototype and functions using that variable.
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PhysicalAnnotationValidator
public PhysicalAnnotationValidator(java.lang.String physicalAnnotation,
java.lang.String snapshotSchema,
boolean createRepItemPrototypes)
- Parameters:
physicalAnnotation
- snapshotSchema
-
PhysicalAnnotationValidator
public PhysicalAnnotationValidator(org.w3c.dom.Document annotationDocument,
org.w3c.dom.Document snapshotSchemaDocument,
TargetIdentifier ti,
boolean createRepItemPrototypes)
- Parameters:
annotationDocument
- snapshotSchemaDocument
-
getRepType
public java.lang.String getRepType()
validatePhysicalAnnotation
public boolean validatePhysicalAnnotation()
- Description copied from interface:
IPhysicalAnnotationValidator
- Given snapshot Schema, Temporal Annotation and Physical Annotations, checks the consistency between them.
The consistency could be checked from various point of views
1) Physical Annotation should be a valid instance of PXShema which could be checked using conventional validator.
2) Whether the targets in given Physical Annotation are consistent with given snapshot schema.
3) At least one element above topmost target in temporal annotation has been timestamped.
- Specified by:
validatePhysicalAnnotation
in interface IPhysicalAnnotationValidator
getTopTarget
public java.lang.String getTopTarget()
- The function returns the name of topmost element which has been timestamped in Temporal Annotation.
- Returns:
validateTopTarget
public boolean validateTopTarget(java.lang.String topTarget)
createItemPrototypes
public void createItemPrototypes()
getItemPrototype
public Item getItemPrototype(java.lang.String target)
getTargetElements
public java.util.Hashtable<java.lang.String,org.w3c.dom.Element> getTargetElements()
collectTargets
public void collectTargets()
containsTarget
public boolean containsTarget(java.lang.String target)
createRepItemPrototypes
public void createRepItemPrototypes()
getRepItemPrototype
public RepItem getRepItemPrototype(java.lang.String target)
getTargetIterator
public java.util.Iterator getTargetIterator()