Package com.luciad.datamodels
Class DataModel.Builder
java.lang.Object
com.luciad.datamodels.DataModel.Builder
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
DataModel
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
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
build
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
Adds aDataType
to the data model under construction.- Parameters:
type
- theDataType
to add to the data model under construction.- Returns:
- this builder.
-
name
Sets the name for the data model.Calling this function is mandatory.
- Parameters:
name
- the name for the data model.- Returns:
- this builder.
-