add readOnly to the descriptor

This commit is contained in:
Alexander Nozik 2022-08-13 19:16:18 +03:00
parent e14c0a695e
commit f8eea45ed0
No known key found for this signature in database
GPG Key ID: F7FCF2DD25C71357
4 changed files with 6 additions and 2 deletions

View File

@ -2,6 +2,7 @@
## [Unreleased] ## [Unreleased]
### Added ### Added
- Add `readOnly` property to descriptors
- Add `specOrNull` delegate to meta and Scheme - Add `specOrNull` delegate to meta and Scheme
- Suspended read methods to the `Binary` - Suspended read methods to the `Binary`
- Synchronously accessed `meta` to all `DataSet`s - Synchronously accessed `meta` to all `DataSet`s

View File

@ -6,7 +6,7 @@ plugins {
allprojects { allprojects {
group = "space.kscience" group = "space.kscience"
version = "0.6.0-dev-13" version = "0.6.0-dev-14"
} }
subprojects { subprojects {

View File

@ -29,7 +29,7 @@ public enum class ValueRequirement {
* @param info description text * @param info description text
* @param children child descriptors for this node * @param children child descriptors for this node
* @param multiple True if same name siblings with this name are allowed * @param multiple True if same name siblings with this name are allowed
* @param required The requirements for node content * @param valueRequirement The requirements for node content
* @param valueTypes list of allowed types for [Meta.value], null if all values are allowed. * @param 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. * Empty list means that no value should be present in this node.
* @param indexKey An index field by which this node is identified in case of same name siblings construct * @param indexKey An index field by which this node is identified in case of same name siblings construct
@ -45,6 +45,7 @@ public data class MetaDescriptor(
public val valueTypes: List<ValueType>? = null, public val valueTypes: List<ValueType>? = null,
public val indexKey: String = Meta.INDEX_KEY, public val indexKey: String = Meta.INDEX_KEY,
public val defaultValue: Value? = null, public val defaultValue: Value? = null,
public val readOnly: Boolean = false,
public val attributes: Meta = Meta.EMPTY, public val attributes: Meta = Meta.EMPTY,
) { ) {
/** /**

View File

@ -13,6 +13,7 @@ public class MetaDescriptorBuilder @PublishedApi internal constructor() {
public var children: MutableMap<String, MetaDescriptorBuilder> = linkedMapOf() public var children: MutableMap<String, MetaDescriptorBuilder> = linkedMapOf()
public var multiple: Boolean = false public var multiple: Boolean = false
public var valueRequirement: ValueRequirement = ValueRequirement.NONE public var valueRequirement: ValueRequirement = ValueRequirement.NONE
public var readOnly: Boolean = false
public var type: List<ValueType>? = null public var type: List<ValueType>? = null
@ -85,6 +86,7 @@ public class MetaDescriptorBuilder @PublishedApi internal constructor() {
valueTypes = type, valueTypes = type,
indexKey = indexKey, indexKey = indexKey,
defaultValue = default, defaultValue = default,
readOnly = readOnly,
attributes = attributes attributes = attributes
) )
} }