• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ArraysUtil类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: ensureCapacity

import jodd.util.ArraysUtil; //导入依赖的package包/类
private void ensureCapacity() {
	if (textLen == text.length) {
		text = ArraysUtil.resize(text, textLen << 1);
	}
}
 
开发者ID:indic-ocr,项目名称:LibreOCR,代码行数:6,代码来源:LagartoParser.java


示例17: convert

import jodd.util.ArraysUtil; //导入依赖的package包/类
public String convert(Object value) {
	if (value == null) {
		return null;
	}
	
	if (value instanceof CharSequence) {	// for speed
		return value.toString();
	}
	Class type = value.getClass();
	if (type == Class.class) {
		return ((Class) value).getName();
	}
	if (type.isArray()) {
		if (type == char[].class) {
			char[] charArray = (char[]) value;
			return new String(charArray);
		}

		if (type == int[].class) {
			return ArraysUtil.toString((int[]) value);
		}
		if (type == long[].class) {
			return ArraysUtil.toString((long[]) value);
		}
		if (type == byte[].class) {
			return ArraysUtil.toString((byte[]) value);
		}
		if (type == float[].class) {
			return ArraysUtil.toString((float[]) value);
		}
		if (type == double[].class) {
			return ArraysUtil.toString((double[]) value);
		}
		if (type == short[].class) {
			return ArraysUtil.toString((short[]) value);
		}
		if (type == boolean[].class) {
			return ArraysUtil.toString((boolean[]) value);
		}
		return ArraysUtil.toString((Object[])value);
	}
	if (value instanceof Clob) {
		Clob clob = (Clob) value;
		try {
			long length = clob.length();
			if (length > Integer.MAX_VALUE) {
				throw new TypeConversionException("Clob is too big.");
			}
			return clob.getSubString(1, (int) length);
		} catch (SQLException sex) {
			throw new TypeConversionException(value, sex);
		}
	}
	return value.toString();
}
 
开发者ID:indic-ocr,项目名称:LibreOCR,代码行数:56,代码来源:StringConverter.java


示例18: Jerry

import jodd.util.ArraysUtil; //导入依赖的package包/类
/**
 * Creates child Jerry.
 */
protected Jerry(Jerry parent, Node[] nodes1, Node[] nodes2) {
    this.parent = parent;
    this.nodes = ArraysUtil.join(nodes1, nodes2);
    this.builder = parent.builder;
}
 
开发者ID:fivesmallq,项目名称:web-data-extractor,代码行数:9,代码来源:Jerry.java


示例19: 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:fivesmallq,项目名称:web-data-extractor,代码行数:7,代码来源:ParsedTag.java


示例20: postProcessBeanFactory

import jodd.util.ArraysUtil; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void postProcessBeanFactory(
		@Nullable ConfigurableListableBeanFactory beanFactory)
		throws BeansException {
	if (beanFactory == null)
		throw new IllegalStateException(
				"Spring Container initialization error");
	// String[] homePageNames =
	// beanFactory.getBeanNamesForType(IStepInputData.class, true, false);
	String[] allSendKeysActions = beanFactory.getBeanNamesForType(//NOPMD
			SendKeysAction.class, true, false);
	String[] allAssignValueActs = beanFactory.getBeanNamesForType(
			AssignValueAction.class, true, false);
	allSendKeysActions = ArraysUtil.join(allSendKeysActions, allAssignValueActs);
	
	for (int index = 0; index < allSendKeysActions.length; index++) {
		BeanDefinition sendKeyActDef = beanFactory
				.getBeanDefinition(allSendKeysActions[index]);
		String dataValue = ((RuntimeBeanReference) sendKeyActDef.getConstructorArgumentValues().getGenericArgumentValue(RuntimeBeanReference.class).getValue()).getBeanName();
				//.getAttribute(XsdElementConstants.ATTR_SENDKEYSACTION_DATAVALUE);
		if (null == dataValue) {
			throw new IllegalStateException(
					"Spring Container sendKeyActionValue initialization error");
		} else {
			try {
				beanFactory.getBeanDefinition(dataValue);
			} catch (NoSuchBeanDefinitionException NoBeanDef) {

				String idstr;
				BeanDefinitionBuilder definitionBuilder;

				if (StringUtils.isEmpty(dataValue)) {
					 definitionBuilder = BeanDefinitionBuilder
								.genericBeanDefinition(RandomAlphaTextValueDataHolder.class);
					idstr = (String) sendKeyActDef.getAttribute("id")
							+ "_SendKeysRandomAlphaTextDataValueBean_ID";
					definitionBuilder.addConstructorArgValue(idstr);
					definitionBuilder.addConstructorArgValue(10);

				} else {
					 definitionBuilder = BeanDefinitionBuilder
								.genericBeanDefinition(ManualAssignedValueDataHolder.class);
					
					definitionBuilder
							.addConstructorArgValue(EnumRunTimeDataType.TEXT);
					definitionBuilder.addConstructorArgValue(dataValue);

					idstr = (String) sendKeyActDef.getAttribute("id")
							+ "_SendKeysDataValueBean_ID";
					definitionBuilder.addConstructorArgValue(idstr);

				}

				getBdReg().registerBeanDefinition(idstr,
						definitionBuilder.getBeanDefinition());
				sendKeyActDef.setAttribute(
						XsdElementConstants.ATTR_SENDKEYSACTION_DATAVALUE,
						idstr);
				sendKeyActDef.getConstructorArgumentValues()
						.getGenericArgumentValue(RuntimeBeanReference.class).setValue( 
								new RuntimeBeanReference(idstr));
			}
		}
	}

}
 
开发者ID:bigtester,项目名称:automation-test-engine,代码行数:70,代码来源:SendKeysActionPostBeanProcessor.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Multipart类代码示例发布时间:2022-05-22
下一篇:
Java TimePoints类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap