Class AssetSchemaType

  • All Implemented Interfaces:
    Serializable
    Direct Known Subclasses:
    AssetComplexSchemaType, AssetExternalSchemaType, AssetLiteralSchemaType, AssetMapSchemaType, AssetSchemaTypeChoice, AssetSimpleSchemaType

    public abstract class AssetSchemaType
    extends AssetSchemaElement

    The AssetSchemaType object provides a base class for the pieces that make up a schema for an asset. A schema provides information about how the data is structured in the asset. Schemas are typically described as nested structures of linked schema elements.

    AssetSchemaType is an abstract class - its subclasses enable the most accurate and precise mapping of the elements in a schema to the asset.
    • AssetPrimitiveSchemaType is for a leaf element in a schema.
    • AssetStructSchemaType is a complex structure of nested schema elements.
    • AssetMapSchemaType is for an attribute of type Map
    Most assets will be linked to a AssetComplexSchemaType.
    See Also:
    Serialized Form
    • Constructor Detail

      • AssetSchemaType

        protected AssetSchemaType​(AssetDescriptor parentAsset)
        Constructor used by the subclasses
        Parameters:
        parentAsset - descriptor of asset that this property relates to.
      • AssetSchemaType

        public AssetSchemaType​(SchemaType schemaTypeBean)
        Bean constructor
        Parameters:
        schemaTypeBean - bean containing the schema element properties
      • AssetSchemaType

        public AssetSchemaType​(AssetDescriptor parentAsset,
                               SchemaType schemaTypeBean)
        Bean constructor with parent asset
        Parameters:
        parentAsset - descriptor for parent asset
        schemaTypeBean - bean containing the schema element properties
      • AssetSchemaType

        public AssetSchemaType​(AssetDescriptor parentAsset,
                               AssetSchemaType templateSchema)
        Copy/clone Constructor - the parentAsset is passed separately to the template because it is also likely to be being cloned in the same operation and we want the definitions clone to point to the asset clone and not the original asset.
        Parameters:
        parentAsset - description of the asset that this schema element is attached to.
        templateSchema - template object to copy.
    • Method Detail

      • cloneAssetSchemaType

        protected abstract AssetSchemaType cloneAssetSchemaType​(AssetDescriptor parentAsset)
        Return a clone of this schema type. This method should be implemented by the subclasses.
        Parameters:
        parentAsset - description of the asset that this schema element is attached to.
        Returns:
        An instance of the this object's subclass
      • setBean

        protected void setBean​(SchemaType bean)
        Set up the bean that contains the properties of the schema.
        Parameters:
        bean - bean containing the schema properties
      • getSchemaTypeBean

        protected SchemaType getSchemaTypeBean()
        Return this schema type bean.
        Returns:
        An instance of the appropriate subclass of SchemaElement bean
      • getVersionNumber

        public String getVersionNumber()
        Return the version number of the schema element - null means no version number.
        Returns:
        String version number
      • getAuthor

        public String getAuthor()
        Return the name of the author of the schema element. Null means the author is unknown.
        Returns:
        String author name
      • getUsage

        public String getUsage()
        Return the usage guidance for this schema element. Null means no guidance available.
        Returns:
        String usage guidance
      • getEncodingStandard

        public String getEncodingStandard()
        Return the format (encoding standard) used for this schema. It may be XML, JSON, SQL DDL or something else. Null means the encoding standard is unknown or there are many choices.
        Returns:
        String encoding standard
      • getFormula

        public String getFormula()
        Return the formula used to combine the values of the queries. Each query is numbers 0, 1, ... and the formula has placeholders in it to show how the query results are combined.
        Returns:
        String formula
      • getQueries

        public List<DerivedSchemaTypeQueryTarget> getQueries()
        Return the list of queries that are used to create the derived schema element.
        Returns:
        list of queries
      • toString

        public String toString()
        Standard toString method.
        Overrides:
        toString in class AssetSchemaElement
        Returns:
        print out of variables in a JSON-style
      • equals

        public boolean equals​(Object objectToCompare)
        Compare the values of the supplied object with those stored in the current object.
        Overrides:
        equals in class AssetSchemaElement
        Parameters:
        objectToCompare - supplied object
        Returns:
        boolean result of comparison