A class model represents the model of a Ceylon class that you can inspect.

A class model can be either a toplevel Class or a member MemberClass.

no type hierarchy

Attributes
declarationSource Codeshared formal ClassDeclaration declaration

The declaration model of this class, which is necessarily a ClassDeclaration.

defaultConstructorSource Codeshared formal FunctionModel<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.

Since 1.2.0
Inherited Attributes
Attributes inherited from: Object
Attributes inherited from: ClassOrInterface<Type>
Attributes inherited from: Declared
Attributes inherited from: Generic
Attributes inherited from: Model
Methods
getCallableConstructorsSource Codeshared formal FunctionModel<Type,Arguments>[] getCallableConstructors<Arguments = Nothing>(ClosedType<Annotation>[] annotationTypes)

Returns the list of shared callable constructors on this class and annotated with all the specified annotations. This does not include unshared callable constructors.

Since 1.2.0
getConstructorSource Codeshared formal FunctionModel<Type,Arguments>|ValueModel<Type,Nothing>? getConstructor<Arguments>(String name)

Looks up a constructor by name, Returns null if no such constructor matches. This excludes unshared constructors.

Throws
Since 1.2.0
getDeclaredCallableConstructorsSource Codeshared formal FunctionModel<Type,Arguments>[] getDeclaredCallableConstructors<Arguments = Nothing>(ClosedType<Annotation>[] annotationTypes)

Returns the list of callable constructors directly declared on this class and annotated with all the specified annotations. This includes unshared callable constructors.

Since 1.2.0
getDeclaredConstructorSource Codeshared formal FunctionModel<Type,Arguments>|ValueModel<Type,Nothing>? getDeclaredConstructor<Arguments>(String name)

Looks up a constructor by name, Returns null if no such constructor matches. This includes unshared constructors.

Throws
Since 1.2.0
getDeclaredValueConstructorsSource Codeshared formal ValueModel<Type,Nothing>[] getDeclaredValueConstructors(ClosedType<Annotation>[] annotationTypes)

Returns the list of value constructors directly declared on this class and annotated with all the specified annotations. This includes unshared constructors.

Since 1.2.0
getValueConstructorsSource Codeshared formal ValueModel<Type,Nothing>[] getValueConstructors(ClosedType<Annotation>[] annotationTypes)

Returns the list of shared value constructors on this class and annotated with all the specified annotations. This does not include unshared value constructors.

Since 1.2.0
Inherited Methods
Methods inherited from: Object
Methods inherited from: ClassOrInterface<Type>
Methods inherited from: ClosedType<Target>