cs.arizona.tau.xml
Class PhysicalAnnotationValidator

java.lang.Object
  extended by cs.arizona.tau.xml.GenericValidator
      extended by 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.

Constructor Summary
PhysicalAnnotationValidator(org.w3c.dom.Document annotationDocument, org.w3c.dom.Document snapshotSchemaDocument, TargetIdentifier ti, boolean createRepItemPrototypes)
           
PhysicalAnnotationValidator(java.lang.String physicalAnnotation, java.lang.String snapshotSchema, boolean createRepItemPrototypes)
           
 
Method Summary
 void collectTargets()
           
 boolean containsTarget(java.lang.String target)
           
 void createItemPrototypes()
           
 void createRepItemPrototypes()
           
 Item getItemPrototype(java.lang.String target)
           
 RepItem getRepItemPrototype(java.lang.String target)
           
 java.lang.String getRepType()
           
 java.util.Hashtable<java.lang.String,org.w3c.dom.Element> getTargetElements()
           
 java.util.Iterator getTargetIterator()
           
 java.lang.String getTopTarget()
          The function returns the name of topmost element which has been timestamped in Temporal Annotation.
 boolean validatePhysicalAnnotation()
          Given snapshot Schema, Temporal Annotation and Physical Annotations, checks the consistency between them.
 boolean validateTopTarget(java.lang.String topTarget)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 -
Method Detail

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()