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


Java ArraysUtil类代码示例

本文整理汇总了Java中org.febit.util.ArraysUtil的典型用法代码示例。如果您正苦于以下问题:Java ArraysUtil类的具体用法?Java ArraysUtil怎么用?Java ArraysUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: create

import org.febit.util.ArraysUtil; //导入依赖的package包/类
public static HandlerConfig create(Object action, Method method, String macroString) {
    if (ClassUtil.isStatic(method)) {
        action = null;
    } else if (action == null) {
        throw new IllegalArgumentException("action is required to invoke member method: " + method);
    }
    ClassUtil.setAccessible(method);
    BasePathMacros macros = new RegExpPathMacros();
    boolean success = macros.init(macroString, MACRO_SEPARATORS);
    if (!success) {
        macros = null;
    }
    String[] names = macros == null
            ? new String[0]
            : macros.getNames();
    Class<?>[] paramTypes = method.getParameterTypes();
    String[] paramNames = resolveParameterNames(method);
    // assert paramNames.length == paramTypes.length
    int[] paramIndexer = new int[paramTypes.length];

    for (int i = 0; i < paramTypes.length; i++) {
        Class<?> paramType = paramTypes[i];
        if (OutgoingMessage.class.isAssignableFrom(paramType)) {
            paramIndexer[i] = -2;
        } else {
            String paramName = paramNames[i];
            int index = ArraysUtil.indexOf(names, paramName);
            paramIndexer[i] = index >= 0 ? index : -1;
        }
    }
    return new HandlerConfig(action, method, macroString, macros, paramTypes, paramIndexer);
}
 
开发者ID:febit,项目名称:febit,代码行数:33,代码来源:OutgoingManager.java

示例2: getParameterValues

import org.febit.util.ArraysUtil; //导入依赖的package包/类
public String[] getParameterValues(String name) {
    String macroValue = macroParams.get(name);
    String[] params = this.request.getParameterValues(name);
    if (macroValue == null) {
        return params;
    } else if (params == null) {
        return new String[]{macroValue};
    } else {
        return ArraysUtil.append(params, macroValue);
    }
}
 
开发者ID:febit,项目名称:febit,代码行数:12,代码来源:ActionRequest.java

示例3: keep

import org.febit.util.ArraysUtil; //导入依赖的package包/类
public Order keep(String... whiteList) {
    if (whiteList == null || whiteList.length == 0) {
        clear();
    } else {
        removeIf(e -> !ArraysUtil.contains(whiteList, e.field));
    }
    return this;
}
 
开发者ID:febit,项目名称:febit-common,代码行数:9,代码来源:Order.java

示例4: toFormField

import org.febit.util.ArraysUtil; //导入依赖的package包/类
/**
 *
 * @param fieldInfo
 * @return null if not match
 */
private static FormField toFormField(FieldInfo fieldInfo) {
    Field field = fieldInfo.getField();
    if (field == null) {
        return null;
    }
    Add a = field.getAnnotation(Add.class);
    Modify m = field.getAnnotation(Modify.class);
    AM am = field.getAnnotation(AM.class);
    int[] addProfiles = null;
    int[] modifyProfiles = null;
    if (a != null) {
        addProfiles = a.value();
    }
    if (m != null) {
        modifyProfiles = m.value();
    }
    if (am != null && notEmpty(am.value())) {
        final int[] amProfiles = am.value();
        addProfiles = notEmpty(addProfiles)
                ? ArraysUtil.join(addProfiles, amProfiles)
                : amProfiles;

        modifyProfiles = notEmpty(modifyProfiles)
                ? ArraysUtil.join(modifyProfiles, amProfiles)
                : amProfiles;
    }
    if (!notEmpty(addProfiles)
            && !notEmpty(modifyProfiles)) {
        LOG.debug("Skip field: {}", field);
        return null;
    }
    return new FormField(addProfiles, modifyProfiles, fieldInfo);
}
 
开发者ID:febit,项目名称:febit-common,代码行数:39,代码来源:BaseFormUtil.java

示例5: createTable

import org.febit.util.ArraysUtil; //导入依赖的package包/类
protected Table createTable(final TableRaw tableRaw) {
    final String entity;
    final String sqlName;
    final String remark;
    final String modelType;
    final boolean blackEntity;
    final Attrs tableAttrs;

    sqlName = tableNaming.sqlName(tableRaw.name);
    remark = tableNaming.remark(tableRaw.remark);
    entity = tableNaming.entity(sqlName);

    blackEntity = ArraysUtil.contains(blackEntitys, entity);
    modelType = tableNaming.modelType(entity);
    tableAttrs = tableSettings.getTableAttrs(entity);

    final Table table = new Table(tableAttrs, sqlName, entity, modelType, blackEntity, remark);
    for (ColumnRaw columnRaw : tableRaw.getColumns()) {
        Column col = columnFactory.create(columnRaw, table);
        if (col == null) {
            Logger.debug("Skip column (by ColumnFactory): {}", columnRaw);
            continue;
        }
        table.addColumn(col);
    }
    return table;
}
 
开发者ID:febit,项目名称:febit-generator,代码行数:28,代码来源:DatabaseTableFactory.java

示例6: _json

import org.febit.util.ArraysUtil; //导入依赖的package包/类
protected static JsonData _json(String[] keys, Object[] values) {
  return _json(ArraysUtil.asMap(keys, values));
}
 
开发者ID:febit,项目名称:febit,代码行数:4,代码来源:BaseAction.java


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