LuciadCPillar 2023.1.05
luciad::DataPropertyPath::Builder Class Referencefinal

Builder that allows DataPropertyPath instances to be created. More...

#include <luciad/datamodels/DataPropertyPath.h>

Public Member Functions

 ~Builder ()
 
DataPropertyPath build ()
 Build the data property path. More...
 
BuilderoriginType (const DataType &originType)
 Sets the type that the created path is associated to. More...
 
Builderproperty (const DataProperty &property)
 Sets the next property in the path. More...
 
Builderproperty (const std::string &name)
 Sets the name of the next property in the path. More...
 

Detailed Description

Builder that allows DataPropertyPath instances to be created.

Typical usage would be create a DataPropertyPath::Builder using DataPropertyPath::newBuilder, specifying the origin DataType. Then specify the properties to follow and finally build() the data property path. The following snippet shows how this is done for a simple example data property path:

return DataPropertyPath::newBuilder().originType(dataType).property(someProperty).build();
Builder & originType(const DataType &originType)
Sets the type that the created path is associated to.
Builder & property(const DataProperty &property)
Sets the next property in the path.
DataPropertyPath build()
Build the data property path.
static Builder newBuilder()
Creates a new builder.

Constructor & Destructor Documentation

◆ ~Builder()

luciad::DataPropertyPath::Builder::~Builder ( )

Member Function Documentation

◆ build()

DataPropertyPath luciad::DataPropertyPath::Builder::build ( )

Build the data property path.

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

Exceptions
luciad::LogicExceptionIf not all mandatory parameters are set.
Returns
the data property path.

◆ originType()

Builder & luciad::DataPropertyPath::Builder::originType ( const DataType originType)

Sets the type that the created path is associated to.

Calling this function is mandatory. You have to call this method before setting any property.

Parameters
originTypethe type that the created path is associated to.
Returns
this builder.
Exceptions
luciad::LogicExceptionif multiple origin type are set.

◆ property() [1/2]

Builder & luciad::DataPropertyPath::Builder::property ( const DataProperty property)

Sets the next property in the path.

Parameters
propertythe next property in the path.
Returns
this builder.
Exceptions
luciad::InvalidArgumentExceptionif no such property exists in the type that the path currently refers to.
luciad::LogicExceptionIf no origin type has been set.

◆ property() [2/2]

Builder & luciad::DataPropertyPath::Builder::property ( const std::string &  name)

Sets the name of the next property in the path.

Parameters
namethe name of the next property in the path.
Returns
this builder.
Exceptions
luciad::InvalidArgumentExceptionif no such property exists in the type that the path currently refers to.
luciad::LogicExceptionIf no origin type has been set.