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


Java ArraysUtil类代码示例

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


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

示例1: convertStringToArray

import jodd.util.ArraysUtil; //导入依赖的package包/类
@Override
protected String[] convertStringToArray(String value) {
	String[] strings = StringUtil.splitc(value, NUMBER_DELIMITERS);

	int count = 0;

	for (int i = 0; i < strings.length; i++) {
		strings[count] = strings[i].trim();

		if (strings[count].length() == 0) {
			continue;
		}

		if (!strings[count].startsWith(StringPool.HASH)) {
			count++;
		}
	}

	if (count != strings.length) {
		return ArraysUtil.subarray(strings, 0, count);
	}

	return strings;
}
 
开发者ID:indic-ocr,项目名称:LibreOCR,代码行数:25,代码来源:ClassArrayConverter.java

示例2: putFile

import jodd.util.ArraysUtil; //导入依赖的package包/类
protected void putFile(String name, UploadFile value) {
    if (requestFiles == null) {
        requestFiles = new HashMap<>();
    }

    UploadFile[] fileUploads = requestFiles.get(name);

    if (fileUploads != null) {
        fileUploads = ArraysUtil.append(fileUploads, value);
    } else {
        fileUploads = new UploadFile[]{value};
    }

    requestFiles.put(name, fileUploads);
}
 
开发者ID:febit,项目名称:febit,代码行数:16,代码来源:MultipartRequestWrapper.java

示例3: putParameter

import jodd.util.ArraysUtil; //导入依赖的package包/类
protected void putParameter(String name, String value) {

        String[] params = requestParameters.get(name);

        if (params != null) {
            params = ArraysUtil.append(params, value);
        } else {
            params = new String[]{value};
        }

        requestParameters.put(name, params);
    }
 
开发者ID:febit,项目名称:febit,代码行数:13,代码来源:MultipartRequestWrapper.java

示例4: putFile

import jodd.util.ArraysUtil; //导入依赖的package包/类
protected void putFile(String name, FileUpload value) {
	if (requestFiles == null) {
		requestFiles = new HashMap<>();
	}

	FileUpload[] fileUploads = requestFiles.get(name);

	if (fileUploads != null) {
		fileUploads = ArraysUtil.append(fileUploads, value);
	} else {
		fileUploads = new FileUpload[] {value};
	}

	requestFiles.put(name, fileUploads);
}
 
开发者ID:indic-ocr,项目名称:LibreOCR,代码行数:16,代码来源:MultipartStreamParser.java

示例5: putParameter

import jodd.util.ArraysUtil; //导入依赖的package包/类
protected void putParameter(String name, String value) {
	if (requestParameters == null) {
		requestParameters = new HashMap<>();
	}
	
	String[] params = requestParameters.get(name);

	if (params != null) {
		params = ArraysUtil.append(params, value);
	} else {
		params = new String[] {value};
	}

	requestParameters.put(name, params);
}
 
开发者ID:indic-ocr,项目名称:LibreOCR,代码行数:16,代码来源:MultipartStreamParser.java

示例6: inspectMethods

import jodd.util.ArraysUtil; //导入依赖的package包/类
/**
 * Inspects types methods and return map of {@link MethodDescriptor method descriptors}.
 */
protected HashMap<String, MethodDescriptor[]> inspectMethods() {
	boolean scanAccessible = classDescriptor.isScanAccessible();
	Class type = classDescriptor.getType();

	Method[] methods = scanAccessible ? ReflectUtil.getAccessibleMethods(type) : ReflectUtil.getSupportedMethods(type);

	HashMap<String, MethodDescriptor[]> map = new HashMap<>(methods.length);

	for (Method method : methods) {
		String methodName = method.getName();

		MethodDescriptor[] mds = map.get(methodName);

		if (mds == null) {
			mds = new MethodDescriptor[1];
		} else {
			mds = ArraysUtil.resize(mds, mds.length + 1);
		}

		map.put(methodName, mds);

		mds[mds.length - 1] = createMethodDescriptor(method);
	}

	return map;
}
 
开发者ID:indic-ocr,项目名称:LibreOCR,代码行数:30,代码来源:Methods.java

示例7: resolveRealName

import jodd.util.ArraysUtil; //导入依赖的package包/类
/**
 * Resolves real name from JSON name.
 */
public String resolveRealName(String jsonName) {
	if (jsonNames == null) {
		return jsonName;
	}
	int jsonIndex = ArraysUtil.indexOf(jsonNames, jsonName);
	if (jsonIndex == -1) {
		return jsonName;
	}
	return realNames[jsonIndex];
}
 
开发者ID:indic-ocr,项目名称:LibreOCR,代码行数:14,代码来源:JsonAnnotationManager.java

示例8: resolveJsonName

import jodd.util.ArraysUtil; //导入依赖的package包/类
/**
 * Resolves JSON name from real name.
 */
public String resolveJsonName(String realName) {
	if (realNames == null) {
		return realName;
	}
	int realIndex = ArraysUtil.indexOf(realNames, realName);
	if (realIndex == -1) {
		return realName;
	}
	return jsonNames[realIndex];
}
 
开发者ID:indic-ocr,项目名称:LibreOCR,代码行数:14,代码来源:JsonAnnotationManager.java

示例9: excludeTypes

import jodd.util.ArraysUtil; //导入依赖的package包/类
/**
 * Excludes type names. You can disable
 * serialization of properties that are of some type.
 * For example, you can disable properties of <code>InputStream</code>.
 * You can use wildcards to describe type names.
 */
public JsonSerializer excludeTypes(String... typeNames) {
	if (excludedTypeNames == null) {
		excludedTypeNames = typeNames;
	} else {
		excludedTypeNames = ArraysUtil.join(excludedTypeNames, typeNames);
	}
	return this;
}
 
开发者ID:indic-ocr,项目名称:LibreOCR,代码行数:15,代码来源:JsonSerializer.java

示例10: registerAddonConverter

import jodd.util.ArraysUtil; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void registerAddonConverter(TypeConverter<File> fileTypeConverter) {
	if (addonFileConverters == null) {
		addonFileConverters = new TypeConverter[0];
	}

	addonFileConverters = ArraysUtil.append(addonFileConverters, fileTypeConverter);
}
 
开发者ID:indic-ocr,项目名称:LibreOCR,代码行数:9,代码来源:FileConverter.java

示例11: isTypeSignatureInUse

import jodd.util.ArraysUtil; //导入依赖的package包/类
/**
 * Returns <code>true</code> if class contains {@link #getTypeSignatureBytes(Class) type signature}.
 * It searches the class content for bytecode signature. This is the fastest way of finding if come
 * class uses some type. Please note that if signature exists it still doesn't means that class uses
 * it in expected way, therefore, class should be loaded to complete the scan.
 */
protected boolean isTypeSignatureInUse(InputStream inputStream, byte[] bytes) {
	try {
		byte[] data = StreamUtil.readBytes(inputStream);
		int index = ArraysUtil.indexOf(data, bytes);
		return index != -1;
	} catch (IOException ioex) {
		throw new FindFileException("Read error", ioex);
	}
}
 
开发者ID:indic-ocr,项目名称:LibreOCR,代码行数:16,代码来源:ClassFinder.java

示例12: not

import jodd.util.ArraysUtil; //导入依赖的package包/类
/**
 * Removes elements from the set of matched elements.
 */
public Jerry not(String cssSelector) {
    Node[] notNodes = root().find(cssSelector).nodes;
    List<Node> result = new NodeList(nodes.length);
    for (Node node : nodes) {
        if (ArraysUtil.contains(notNodes, node) == false) {
            result.add(node);
        }
    }
    return new Jerry(this, result);
}
 
开发者ID:fivesmallq,项目名称:web-data-extractor,代码行数:14,代码来源:Jerry.java

示例13: checkNotContains

import jodd.util.ArraysUtil; //导入依赖的package包/类
public static void checkNotContains(String[] possibleValues, String value, String msg) {
	if (!ArraysUtil.contains(possibleValues, value)) {
		throw new IllegalArgumentException(msg);
	}
}
 
开发者ID:DataAgg,项目名称:DAFramework,代码行数:6,代码来源:ArgCheck.java

示例14: visitEnd

import jodd.util.ArraysUtil; //导入依赖的package包/类
@Override
public void visitEnd() {
	if (methodParameters.length > currentParam) {
		methodParameters = ArraysUtil.subarray(methodParameters, 0, currentParam);
	}
}
 
开发者ID:indic-ocr,项目名称:LibreOCR,代码行数:7,代码来源:ParamExtractor.java

示例15: ensureLength

import jodd.util.ArraysUtil; //导入依赖的package包/类
private void ensureLength() {
	if (attributesCount + 1 >= attrNames.length) {
		attrNames = ArraysUtil.resize(attrNames, attributesCount * 2);
		attrValues = ArraysUtil.resize(attrValues, attributesCount * 2);
	}
}
 
开发者ID:indic-ocr,项目名称:LibreOCR,代码行数:7,代码来源:ParsedTag.java


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