constructorKindFromMirror function
Implementation
ConstructorKind constructorKindFromMirror(MethodMirror methodMirror) {
if (!methodMirror.isConstructor) {
throw MethodIsNotConstructorException(methodMirror: methodMirror);
}
if (methodMirror.isConstConstructor) {
return ConstructorKind.CONST;
}
if (methodMirror.isFactoryConstructor) {
return ConstructorKind.FACTORY;
}
if (methodMirror.isGenerativeConstructor) {
return ConstructorKind.GENERATIVE;
}
if (methodMirror.isRedirectingConstructor) {
return ConstructorKind.REDIRECTING;
}
throw UnknownConstructorTypeException(methodMirror: methodMirror);
}