2014-11-20 12:07:48 -08:00
|
|
|
library reflection.reflection;
|
|
|
|
|
|
|
|
|
|
import 'reflector.dart';
|
|
|
|
|
import 'types.dart';
|
|
|
|
|
export 'reflector.dart';
|
2015-05-18 17:19:54 -07:00
|
|
|
import 'platform_reflection_capabilities.dart';
|
2015-08-20 14:28:25 -07:00
|
|
|
import 'package:angular2/src/core/facade/lang.dart';
|
2014-11-20 12:07:48 -08:00
|
|
|
|
2015-05-18 17:19:54 -07:00
|
|
|
class NoReflectionCapabilities implements PlatformReflectionCapabilities {
|
2015-07-10 08:54:53 -07:00
|
|
|
bool isReflectionEnabled() {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2015-04-17 11:07:23 -07:00
|
|
|
Function factory(Type type) {
|
2014-11-20 12:07:48 -08:00
|
|
|
throw "Cannot find reflection information on ${stringify(type)}";
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-18 17:19:54 -07:00
|
|
|
List interfaces(Type type) {
|
|
|
|
|
throw "Cannot find reflection information on ${stringify(type)}";
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-20 12:07:48 -08:00
|
|
|
List parameters(Type type) {
|
|
|
|
|
throw "Cannot find reflection information on ${stringify(type)}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List annotations(Type type) {
|
|
|
|
|
throw "Cannot find reflection information on ${stringify(type)}";
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-03 15:10:48 -07:00
|
|
|
Map propMetadata(Type type) {
|
|
|
|
|
throw "Cannot find reflection information on ${stringify(type)}";
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-20 12:07:48 -08:00
|
|
|
GetterFn getter(String name) {
|
|
|
|
|
throw "Cannot find getter ${name}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SetterFn setter(String name) {
|
2014-11-24 18:02:21 -08:00
|
|
|
throw "Cannot find setter ${name}";
|
2014-11-20 12:07:48 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MethodFn method(String name) {
|
|
|
|
|
throw "Cannot find method ${name}";
|
|
|
|
|
}
|
2015-08-19 16:56:46 -07:00
|
|
|
|
|
|
|
|
String importUri(Type type) => './';
|
2015-09-14 15:59:09 -07:00
|
|
|
|
|
|
|
|
String moduleId(Type type) => null;
|
2014-11-20 12:07:48 -08:00
|
|
|
}
|
|
|
|
|
|
2015-04-17 11:07:23 -07:00
|
|
|
final Reflector reflector = new Reflector(new NoReflectionCapabilities());
|