Slot
const abstract class Slot : Obj
Slot represents a member field or method on a Type.
Return if this type has the specified facet defined
Parent type which defines this slot
Return if slot is static (class based, rather than instance)
Return a string representation of the Fantom code signature
Return true if this is an instance of Field
Return if this slot was generated by the compiler
Return if slot has private protection scope
Return if slot is native
Get the list of facets defined on this slot or return an empty list if no facets are defined
Return if slot has protected protection scope
Convenience for (Method)find(qname, checked)
Find a Slot by its qualified name "pod::Type.slot"
Return if slot is constant and thread safe
Qualified name such as "sys:Str.size"
Return if slot is an override (of parent's virtual method)
Return true if this is an instance of Method
Return if slot has public protection scope
Always return qname()
Convenience for findMethod(qname, checked).func
Return if slot is abstract (no implementation provided)
Return if slot has internal protection scope
Simple name of the slot such as "size"
Return the raw fandoc for this slot or null if not available
Return if slot is virtual (may be overridden in subclasses)
Convenience for (Field)find(qname, checked)
Get a facet by its type
Return if slot is constructor method
Str? doc()
Return the raw fandoc for this slot or null if not available.
Facet? facet(Type type, Bool checked)
Get a facet by its type. If not found on this slot then return null or throw UnknownFacetErr based on check flag. See Facets Doc for details.
Facet[] facets()
Get the list of facets defined on this slot or return an empty list if no facets are defined. If looking up a facet by type, then use the facet method which will provide better performance. See Facets Doc for details.
static Slot? find(Str qname, Bool checked)
Find a Slot by its qualified name "pod::Type.slot". If the slot doesn't exist and checked is false then return null, otherwise throw UnknownSlotErr.
static Field? findField(Str qname, Bool checked)
Convenience for (Field)find(qname, checked)
static Func? findFunc(Str qname, Bool checked)
Convenience for findMethod(qname, checked).func
static Method? findMethod(Str qname, Bool checked)
Convenience for (Method)find(qname, checked)
Bool hasFacet(Type type)
Return if this type has the specified facet defined.
Bool isAbstract()
Return if slot is abstract (no implementation provided).
Bool isConst()
Return if slot is constant and thread safe. A constant field is explicitly marked with the const modifier and guaranteed to always reference the same immutable object for the life of the VM. A const method is guaranteed to not capture any state from its thread, and is safe to execute on other threads. The compiler marks methods as const based on the following analysis:
- static methods are always automatically const
- instance methods are never const
- closures which don't capture any variables from their scope are automatically const
- partial apply methods which only capture const variables from their scope are automatically const
Bool isCtor()
Return if slot is constructor method.
Bool isField()
Return true if this is an instance of Field.
Bool isInternal()
Return if slot has internal protection scope.
Bool isMethod()
Return true if this is an instance of Method.
Bool isNative()
Return if slot is native.
Bool isOverride()
Return if slot is an override (of parent's virtual method).
Bool isPrivate()
Return if slot has private protection scope.
Bool isProtected()
Return if slot has protected protection scope.
Bool isPublic()
Return if slot has public protection scope.
Bool isStatic()
Return if slot is static (class based, rather than instance).
Bool isSynthetic()
Return if this slot was generated by the compiler.
Bool isVirtual()
Return if slot is virtual (may be overridden in subclasses).
Str name()
Simple name of the slot such as "size".
Type parent()
Parent type which defines this slot.
Str qname()
Qualified name such as "sys:Str.size".
virtual Str signature()
Return a string representation of the Fantom code signature.
virtual Str toStr()
Always return qname().