Class DefaultRecordSchema

Object
DefaultRecordSchema
All Implemented Interfaces:
Serializable, Record­Schema

public final class DefaultRecordSchema extends Object implements RecordSchema, Serializable
A factory for creating Record­Type instances.
Possible future change: This class is derived from ISO 19103:2005. The record attributes and methods have been modified in ISO 19103:2015, then all classes related to records have been fully removed in ISO 19103:2024. The implication for Apache SIS has not yet been determined. In the meantime, this class should be considered as merely a factory of Default­Record­Type instances.

Thread safety

The same Default­Record­Schema instance can be safely used by many threads without synchronization on the part of the caller if the Name­Factory given to the constructor is also thread-safe. Subclasses should make sure that any overridden methods remain safe to call from multiple threads.
Since:
0.5
See Also:
  • Constructor Details

    • DefaultRecordSchema

      public DefaultRecordSchema(CharSequence schemaName)
      Creates a new schema of the given name.
      Parameters:
      schema­Name - the name of the new schema.
      Since:
      1.6
  • Method Details

    • getSchemaName

      public LocalName getSchemaName()
      Returns the schema name.
      Specified by:
      get­Schema­Name in interface Record­Schema
      Returns:
      the schema name.
    • createRecordTypeName

      public TypeName createRecordTypeName(CharSequence typeName)
      Creates the name of a record.
      Parameters:
      type­Name - name of the record type to create.
      Returns:
      name of a record type.
      Since:
      1.3
    • createRecordType

      public DefaultRecordType createRecordType(CharSequence typeName, Map<CharSequence, Class<?>> fields) throws IllegalArgumentException
      Creates a new record type of the given name, which will contain the given fields. Fields are declared in iteration order.
      Parameters:
      type­Name - name of the record type to create.
      fields - the name of each record field, together with the expected value types.
      Returns:
      a record type of the given name and fields.
      Throws:
      Illegal­Argument­Exception - if a record already exists for the given name but with different fields.
    • getDescription

      public Map<TypeName, RecordType> getDescription()
      Returns the dictionary of all (name, record type) pairs in this schema.
      Specified by:
      get­Description in interface Record­Schema
      Returns:
      all (name, record type) pairs in this schema.
    • locate

      public RecordType locate(TypeName name)
      Returns the record type for the given name. If the type name is not defined within this schema, then this method returns null.
      Specified by:
      locate in interface Record­Schema
      Parameters:
      name - the name of the type to lookup.
      Returns:
      the type for the given name, or null if none.