Search in sources :

Example 1 with ClassMeta

use of org.nutz.lang.util.ClassMeta in project nutz by nutzam.

the class Loadings method createInfo.

public static ActionInfo createInfo(Class<?> type) {
    ActionInfo ai = new ActionInfo();
    evalEncoding(ai, Mirror.getAnnotationDeep(type, Encoding.class));
    evalHttpAdaptor(ai, Mirror.getAnnotationDeep(type, AdaptBy.class));
    evalActionFilters(ai, Mirror.getAnnotationDeep(type, Filters.class));
    evalPathMap(ai, Mirror.getAnnotationDeep(type, PathMap.class));
    evalOk(ai, Mirror.getAnnotationDeep(type, Ok.class));
    evalFail(ai, Mirror.getAnnotationDeep(type, Fail.class));
    evalAt(ai, Mirror.getAnnotationDeep(type, At.class), type.getSimpleName());
    evalActionChainMaker(ai, Mirror.getAnnotationDeep(type, Chain.class));
    evalModule(ai, type);
    if (Mvcs.DISPLAY_METHOD_LINENUMBER) {
        InputStream ins = type.getClassLoader().getResourceAsStream(type.getName().replace(".", "/") + ".class");
        if (ins != null) {
            try {
                ClassMeta meta = ClassMetaReader.build(ins);
                ai.setMeta(meta);
            } catch (Exception e) {
            }
        }
    }
    return ai;
}
Also used : Chain(org.nutz.mvc.annotation.Chain) Filters(org.nutz.mvc.annotation.Filters) At(org.nutz.mvc.annotation.At) InputStream(java.io.InputStream) ClassMeta(org.nutz.lang.util.ClassMeta) ActionInfo(org.nutz.mvc.ActionInfo) Encoding(org.nutz.mvc.annotation.Encoding) AdaptBy(org.nutz.mvc.annotation.AdaptBy) PathMap(org.nutz.mvc.annotation.PathMap) Ok(org.nutz.mvc.annotation.Ok) Fail(org.nutz.mvc.annotation.Fail)

Aggregations

InputStream (java.io.InputStream)1 ClassMeta (org.nutz.lang.util.ClassMeta)1 ActionInfo (org.nutz.mvc.ActionInfo)1 AdaptBy (org.nutz.mvc.annotation.AdaptBy)1 At (org.nutz.mvc.annotation.At)1 Chain (org.nutz.mvc.annotation.Chain)1 Encoding (org.nutz.mvc.annotation.Encoding)1 Fail (org.nutz.mvc.annotation.Fail)1 Filters (org.nutz.mvc.annotation.Filters)1 Ok (org.nutz.mvc.annotation.Ok)1 PathMap (org.nutz.mvc.annotation.PathMap)1