TypeMirror mirror = (TypeMirror)value.getValue();
if(mirror == null){
return className;
}
if (value instanceof InterfaceType) {
throw new ValidationException(
MessageCode.SLIM3GEN1055,
env,
declaration.getPosition());
}
ClassType coderClassType = TypeUtil.toClassType(mirror);
if(coderClassType == null) return className;
ClassDeclaration coderClassDeclaration =
coderClassType.getDeclaration();
if (coderClassDeclaration == null) {
throw new UnknownDeclarationException(
env,
coderClassDeclaration,
coderClassType);
}
className = coderClassDeclaration.getQualifiedName();
if (!DeclarationUtil
.hasPublicDefaultConstructor(coderClassDeclaration)) {
throw new ValidationException(
MessageCode.SLIM3GEN1054,
env,
declaration.getPosition(),
className);
}