Package uk.ac.starlink.ttools.taplint
Class CompareMetadataStage
- java.lang.Object
-
- uk.ac.starlink.ttools.taplint.CompareMetadataStage
-
-
Constructor Summary
Constructors Constructor Description CompareMetadataStage(java.lang.String srcDesc1, java.lang.String srcDesc2, MetadataHolder metaHolder1, MetadataHolder metaHolder2)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
compatibleDataTypes(java.lang.String dt1, java.lang.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.java.lang.String
getDescription()
Returns a short one-line description of this stage.void
run(Reporter reporter, uk.ac.starlink.vo.TapService tapService)
Performs the validation checks for this stage.static java.lang.String
stripAdqlType(java.lang.String dtype)
Takes a string which may be an ADQL type and strips off confusing parts including any "adql:" prefix and trailing parenthesis.
-
-
-
Constructor Detail
-
CompareMetadataStage
public CompareMetadataStage(java.lang.String srcDesc1, java.lang.String srcDesc2, MetadataHolder metaHolder1, MetadataHolder metaHolder2)
Constructor.- Parameters:
srcDesc1
- short description of source of first metadata setsrcDesc2
- short description of source of second metadata setmetaHolder1
- supplies first metadata set at comparison timemetaHolder2
- supplies second metadata set at comparison time
-
-
Method Detail
-
getDescription
public java.lang.String getDescription()
Description copied from interface:Stage
Returns a short one-line description of this stage.- Specified by:
getDescription
in interfaceStage
- Returns:
- description in imperative mood
-
run
public void run(Reporter reporter, uk.ac.starlink.vo.TapService tapService)
Description copied from interface:Stage
Performs the validation checks for this stage.
-
compatibleDataTypes
public static boolean compatibleDataTypes(java.lang.String dt1, java.lang.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.Note however that, as clarified by TAP 1.0 Erratum #3, TAP/ADQL has no type system, so any comparison involving the types listed in TAP v1.0 section 2.5 cannot be normative. So any report issued on failure of this test should only be a Warning and not an Error.
- Parameters:
dt1
- first data typedt2
- second data type- Returns:
- true iff it looks like the submitted types are compatible
-
stripAdqlType
public static java.lang.String stripAdqlType(java.lang.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 stagestage2
- second metadata producing stage- Returns:
- comparison stage
-
-