Class DataModel.Builder

java.lang.Object
com.luciad.datamodels.DataModel.Builder
All Implemented Interfaces:
AutoCloseable
Enclosing class:
DataModel

public static final class DataModel.Builder extends Object implements AutoCloseable
Builder that allows DataModel instances to be created.

Typical usage would be to create a DataModel.Builder using DataModel#newBuilder, specifying the data model's name. Then add the necessary DataType(s) and finally build() the DataModel. The following snippet shows how this is done for a simple example data model:

return DataModel.newBuilder()
.name("http://www.mydomain.com/datamodel/TestFeatureModel")
.addDataType(dataType)
.build();
  • Constructor Details Link icon

  • Method Details Link icon

    • finalize Link icon

      protected void finalize()
      Overrides:
      finalize in class Object
    • close Link icon

      public void close()
      Specified by:
      close in interface AutoCloseable
    • build Link icon

      @NotNull public DataModel build() throws IllegalStateException
      Build the data model, including the types that were added to this builder.

      After calling this function, this builder should no longer be used.

      Returns:
      the data model.
      Throws:
      IllegalStateException - If not all mandatory parameters are set.
    • addDataType Link icon

      @NotNull public DataModel.Builder addDataType(@NotNull DataType type)
      Adds a DataType to the data model under construction.
      Parameters:
      type - the DataType to add to the data model under construction.
      Returns:
      this builder.
    • name Link icon

      @NotNull public DataModel.Builder name(@NotNull String name)
      Sets the name for the data model.

      Calling this function is mandatory.

      Parameters:
      name - the name for the data model.
      Returns:
      this builder.