use of act.util.FastJsonPropertyPreFilter in project actframework by actframework.
the class Endpoint method explore.
private void explore(RequestHandler handler) {
RequestHandlerProxy proxy = $.cast(handler);
ReflectedHandlerInvoker invoker = $.cast(proxy.actionHandler().invoker());
Class<?> controllerClass = invoker.controllerClass();
Method method = invoker.method();
returnType = method.getReturnType();
PropertySpec pspec = method.getAnnotation(PropertySpec.class);
if (null != pspec) {
PropertySpec.MetaInfo propSpec = new PropertySpec.MetaInfo();
for (String v : pspec.value()) {
propSpec.onValue(v);
}
for (String v : pspec.http()) {
propSpec.onValue(v);
}
List<String> outputs = propSpec.outputFieldsForHttp();
Set<String> excluded = propSpec.excludeFieldsForHttp();
if (!(outputs.isEmpty() && excluded.isEmpty())) {
fastJsonPropertyPreFilter = new FastJsonPropertyPreFilter(returnType, outputs, excluded, Act.app().service(DataPropertyRepository.class));
}
// just ignore cli value here
}
this.id = id(method);
returnSample = generateSampleJson(BeanSpec.of(method.getGenericReturnType(), null, Act.injector()));
Description descAnno = method.getAnnotation(Description.class);
this.description = null == descAnno ? methodDescription(method) : descAnno.value();
exploreParamInfo(method);
if (!Modifier.isStatic(method.getModifiers())) {
exploreParamInfo(controllerClass);
}
this.controllerClass = controllerClass;
}
Aggregations