Class TAPSchemaUtils

java.lang.Object
org.ivoa.dm.tapschema.TAPSchemaUtils

public class TAPSchemaUtils extends Object
Utilities concerned with model column and table name normalization. Note that this is here to allow package access to the DM.
  • Method Details

    • normalizeFromSerialization

      public static void normalizeFromSerialization(TapschemaModel model)
      Normalize the model keys. Make sure that the correct keys are generated for a model that as been translated from an XML instance. This needs to be done to make the model ready for saving to a database.
      Parameters:
      model - the model instance to be normalized.
    • adjustforTAPStd

      public static Schema adjustforTAPStd(Schema schema)
      Used to prepare a schema for use in the TAP service.
      Parameters:
      schema -
      Returns:
      a copy of the original schema with the table names denormalised to have the schema included as required by the TAP standard.
    • prepareForSerialization

      public static void prepareForSerialization(TapschemaModel model)
      prepare a model that has been read from a database for XML serialization. Note that the serialization is not performed.
      Parameters:
      model - the model to be serialized
    • readModelFromXML

      public static TapschemaModel readModelFromXML(Source xml) throws jakarta.xml.bind.JAXBException
      Read a tapschema model from an XML source. This is used to read the TAP schema from the standard XML representation.
      Parameters:
      xml - The xml source.
      Returns:
      the TAPSchemaModel.
      Throws:
      jakarta.xml.bind.JAXBException
    • copy

      public static TapschemaModel copy(TapschemaModel model) throws jakarta.xml.bind.JAXBException
      Copy a TAPSchema model.
      Parameters:
      model - The model to copy.
      Returns:
      The copied model.
      Throws:
      jakarta.xml.bind.JAXBException