use of act.util.ClassNode in project actframework by actframework.
the class ResultClassLookup method loadResultClasses.
private void loadResultClasses() {
final String RESULT = Result.class.getName();
_set.add(RESULT);
ClassInfoRepository repo = Act.app().classLoader().classInfoRepository();
ClassNode resultNode = repo.node(RESULT);
if (null == resultNode) {
// inside unit test
add(Ok.class, NotFound.class, ErrorResult.class, NotAcceptable.class, Forbidden.class, NotImplemented.class, BadRequest.class, Conflict.class, MethodNotAllowed.class, Unauthorized.class, ServerError.class, NotModified.class, RenderBinary.class, Accepted.class, Created.class, NoResult.class, Redirect.class, RenderTemplate.class, RenderAny.class, ZXingResult.class, RenderJsonMap.class, RenderJSON.class, RenderContent.class, RenderXML.class, RenderCSV.class, RenderHtml.class, FilteredRenderJSON.class, FilteredRenderXML.class, RenderText.class);
} else {
resultNode.visitPublicSubTreeNodes(new $.Visitor<ClassNode>() {
@Override
public void visit(ClassNode classNode) throws Osgl.Break {
_set.add(classNode.name());
}
});
}
}
use of act.util.ClassNode in project actframework by actframework.
the class ControllerClassMetaInfo method getAllWithList.
private void getAllWithList(final Set<String> withList, final ControllerClassMetaInfoManager infoBase) {
withList.addAll(this.withList);
if (null != superType) {
final String superClass = superType.getClassName();
App app = App.instance();
ClassInfoRepository repo = app.classLoader().classInfoRepository();
ControllerClassMetaInfo info = infoBase.controllerMetaInfo(superClass);
String curSuperClass = superClass;
while (null == info && !"java.lang.Object".equals(curSuperClass)) {
ClassNode node = repo.node(curSuperClass);
if (null != node) {
node = node.parent();
}
if (null == node) {
break;
}
curSuperClass = node.name();
info = infoBase.controllerMetaInfo(curSuperClass);
}
if (null != info) {
withList.add(superClass);
}
}
}
use of act.util.ClassNode in project actframework by actframework.
the class ControllerClassMetaInfo method parent.
public ControllerClassMetaInfo parent(boolean checkClassInfoRepo) {
if (null != parent) {
return parent;
}
if (!checkClassInfoRepo) {
return null;
}
AppClassLoader classLoader = Act.app().classLoader();
ClassInfoRepository repo = classLoader.classInfoRepository();
ClassNode parentNode = repo.node(superType.getClassName());
while (null != parentNode) {
parentNode = parentNode.parent();
if (null != parentNode) {
ControllerClassMetaInfo parentInfo = classLoader.controllerClassMetaInfo(parentNode.name());
if (null != parentInfo) {
return parentInfo;
}
} else {
return null;
}
}
return null;
}
use of act.util.ClassNode in project actframework by actframework.
the class ControllerClassMetaInfoManager method buildSuperClassMetaInfo.
private static void buildSuperClassMetaInfo(ControllerClassMetaInfo info, ControllerClassMetaInfoManager manager, ClassInfoRepository repo) {
String className = info.className();
ClassNode node = repo.node(className);
if (null == node) {
return;
}
ClassNode parent = node.parent();
final String OBJECT = Object.class.getName();
while (null != parent && !OBJECT.equals(parent.name())) {
ControllerClassMetaInfo parentInfo = manager.controllerMetaInfo(parent.name());
if (null != parentInfo) {
info.parent(parentInfo);
break;
}
parent = parent.parent();
}
}
use of act.util.ClassNode in project actframework by actframework.
the class EntityClassMetaInfo method mergeFromMappedSuperClasses.
void mergeFromMappedSuperClasses(ClassInfoRepository classRepo, EntityMetaInfoRepo entityRepo) {
ClassNode node = classRepo.node(getClass().getName());
ClassNode parent = node.parent();
if (null != parent) {
mergeFrom(parent, entityRepo);
}
}
Aggregations