Declaration model for callable constructors, for example
class WithConstructors { shared new () {} shared new clone(WithConstructors other) {} // ... CallableConstructorDeclaration default = `new WithConstructors`; CallableConstructorDeclaration clone = `new WithConstructors.clone`;
The initializer of a class with a parameter list can also be
represented
as a CallableConstructorDeclaration
.
ValueConstructorDeclaration
no type hierarchy
no subtypes hierarchy
Attributes | |
abstract | Source Codeshared formal Boolean abstract True if the constructor has an abstract annotation. |
container | Source Codeshared formal ClassDeclaration container The class this constructor constructs Refines NestableDeclaration.container |
defaultConstructor | Source Codeshared formal Boolean defaultConstructor Whether this is the default constructor. The default constructor of a class is the constructor with no name. |
Inherited Attributes |
Attributes inherited from: Object |
Attributes inherited from: Declaration |
Attributes inherited from: FunctionalDeclaration |
Attributes inherited from: GenericDeclaration |
Attributes inherited from: NestableDeclaration |
Attributes inherited from: TypedDeclaration |
Methods | |
apply | Source Codeshared formal CallableConstructor<Result,Arguments> apply<Result = Object, Arguments = Nothing>(Type<Anything>* typeArguments) Applies the given closed type arguments to the declaration of the class enclosing this constructor declaration, returning a function model for the constructor Refines FunctionalDeclaration.apply |
invoke | Source Codeshared formal Object invoke(Type<Anything>[] typeArguments, Anything* arguments) Invokes the underlying toplevel function, by applying the specified type arguments and value arguments. Refines FunctionalDeclaration.invoke |
memberApply | Source Codeshared formal MemberClassCallableConstructor<Container,Result,Arguments> memberApply<Container = Nothing, Result = Object, Arguments = Nothing>(Type<Object> containerType, Type<Anything>* typeArguments) Applies the given closed type arguments to the declaration of the member class enclosing this constructor declaration, returning a method model for the constructor |
memberInvoke | Source Codeshared formal Object memberInvoke(Object container, Type<Anything>[] typeArguments, Anything* arguments) Invokes the underlying method, by applying the specified type arguments and value arguments. |
Inherited Methods |
Methods inherited from: Object |
Methods inherited from: Annotated |
Methods inherited from: AnnotatedDeclaration |
Methods inherited from: FunctionalDeclaration |
Methods inherited from: GenericDeclaration |