当前位置: 首页>>代码示例>>Java>>正文


Java C.newList方法代码示例

本文整理汇总了Java中org.osgl.util.C.newList方法的典型用法代码示例。如果您正苦于以下问题:Java C.newList方法的具体用法?Java C.newList怎么用?Java C.newList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.osgl.util.C的用法示例。


在下文中一共展示了C.newList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: managedFields

import org.osgl.util.C; //导入方法依赖的package包/类
public List<String> managedFields(String className) {
    List<String> fields = managedFieldByClass.get(className);
    if (null == fields) {
        fields = C.newList();
        Set<String> ss = storageFields();
        for (String s: ss) {
            if (s.startsWith(className + ":")) {
                String fn = S.after(s, ":");
                if (S.notEmpty(fn)) {
                    fields.add(fn);
                }
            }
        }
        managedFieldByClass.put(className, fields);
    }
    return fields;
}
 
开发者ID:actframework,项目名称:act-storage,代码行数:18,代码来源:StorageServiceManager.java

示例2: toString

import org.osgl.util.C; //导入方法依赖的package包/类
@Override
public String toString() {
    StringBuilder sb = S.builder(type());
    if (S.notBlank(name)) {
        sb.append("(").append(name).append(")");
    }
    C.List<Object> list = C.newList();
    if (null != valueLoader) {
        list.append(valueLoader);
    } else {
        list.append(qualifiers).append(elementLoaders).append(filters);
        if (null != mapKey) {
            list.append(mapKey);
        }
    }
    if (null != scope) {
        list.append(scope.getSimpleName());
    }
    if (!list.isEmpty()) {
        sb.append("@[").append(S.join(", ", list)).append("]");
    }
    return sb.toString();
}
 
开发者ID:osglworks,项目名称:java-di,代码行数:24,代码来源:BeanSpec.java

示例3: load

import org.osgl.util.C; //导入方法依赖的package包/类
@Override
public List<Integer> load(Map<String, Object> options, BeanSpec container, Genie genie) {
    int max = toInt(options.get("max"));
    int n1 = 1, n2 = 1, f;
    List<Integer> list = C.newList();
    list.add(n1);
    list.add(n2);
    for (;;) {
        f = n1 + n2;
        n1 = n2;
        n2 = f;
        if (f < max) {
            list.add(f);
        } else {
            break;
        }
    }
    return list;
}
 
开发者ID:osglworks,项目名称:java-di,代码行数:20,代码来源:FibonacciSeriesLoader.java

示例4: typedElementLoader

import org.osgl.util.C; //导入方法依赖的package包/类
@Provides
public static TypedElementLoader typedElementLoader() {
    return new TypedElementLoader() {
        @Override
        protected List<Class> load(Class type, boolean loadNonPublic, boolean loadAbstract, boolean loadRoot) {
            if (type == Base.class) {
                List<Class> list = (List) C.newList(Derived.class);
                if (loadNonPublic) {
                    list.add(NonPublicDerived.class);
                }
                if (loadAbstract) {
                    list.add(AbstractDerived.class);
                }
                if (loadRoot) {
                    list.add(Base.class);
                }
                return list;
            }
            return C.list();
        }
    };
}
 
开发者ID:osglworks,项目名称:java-di,代码行数:23,代码来源:TypedClasses.java

示例5: fetch

import org.osgl.util.C; //导入方法依赖的package包/类
@Override
    public Iterable<MODEL_TYPE> fetch() {
        C.List<MODEL_TYPE> list = C.newList();
        QueryIterator<MODEL_TYPE> qi = findIterate();
        while (qi.hasNext()) {
            list.add(qi.next());
        }
        qi.close();
        return list;
// we need to close the query iterable right now otherwise it hold the data connection forever
//        return new Iterable<MODEL_TYPE>() {
//            @Override
//            public Iterator<MODEL_TYPE> iterator() {
//                return findIterate();
//            }
//        };
    }
 
开发者ID:actframework,项目名称:act-ebean,代码行数:18,代码来源:EbeanQuery.java

示例6: permissions

import org.osgl.util.C; //导入方法依赖的package包/类
/**
 *
 * @return
 */
@Override
public List<? extends Permission> permissions() {
    List<String> names = permissionNames();
    if (names.isEmpty()) {
        return C.list();
    }
    AAAContext aaa = AAA.context();
    AAAPersistentService ps = aaa.getPersistentService();
    List<Permission> perms = C.newList();
    for (String name: names) {
        Permission p = ps.findByName(name, Permission.class);
        perms.add($.notNull(p));
    }
    return perms;
}
 
开发者ID:actframework,项目名称:act-aaa-plugin,代码行数:20,代码来源:DynamicPermissionCheckHelperBase.java

示例7: prepareJsonData

import org.osgl.util.C; //导入方法依赖的package包/类
protected Map<String, Object> prepareJsonData(List<$.T2<String, Object>> params) {
    Map<String, Object> map = C.newMap();
    if (null != params) {
        for ($.T2<String, Object> pair : params) {
            String key = pair._1;
            Object val = pair._2;
            if (map.containsKey(key)) {
                List list;
                Object x = map.get(key);
                if (x instanceof List) {
                    list = $.cast(x);
                } else {
                    list = C.newList(x);
                    map.put(key, list);
                }
                list.add(val);
            } else {
                map.put(key, val);
            }
        }
    }
    return map;
}
 
开发者ID:actframework,项目名称:actframework,代码行数:24,代码来源:EndpointTester.java

示例8: loadWords

import org.osgl.util.C; //导入方法依赖的package包/类
private static List<String> loadWords() {
    URL url = Zen.class.getResource("/act_zen.txt");
    List<String> words = C.newList(defaultWords());
    if (null != url) {
        try {
            List<String> myWords = IO.readLines(url.openStream());
            if (!myWords.isEmpty()) {
                words = myWords;
            }
        } catch (Exception e) {
            // ignore it
        }
    }
    List<String> retVal = new ArrayList<>(words.size());
    for (String s : words) {
        if (s.contains("\n")) {
            s = s.replaceAll("\n", "\n          ");
        } else if (s.contains("\\n")) {
            s = s.replaceAll("\\\\n", "\n          ");
        }
        retVal.add(s);
    }
    return retVal;
}
 
开发者ID:actframework,项目名称:actframework,代码行数:25,代码来源:Zen.java

示例9: listSObjectFields

import org.osgl.util.C; //导入方法依赖的package包/类
@Command(value = "act.ss.list, act.ss.print", help = "List all storage field info")
@PropertySpec("className,fieldName,updatePolicy,serviceId,contextPath")
public Collection<FieldServiceInfo> listSObjectFields() {
    Set<String> fields = ssm.storageFields();
    C.List<FieldServiceInfo> l = C.newList();
    for (String s : fields) {
        l.add(new FieldServiceInfo(s));
    }
    return l.sorted();
}
 
开发者ID:actframework,项目名称:act-storage,代码行数:11,代码来源:StorageServiceAdmin.java

示例10: filters

import org.osgl.util.C; //导入方法依赖的package包/类
private static C.List<FilterInfo> filters(Genie genie, BeanSpec spec) {
    C.List<FilterInfo> list = C.newList();
    Set<Annotation> annotations = spec.filters();
    for (Annotation anno : annotations) {
        Class<? extends Annotation> annoClass = anno.annotationType();
        Filter filterTag = (Filter.class == annoClass) ? (Filter) anno : annoClass.getAnnotation(Filter.class);
        ElementFilter loader = genie.get(filterTag.value());
        list.add(new FilterInfo(loader, filterTag.reverse(), anno, spec));
    }
    return list;
}
 
开发者ID:osglworks,项目名称:java-di,代码行数:12,代码来源:ElementLoaderProvider.java

示例11: get

import org.osgl.util.C; //导入方法依赖的package包/类
@Override
public List<Integer> get() {
    List<Integer> list = C.newList();
    for (int i = 0; i < 10; ++i) {
        list.add(N.randInt(100));
    }
    return list;
}
 
开发者ID:osglworks,项目名称:java-di,代码行数:9,代码来源:RandomListLoader.java

示例12: randomBlogs

import org.osgl.util.C; //导入方法依赖的package包/类
private static List<Blog> randomBlogs() {
    List<Blog> list = C.newList();
    int max = N.randInt(10) + 1;
    for (int i = 0; i < max; ++i) {
        list.add(Blog.random());
    }
    return list;
}
 
开发者ID:actframework,项目名称:act-demo-apps,代码行数:9,代码来源:Student.java

示例13: retrieveCsrfToken

import org.osgl.util.C; //导入方法依赖的package包/类
public List<Cookie> retrieveCsrfToken($.Var<String> csrf) throws IOException {
    url("/csrf");
    List<Cookie> cookies = cookies();
    List<Cookie> returnCookies = C.newList();
    for (Cookie cookie : cookies) {
        if ("act-xsrf-token".equals(cookie.name())) {
            csrf.set(cookie.value());
        } else {
            returnCookies.add(cookie);
        }
    }
    return returnCookies;
}
 
开发者ID:actframework,项目名称:actframework,代码行数:14,代码来源:CSRFTest.java

示例14: tokenOf

import org.osgl.util.C; //导入方法依赖的package包/类
private static List<String> tokenOf(Class<?> entryClass) {
    C.List<String> tokens = C.newList();
    tokens.addAll(classNameTokensReversed(entryClass));
    Class<?> enclosingClass = entryClass.getEnclosingClass();
    while (null != enclosingClass) {
        tokens.addAll(classNameTokensReversed(enclosingClass));
        enclosingClass = entryClass.getEnclosingClass();
    }
    String pkgName = JavaNames.packageNameOf(entryClass);
    tokens.append(S.fastSplit(pkgName, ".").reverse());
    return tokens.reverse();
}
 
开发者ID:actframework,项目名称:actframework,代码行数:13,代码来源:AppNameInferer.java

示例15: ReflectedSimpleEventListener

import org.osgl.util.C; //导入方法依赖的package包/类
ReflectedSimpleEventListener(String className, String methodName, List<BeanSpec> paramTypes, boolean isStatic) {
    this.isStatic = isStatic;
    this.paramTypes = C.newList();
    this.providedParamTypes = C.newList();
    DependencyInjector injector = Act.injector();
    boolean cutOff = false;
    if (null == paramTypes) {
        paramTypes = C.list();
    }
    for (int i = paramTypes.size() - 1; i >= 0; --i) {
        BeanSpec spec = paramTypes.get(i);
        if (ParamValueLoaderService.provided(spec, injector)) {
            E.unexpectedIf(cutOff, "provided(injected) argument must be put at the end of passed in argument list");
            providedParamTypes.add(spec.rawType());
        } else {
            cutOff = true;
            this.paramTypes.add(spec.rawType());
        }
    }
    this.paramTypes = this.paramTypes.reverse();
    this.providedParamSize = this.providedParamTypes.size();
    if (providedParamSize > 0) {
        this.providedParamTypes = this.providedParamTypes.reverse();
    }
    Class[] argList = new Class[paramTypes.size()];
    for (int i = 0; i < argList.length; ++i) {
        argList[i] = paramTypes.get(i).rawType();
    }
    this.hostClass = Act.app().classForName(className);
    this.method = $.getMethod(hostClass, methodName, argList);
    this.isAsync = EventBus.isAsync(hostClass) || EventBus.isAsync(method);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:33,代码来源:ReflectedSimpleEventListener.java


注:本文中的org.osgl.util.C.newList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。