public class SchemaTypeBuilder extends ReferenceableBuilder
SchemaTypeBuilder manages the properties for a schema type. These properties may be stored in a schema type entity or a type embedded attribute classification (linked off of schema attribute).
  • Constructor Details

    • SchemaTypeBuilder

      public SchemaTypeBuilder(String qualifiedName, String displayName, OMRSRepositoryHelper repositoryHelper, String serviceName, String serverName)
      Minimal constructor
      Parameters:
      qualifiedName - unique name
      displayName - new value for the display name.
      repositoryHelper - helper methods
      serviceName - name of this OMAS
      serverName - name of local server
    • SchemaTypeBuilder

      public SchemaTypeBuilder(String qualifiedName, String typeName, String typeId, OMRSRepositoryHelper repositoryHelper, String serviceName, String serverName)
      Simple typed constructor
      Parameters:
      qualifiedName - unique name
      typeName - name of the type for this schema element
      typeId - unique identifier of the type for this schema element
      repositoryHelper - helper methods
      serviceName - name of this OMAS
      serverName - name of local server
    • SchemaTypeBuilder

      public SchemaTypeBuilder(String qualifiedName, String displayName, String description, String versionNumber, boolean isDeprecated, String author, String usage, String encodingStandard, String namespace, Map<String,String> additionalProperties, String anchorGUID, String typeName, String typeId, Map<String,Object> extendedProperties, OMRSRepositoryHelper repositoryHelper, String serviceName, String serverName)
      Constructor supporting all common properties.
      Parameters:
      qualifiedName - unique name of schema type itself
      displayName - new value for the display name.
      description - description of the schema type.
      versionNumber - version of the schema type.
      isDeprecated - is the schema type deprecated
      author - name of the author
      usage - guidance on how the schema should be used.
      encodingStandard - format of the schema.
      namespace - namespace where the schema is defined.
      additionalProperties - additional properties
      anchorGUID - unique identifier of the anchor object for this schema type
      typeName - unique name of schema sub type
      typeId - unique identifier of the schema subtype
      extendedProperties - properties from the subtype.
      repositoryHelper - helper methods
      serviceName - name of this OMAS
      serverName - name of local server
  • Method Details

    • setDataType

      public void setDataType(String dataType)
      Set up the type of data (for simple and literal types)
      Parameters:
      dataType - string name
    • setDefaultValue

      public void setDefaultValue(String defaultValue)
      Set up the default value of a field (for simple types).
      Parameters:
      defaultValue - string value
    • setFixedValue

      public void setFixedValue(String fixedValue)
      Set up the fixed data value (for literal types).
      Parameters:
      fixedValue - string value
    • setMapTypes

      public void setMapTypes(SchemaTypeBuilder mapFrom, SchemaTypeBuilder mapTo)
      Set up the builder to support a map type. This needs to point to two other schema types.
      Parameters:
      mapFrom - the type of the value that is in the domain of the map
      mapTo - the type of the value that is in the rage of the map
    • getMapFrom

      public SchemaTypeBuilder getMapFrom()
      Return the builder for the type of the value that is in the domain of the map.
      Returns:
      builder for requested type
    • getMapTo

      public SchemaTypeBuilder getMapTo()
      Return the builder for the type of the value that is in the range of the map.
      Returns:
      builder for requested type
    • setSchemaOptions

      public void setSchemaOptions(List<SchemaTypeBuilder> schemaOptions)
      Set up the list of types that are represented by a schema option type.
      Parameters:
      schemaOptions - list of builders
    • getSchemaOptions

      public List<SchemaTypeBuilder> getSchemaOptions()
      Return the list of types that are represented by a schema option type.
      Returns:
      list of builders
    • setDerivedProperties

      public void setDerivedProperties(String formula, List<DerivedSchemaTypeQueryTarget> queries)
      Set up the properties that indicate that the schema element's value is not stored, it is derived from other values. The formula is stored in the CalculatedValue classification. If it is null, the queries are ignored. The queries are each stored as a DerivedSchemaTypeQueryTarget.
      Parameters:
      formula - expression, possibly with place holders to insert the values returned from the queries
      queries - optional queries to supply values to insert into the formula
    • isDerived

      public boolean isDerived()
      Return whether the schema has a derived value of not. This is determined from the setting of formula
      Returns:
      boolean
    • setMaximumElements

      @Deprecated public void setMaximumElements(int maximumElements)
      Deprecated.
      Set up the maximum number of elements allowed - zero for no limit. This property is deprecated because it is for BoundedSchemaType which is also deprecated.
      Parameters:
      maximumElements - int
    • getInstanceProperties

      public InstanceProperties getInstanceProperties(String methodName) throws InvalidParameterException
      Return the supplied bean properties in an InstanceProperties object.
      Overrides:
      getInstanceProperties in class ReferenceableBuilder
      Parameters:
      methodName - name of the calling method
      Returns:
      InstanceProperties object
      Throws:
      InvalidParameterException - there is a problem with the properties
    • getTypeEmbeddedInstanceProperties

      public InstanceProperties getTypeEmbeddedInstanceProperties(String methodName) throws InvalidParameterException
      Return the supplied bean properties in an InstanceProperties object for a TypeEmbeddedAttribute classification. If the caller uses this when there are extended properties defined for the builder then the call to create or add the entity will fail with invalid properties.
      Parameters:
      methodName - name of the calling method
      Returns:
      InstanceProperties object
      Throws:
      InvalidParameterException - there is a problem with the properties
    • getNameInstanceProperties

      public InstanceProperties getNameInstanceProperties(String methodName)
      Return the supplied bean properties that represent a name in an InstanceProperties object.
      Overrides:
      getNameInstanceProperties in class ReferenceableBuilder
      Parameters:
      methodName - name of the calling method
      Returns:
      InstanceProperties object
    • getQualifiedNameInstanceProperties

      public InstanceProperties getQualifiedNameInstanceProperties(String methodName)
      Return the supplied bean properties that represent a name in an InstanceProperties object.
      Overrides:
      getQualifiedNameInstanceProperties in class ReferenceableBuilder
      Parameters:
      methodName - name of the calling method
      Returns:
      InstanceProperties object