DataProvider::AbstractDataField Class Referenceabstract

describes a data type based on a hashdecl More...

Inheritance diagram for DataProvider::AbstractDataField:
[legend]

## Public Member Functions

auto | acceptsValue (auto value)
| returns the value if the value can be assigned to the type More...
auto | getDefaultValue ()
| get default value, if any
abstract *string | getDescription ()
| returns the description, if any
hash< DataFieldInfo > | getInfo ()
| returns information about the field
hash< DataFieldInfo > | getInputInfo ()
| returns information about the field as an input field More...
abstract string | getName ()
| returns the name of the field
*hash< auto > | getOptions ()
| returns options set on the field's type
auto | getOptionValue (string opt)
| returns the value of the given option on the field's type
AbstractDataField | getOrNothingType ()
| returns a field with an "or nothing" type equivalent to the current type More...
AbstractDataField | getSoftType ()
| returns a field with a "soft" type equivalent to the current type More...
*hash< string, hash< DataProviderTypeOptionInfo > > | getSupportedOptions ()
| returns supported options on the field's type
abstract AbstractDataProviderType | getType ()
| returns the type of the field
string | getTypeName ()
| returns the type name
bool | hasType ()
| returns True if the field's type is not a wildcard type
bool | isAssignableFrom (AbstractDataProviderType t)
| returns True if this field's type can be assigned from values of the argument type
bool | isAssignableFrom (Type t)
| returns True if this field's type can be assigned from values of the argument type
bool | isList ()
| returns True if this field's type is a list
bool | isMandatory ()
| returns True if the field's type must have a value
| setDefaultValue (auto default_value)
| sets the default value for the field
| setOption (string opt, auto value)
| sets the given option on the field's type More...
| setOptions (hash< auto > options)
| sets the given options on the field's type More...

## Protected Attributes

auto | default_value
| the default value for the field, if any

## Detailed Description

describes a data type based on a hashdecl

## Member Function Documentation

## acceptsValue()

auto DataProvider::AbstractDataField::acceptsValue | ( | auto | value | ) |

returns the value if the value can be assigned to the type

Parameters

  value | the value to assign to the type

Returns
  the value to be assigned; can be converted by the type

## getInputInfo()

hash<DataFieldInfo> DataProvider::AbstractDataField::getInputInfo | ( |  | ) |

returns information about the field as an input field

the `default_value` key is not returned, and the `type` key returns only input information

## getOrNothingType()

AbstractDataField DataProvider::AbstractDataField::getOrNothingType | ( |  | ) |

returns a field with an "or nothing" type equivalent to the current type

The base class method returns the same fielf; this method must be overridden in child classes to return a field with a usable "or nothing" type

Returns
  a field with an "or nothing" type equivalent to the current type

## getSoftType()

AbstractDataField DataProvider::AbstractDataField::getSoftType | ( |  | ) |

returns a field with a "soft" type equivalent to the current type

The base class method returns the same field; this method must be overridden in child classes to return a field with a usable "soft" type

Returns
  a field with a "soft" type equivalent to the current type

## setOption()

DataProvider::AbstractDataField::setOption | ( | string | opt,
|  | auto | value
| ) |  |

sets the given option on the field's type

Parameters

  opt | the option to set
  value | the value to set

Exceptions

  TYPE-OPTION-ERROR | invalid option or invalid option type

## setOptions()

DataProvider::AbstractDataField::setOptions | ( | hash< auto > | options | ) |

sets the given options on the field's type

Parameters

  options | a hash of options, if any options match supported options for this type, they are set

Exceptions

  TYPE-OPTION-ERROR | option value has an invalid type