uk.ac.starlink.ttools.taplint
Class CompareMetadataStage

java.lang.Object
  extended by uk.ac.starlink.ttools.taplint.CompareMetadataStage
All Implemented Interfaces:
Stage

public class CompareMetadataStage
extends Object
implements Stage

Validation stage for checking that two sets of table metadata (presumably obtained via different routes) are equivalent to each other.

Since:
7 Jun 2011
Author:
Mark Taylor

Constructor Summary
CompareMetadataStage(String srcDesc1, String srcDesc2, MetadataHolder metaHolder1, MetadataHolder metaHolder2)
          Constructor.
 
Method Summary
static boolean compatibleDataTypes(String dt1, String dt2)
          Indicates whether two datatypes are compatible with each other.
static CompareMetadataStage createStage(TableMetadataStage stage1, TableMetadataStage stage2)
          Utility method to construct a CompareMetadataStage instance given two TableMetadataStage objects.
 String getDescription()
          Returns a short one-line description of this stage.
 void run(Reporter reporter, URL serviceUrl)
          Performs the validation checks for this stage.
static String stripAdqlType(String dtype)
          Takes a string which may be an ADQL type and strips off confusing parts including any "adql:" prefix and trailing parenthesis.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompareMetadataStage

public CompareMetadataStage(String srcDesc1,
                            String srcDesc2,
                            MetadataHolder metaHolder1,
                            MetadataHolder metaHolder2)
Constructor.

Parameters:
srcDesc1 - short description of source of first metadata set
srcDesc2 - short description of source of second metadata set
metaHolder1 - supplies first metadata set at comparison time
metaHolder2 - supplies second metadata set at comparison time
Method Detail

getDescription

public String getDescription()
Description copied from interface: Stage
Returns a short one-line description of this stage.

Specified by:
getDescription in interface Stage
Returns:
description in imperative mood

run

public void run(Reporter reporter,
                URL serviceUrl)
Description copied from interface: Stage
Performs the validation checks for this stage.

Specified by:
run in interface Stage
Parameters:
reporter - destination for validation messages
serviceUrl - TAP service URL

compatibleDataTypes

public static boolean compatibleDataTypes(String dt1,
                                          String dt2)
Indicates whether two datatypes are compatible with each other. Datatypes may be either VOTable or TAP/adql type. See VODataService v1.1 section 3.5.3 and TAP v1.0 section 2.5. The logic is somewhat sloppy.

Parameters:
dt1 - first data type
dt2 - second data type
Returns:
true iff it looks like the submitted types are compatible

stripAdqlType

public static String stripAdqlType(String dtype)
Takes a string which may be an ADQL type and strips off confusing parts including any "adql:" prefix and trailing parenthesis.

Parameters:
dtype - string which may be an ADQL datatype
Returns:
base ADQL data type if appropriate, else input string

createStage

public static CompareMetadataStage createStage(TableMetadataStage stage1,
                                               TableMetadataStage stage2)
Utility method to construct a CompareMetadataStage instance given two TableMetadataStage objects.

Parameters:
stage1 - first metadata producing stage
stage2 - second metadata producing stage
Returns:
comparison stage


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.