MetaDescriptor

data class MetaDescriptor(info: String?, children: Map<String, MetaDescriptor>, multiple: Boolean, valueRequirement: ValueRequirement, valueTypes: List<ValueType>?, indexKey: String, defaultValue: Value?, attributes: Meta)

The descriptor for a meta

Parameters

info

description text

children

child descriptors for this node

multiple

True if same name siblings with this name are allowed

required

The requirements for node content

valueTypes

list of allowed types for Meta.value, null if all values are allowed. Empty list means that no value should be present in this node.

indexKey

An index field by which this node is identified in case of same name siblings construct

defaultValue

the default Meta.value for the node

attributes

additional attributes of this descriptor. For example validation and widget parameters

Constructors

MetaDescriptor
Link copied to clipboard
common
fun MetaDescriptor(info: String? = null, children: Map<String, MetaDescriptor> = emptyMap(), multiple: Boolean = false, valueRequirement: ValueRequirement = ValueRequirement.NONE, valueTypes: List<ValueType>? = null, indexKey: String = Meta.INDEX_KEY, defaultValue: Value? = null, attributes: Meta = Meta.EMPTY)

Types

Companion
Link copied to clipboard
common
object Companion

Properties

attributes
Link copied to clipboard
common
val attributes: Meta
children
Link copied to clipboard
common
val children: Map<String, MetaDescriptor>
defaultNode
Link copied to clipboard
common
val defaultNode: Meta

A node constructed of default values for this descriptor and its children

defaultValue
Link copied to clipboard
common
val defaultValue: Value? = null
indexKey
Link copied to clipboard
common
val indexKey: String
info
Link copied to clipboard
common
val info: String? = null
multiple
Link copied to clipboard
common
val multiple: Boolean = false
valueRequirement
Link copied to clipboard
common
val valueRequirement: ValueRequirement
valueTypes
Link copied to clipboard
common
val valueTypes: List<ValueType>? = null

Extensions

allowedValues
Link copied to clipboard
common
val MetaDescriptor.allowedValues: List<Value>?
copy
Link copied to clipboard
common
fun MetaDescriptor.copy(block: MetaDescriptorBuilder.() -> Unit = {}): MetaDescriptor

Make a deep copy of this descriptor applying given transformation block

get
Link copied to clipboard
common
operator fun MetaDescriptor.get(name: Name): MetaDescriptor?
operator fun MetaDescriptor.get(name: String): MetaDescriptor?
required
Link copied to clipboard
common
val MetaDescriptor.required: Boolean
validate
Link copied to clipboard
common
fun MetaDescriptor.validate(value: Value?): Boolean
fun MetaDescriptor.validate(item: Meta?): Boolean

Check if given item suits the descriptor