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


Java StringUtil.splitc方法代码示例

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


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

示例1: resolveActiveProfiles

import jodd.util.StringUtil; //导入方法依赖的package包/类
/**
 * Resolves active profiles from special property.
 * This property can be only a base property!
 * If default active property is not defined, nothing happens.
 * Otherwise, it will replace currently active profiles.
 */
protected void resolveActiveProfiles() {
	if (activeProfilesProp == null) {
		activeProfiles = null;
		return;
	}

	final PropsEntry pv = data.getBaseProperty(activeProfilesProp);
	if (pv == null) {
		// no active profile set as the property, exit
		return;
	}

	final String value = pv.getValue();
	if (StringUtil.isBlank(value)) {
		activeProfiles = null;
		return;
	}

	activeProfiles = StringUtil.splitc(value, ',');
	StringUtil.trimAll(activeProfiles);
}
 
开发者ID:indic-ocr,项目名称:LibreOCR,代码行数:28,代码来源:Props.java

示例2: convertStringToArray

import jodd.util.StringUtil; //导入方法依赖的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

示例3: createPropertiesMap

import jodd.util.StringUtil; //导入方法依赖的package包/类
protected Map<String, String> createPropertiesMap(String attrValue, char propertiesDelimiter, char valueDelimiter) {
    if (attrValue == null) {
        return new LinkedHashMap<>();
    }
    String[] properties = StringUtil.splitc(attrValue, propertiesDelimiter);
    LinkedHashMap<String, String> map = new LinkedHashMap<>(properties.length);
    for (String property : properties) {
        int valueDelimiterIndex = property.indexOf(valueDelimiter);
        if (valueDelimiterIndex != -1) {
            String propertyName = property.substring(0, valueDelimiterIndex).trim();
            String propertyValue = property.substring(valueDelimiterIndex + 1).trim();
            map.put(propertyName, propertyValue);
        }
    }
    return map;
}
 
开发者ID:fivesmallq,项目名称:web-data-extractor,代码行数:17,代码来源:Jerry.java

示例4: isContaining

import jodd.util.StringUtil; //导入方法依赖的package包/类
/**
 * Returns true if attribute is containing some value.
 */
public boolean isContaining(String include) {
    if (value == null) {
        return false;
    }
    if (splits == null) {
        splits = StringUtil.splitc(value, ' ');
    }

    for (String s : splits) {
        if (s.equals(include)) {
            return true;
        }
    }
    return false;
}
 
开发者ID:fivesmallq,项目名称:web-data-extractor,代码行数:19,代码来源:Attribute.java

示例5: isContaining

import jodd.util.StringUtil; //导入方法依赖的package包/类
/**
 * Returns true if attribute is containing some value.
 */
public boolean isContaining(String include) {
	if (value == null) {
		return false;
	}
	if (splits == null) {
		splits = StringUtil.splitc(value, ' ');
	}

	for (String s: splits) {
		if (s.equals(include)) {
			return true;
		}
	}
	return false;
}
 
开发者ID:nithril,项目名称:xml-stream-css,代码行数:19,代码来源:Attribute.java

示例6: normalizeWords

import jodd.util.StringUtil; //导入方法依赖的package包/类
public String normalizeWords(String sentence) {
	String[] split = StringUtil.splitc(sentence, ' ');

	for (int i = 0; i < split.length; i++) {
		String word = split[i];

		for (StringPair stringPair : replacements) {
			word = stringPair.replace(word);
		}

		split[i] = word;
	}

	return StringUtil.join(split, ' ');
}
 
开发者ID:igr,项目名称:parlo,代码行数:16,代码来源:InputNormalizer.java

示例7: parse

import jodd.util.StringUtil; //导入方法依赖的package包/类
/**
 * Parses input dot-separated string that represents a path.
 */
public static Path parse(String path) {
	if (path == null) {
		return new Path();
	}
	return new Path(StringUtil.splitc(path, '.'));
}
 
开发者ID:indic-ocr,项目名称:LibreOCR,代码行数:10,代码来源:Path.java

示例8: readFrom

import jodd.util.StringUtil; //导入方法依赖的package包/类
/**
 * Parses input stream and creates new <code>HttpRequest</code> object.
 */
public static HttpRequest readFrom(InputStream in) {
	BufferedReader reader;
	try {
		reader = new BufferedReader(new InputStreamReader(in, StringPool.ISO_8859_1));
	} catch (UnsupportedEncodingException uneex) {
		return null;
	}

	HttpRequest httpRequest = new HttpRequest();

	String line;
	try {
		line = reader.readLine();
	} catch (IOException ioex) {
		throw new HttpException(ioex);
	}

	if (!StringUtil.isBlank(line)) {
		String[] s = StringUtil.splitc(line, ' ');

		httpRequest.method(s[0]);
		httpRequest.path(s[1]);
		httpRequest.httpVersion(s[2]);

		httpRequest.readHeaders(reader);
		httpRequest.readBody(reader);
	}

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

示例9: getExceptionsArray

import jodd.util.StringUtil; //导入方法依赖的package包/类
public String[] getExceptionsArray() {		 // jodd
	if (exceptions == null) {
		return null;
	}
	String[] result = StringUtil.splitc(exceptions.toString(), ',');

	StringUtil.trimAll(result);

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

示例10: getIpAsInt

import jodd.util.StringUtil; //导入方法依赖的package包/类
/**
 * Returns IP address as integer.
 */
public static int getIpAsInt(String ipAddress) {
	int ipIntValue = 0;
	String[] tokens = StringUtil.splitc(ipAddress, '.');
	for (String token : tokens) {
		if (ipIntValue > 0) {
			ipIntValue <<= 8;
		}
		ipIntValue += Integer.parseInt(token);
	}
	return ipIntValue;
}
 
开发者ID:indic-ocr,项目名称:LibreOCR,代码行数:15,代码来源:NetUtil.java

示例11: createPropertiesSet

import jodd.util.StringUtil; //导入方法依赖的package包/类
protected Set<String> createPropertiesSet(String attrValue, char propertiesDelimiter) {
    if (attrValue == null) {
        return new LinkedHashSet<>();
    }
    String[] properties = StringUtil.splitc(attrValue, propertiesDelimiter);
    LinkedHashSet<String> set = new LinkedHashSet<>(properties.length);

    Collections.addAll(set, properties);
    return set;
}
 
开发者ID:fivesmallq,项目名称:web-data-extractor,代码行数:11,代码来源:Jerry.java

示例12: parse

import jodd.util.StringUtil; //导入方法依赖的package包/类
/**
 * Parses string of selectors (separated with <b>,</b>). Returns
 * list of {@link CssSelector} lists in the same order.
 */
public static List<List<CssSelector>> parse(String query) {
    String[] singleQueries = StringUtil.splitc(query, ',');
    List<List<CssSelector>> selectors = new ArrayList<>(singleQueries.length);

    for (String singleQuery : singleQueries) {
        selectors.add(new CSSelly(singleQuery).parse());
    }

    return selectors;
}
 
开发者ID:fivesmallq,项目名称:web-data-extractor,代码行数:15,代码来源:CSSelly.java

示例13: init

import jodd.util.StringUtil; //导入方法依赖的package包/类
/**
 * Filter initialization.
 */
public void init(FilterConfig config) throws ServletException {

    try {
        wildcards = Convert.toBooleanValue(config.getInitParameter("wildcards"), false);
    } catch (TypeConversionException ignore) {
        wildcards = false;
    }

    // match string
    String uriMatch = config.getInitParameter("match");

    if ((uriMatch != null) && (uriMatch.equals("*") == false)) {
        matches = StringUtil.splitc(uriMatch, ',');
        for (int i = 0; i < matches.length; i++) {
            matches[i] = matches[i].trim();
        }
    }

    // exclude string
    String uriExclude = config.getInitParameter("exclude");

    if (uriExclude != null) {
        excludes = StringUtil.splitc(uriExclude, ',');
        for (int i = 0; i < excludes.length; i++) {
            excludes[i] = excludes[i].trim();
        }
    }        
}
 
开发者ID:Appverse,项目名称:appverse-server,代码行数:32,代码来源:XssFilter.java

示例14: parse

import jodd.util.StringUtil; //导入方法依赖的package包/类
/**
 * Parses string of selectors (separated with <b>,</b>). Returns
 * list of {@link CssSelector} lists in the same order.
 */
public static List<List<CssSelector>> parse(String query) {
	String[] singleQueries = StringUtil.splitc(query, ',');
	List<List<CssSelector>> selectors = new ArrayList<List<CssSelector>>(singleQueries.length);

	for (String singleQuery: singleQueries) {
		selectors.add(new CSSelly(singleQuery).parse());
	}

	return selectors;
}
 
开发者ID:nithril,项目名称:xml-stream-css,代码行数:15,代码来源:CSSelly.java

示例15: StringPair

import jodd.util.StringUtil; //导入方法依赖的package包/类
public StringPair(String fullLine) {
	String[] pairs = StringUtil.splitc(fullLine, ' ');

	from = StringUtil.replaceChar(pairs[0], '+', ' ');
	to = StringUtil.replaceChar(pairs[1], '+', ' ');
}
 
开发者ID:igr,项目名称:parlo,代码行数:7,代码来源:InputNormalizer.java


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