A class model represents the model of a Ceylon class that you can instantiate and inspect.
A member class is is declared on classes or interfaces.
This is both a ClassModel
and a Member
: you can invoke it with an instance value
to bind it to that instance and obtain a Class
:
shared class Outer(String name){ shared class Inner(){ shared String hello => "Hello "+name; } } void test(){ MemberClass<Outer,Outer.Inner,[]> memberClass = `Outer.Inner`; Class<Outer.Inner,[]> c = memberClass(Outer("Stef")); // This will print: Hello Stef print(c().hello); }
no type hierarchy
no subtypes hierarchy
Attributes | |
defaultConstructor | Source Codeshared formal MemberClassCallableConstructor<Container,Type,Arguments>? defaultConstructor A function model for this class's initializer or default constructor, or null if this class has constructors but lacks a default constructor. Refines ClassModel.defaultConstructor |
Inherited Attributes |
Attributes inherited from: Object |
Attributes inherited from: ClassModel<Type,Arguments> |
Attributes inherited from: ClassOrInterface<Type> |
Attributes inherited from: Declared |
Attributes inherited from: Generic |
Attributes inherited from: Member<Container,Kind> |
Attributes inherited from: Model |
Methods | |
bind | Source Codeshared formal Class<Type,Arguments> bind(Anything container) Type-unsafe container binding, to be used when the container type is unknown until runtime. A null argument is only permitted for This has the same behaviour as invoking this Refines Qualified.bind |
getConstructor | Source Codeshared formal MemberClassCallableConstructor<Container,Type,Arguments>|MemberClassValueConstructor<Container,Type>? getConstructor<Arguments>(String name) The constructor with the given name, or null if this class lacks a constructor of the given name Refines ClassModel.getConstructor |
Inherited Methods |
Methods inherited from: Object |
Methods inherited from: ClassModel<Type,Arguments> |
Methods inherited from: ClassOrInterface<Type> getAttribute() , getAttributes() , getClass() , getClassOrInterface() , getClasses() , getDeclaredAttribute() , getDeclaredAttributes() , getDeclaredClass() , getDeclaredClassOrInterface() , getDeclaredClasses() , getDeclaredInterface() , getDeclaredInterfaces() , getDeclaredMethod() , getDeclaredMethods() , getInterface() , getInterfaces() , getMethod() , getMethods() |
Methods inherited from: Qualified<Kind,Container> |
Methods inherited from: Type<Target> |