codeable_models.CAttribute¶
-
class
codeable_models.
CAttribute
(**kwargs)¶ CAttribute
is internally used for storing attributes, and can be used by the user for detailed setting or introspection of attribute data.The
attributes
getter ofCClassifier
returnsCAttribute
objects. They can be used as an alternative method in theattributes
setter ofCClassifier
to define attributes of a classifier.- Parameters
**kwargs –
CAttribute
accepts:type
,default
.The
type
kwarg accepts a type argument in the form acceptable to thetype
property.The
default
kwarg accepts a default value in the form acceptable to thedefault
property.
-
property
classifier
¶ Property used to get the classifier of the attribute.
The attribute classifier is set automatically when the attribute is created on a classifier.
- Type
-
property
default
¶ Property used to set or get the default value of the attribute.
If an attribute type is set before the default value, the default value must conform to the type. Else the type is guessed from the provided default value.
- Type
default_value
-
property
name
¶ Property used to get the name of the attribute.
Will be set automatically if the attribute is created on a classifier.
- Type
str
-
property
type
¶ Property used to set or get the type of the attribute.
If a default value is set before the type, an exception will be raised if the new type does not match the default value.
Supported types of attributes are documented in the documentation of the
attributes
property ofCClassifier
.- Type
supported_type