type
Spec
Xeto data specification.
Spec dict representation:
- id: Ref "lib:{qname}"
- spec: Ref "sys::Spec"
- base: Ref to base type (types only)
- type: Ref to slot type (slots only)
- effective meta
methods
| base |
Base spec from which this spec directly inherits its meta and slots. |
|---|---|
| eachInherited |
Call the given function on this spec and every spec that it inherits from up to |
| enum |
Return enum item meta. |
| func |
Return function specific APIs. |
| globals |
Get all the effective globals including inherited. |
| globalsOwn |
Globals declared by this spec. |
| id |
Identifier for a spec is always its qualified name |
| isChoice |
Return if this is a spec that inherits from |
| isEnum |
Is the base |
| isFunc |
Return if this a function spec |
| isGlobal |
Is this a global slot under a parent |
| isMaybe |
Does meta have maybe tag. |
| isMember |
Is this a slot or global under a parent |
| isMixin |
Is this a top level mixin spec |
| isSlot |
Is this a slot under a parent |
| isType |
Is this a top level type spec |
| isa |
Return if |
| lib |
Parent library for spec |
| member |
Convenience for |
| members |
Get a map with all the inherited slots and globals. |
| membersOwn |
Get a map with all the declared slots and globals. |
| meta |
Get my effective meta; this does not include synthesized tags like |
| metaOwn |
Get my own declared meta-data |
| name | |
| parent |
Parent spec which contains this spec definition and scopes |
| qname |
Return fully qualified name of this spec |
| slot |
Convenience for |
| slotOwn |
Convenience for |
| slots |
Get the effective inherited children slots. |
| slotsOwn |
Get the declared children slots. |
| type |
Type of this spec. |
Slot Details
base
abstract Spec? base()
Base spec from which this spec directly inherits its meta and slots. Returns null if this is sys::Obj itself.
eachInherited
enum
func
globals
abstract SpecMap globals()
Get all the effective globals including inherited. Note that some of the globals may be hidden by slots.
globalsOwn
abstract SpecMap globalsOwn()
Globals declared by this spec.
id
abstract override Ref id()
Identifier for a spec is always its qualified name
isChoice
abstract Bool isChoice()
Return if this is a spec that inherits from sys::Choice. If this spec inherits from a choice via a And/Or type then return false. See Namespace.choice to access SpecChoice API.
isEnum
abstract Bool isEnum()
Is the base sys::Enum
isFunc
abstract Bool isFunc()
Return if this a function spec
isGlobal
abstract Bool isGlobal()
Is this a global slot under a parent
isMaybe
abstract Bool isMaybe()
Does meta have maybe tag. Maybe slots are optional
isMember
abstract Bool isMember()
Is this a slot or global under a parent
isMixin
abstract Bool isMixin()
Is this a top level mixin spec
isSlot
abstract Bool isSlot()
Is this a slot under a parent
isType
abstract Bool isType()
Is this a top level type spec
isa
Return if this spec inherits from that from a nominal type perspective. Nonimal typing matches any of the following conditions:
- if
thatmatches one ofthisinherited specs viabase - if
thisis maybe and that isNone - if
thisisAndandthatmatches anythis.ofs - if
thisisOrandthatmatches allthis.ofs(common base) - if
thatisOrandthismatches any ofthat.ofs
lib
abstract Lib lib()
Parent library for spec
member
members
abstract SpecMap members()
Get a map with all the inherited slots and globals.
membersOwn
abstract SpecMap membersOwn()
Get a map with all the declared slots and globals.
meta
abstract Dict meta()
Get my effective meta; this does not include synthesized tags like spec
metaOwn
abstract Dict metaOwn()
Get my own declared meta-data
name
parent
qname
abstract Str qname()
Return fully qualified name of this spec:
- Type specs will return "foo.bar::Baz"
- Global slots will return "foo.bar::baz"
- Type slots will return "foo.bar::Baz.qux"
- Derived specs will return "derived123::{name}"
slot
slotOwn
slots
abstract SpecMap slots()
Get the effective inherited children slots.
slotsOwn
abstract SpecMap slotsOwn()
Get the declared children slots.
type
abstract Spec type()
Type of this spec. If this spec is a top level type then return self.