當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。