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


Java StringUtil.split方法代码示例

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


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

示例1: getVersion

import org.teiid.core.util.StringUtil; //导入方法依赖的package包/类
/** 
 * @return Returns the version.
 */
public String getVersion() {
	if (this.version != null) {
		//normalize to allow for more increments
		StringBuilder builder = new StringBuilder();
		List<String> parts = StringUtil.split(this.version, "."); //$NON-NLS-1$
		for (int i = 0; i < parts.size(); i++) { 
			if (i > 0) {
    			builder.append('.');
			}
			String part = parts.get(i);
			if (part.length() < 2 && Character.isDigit(part.charAt(0))) {
				builder.append('0');
			}
			builder.append(part);
		}
		return builder.toString();
	}
    return this.version;
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:23,代码来源:Handshake.java

示例2: getQuerySetName

import org.teiid.core.util.StringUtil; //导入方法依赖的package包/类
private static String getQuerySetName(String queryFileName) {
// Get query set name
String querySet = queryFileName;
List<String> nameParts = StringUtil.split(querySet, "./\\"); //$NON-NLS-1$
if (nameParts.size() > 1) {
    querySet = nameParts.get(nameParts.size() - 2);
}
return querySet;
   }
 
开发者ID:kenweezy,项目名称:teiid,代码行数:10,代码来源:XMLQueryReader.java

示例3: compareStrTokens

import org.teiid.core.util.StringUtil; //导入方法依赖的package包/类
private boolean compareStrTokens(String expectedStr, String gotStr) {
	String newline = System.getProperty("line.separator"); //$NON-NLS-1$
	List expectedTokens = StringUtil.split(expectedStr, newline);
	List gotTokens = StringUtil.split(gotStr, newline);
	for (int i = 0; i < expectedTokens.size(); i++) {
		String expected = (String) expectedTokens.get(i);
		String got = (String) gotTokens.get(i);
		if (!expected.equals(got)) {
			return false;
		}
	}
	return true;
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:14,代码来源:XMLExpectedResults.java

示例4: applyGlobalTableHint

import org.teiid.core.util.StringUtil; //导入方法依赖的package包/类
private boolean applyGlobalTableHint(PlanNode plan,
		NodeConstants.Info hintProperty, String groupName, Object value) {
	GroupSymbol gs = new GroupSymbol(groupName);
	List<String> nameParts = StringUtil.split(gs.getName(), "."); //$NON-NLS-1$
	PlanNode root = plan;
	boolean found = true;
	for (int i = 0; i < nameParts.size() && found; i++) {
		String part = nameParts.get(i);
		List<PlanNode> targets = NodeEditor.findAllNodes(root.getFirstChild(), NodeConstants.Types.SOURCE, NodeConstants.Types.SOURCE);
		boolean leaf = i == nameParts.size() - 1;
		found = false;
		for (PlanNode planNode : targets) {
			if (part.equalsIgnoreCase(planNode.getGroups().iterator().next().getShortName())) {
				if (leaf) {
					planNode.setProperty(hintProperty, value);
	                return true;
				} else if (planNode.getChildren().isEmpty()) {
					return false;
				}
				root = planNode;
				found = true;
				break;
			}
		}
	}
	return false;
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:28,代码来源:RelationalPlanner.java

示例5: convertParameters

import org.teiid.core.util.StringUtil; //导入方法依赖的package包/类
private LinkedHashMap<String, Object> convertParameters(Connection conn, String vdbName, String procedureName,
        LinkedHashMap<String, String> inputParameters) throws SQLException {
    
    Map<String, Class> expectedTypes = getParameterTypes(conn, vdbName, procedureName);
    LinkedHashMap<String, Object> expectedValues = new LinkedHashMap<String, Object>();
    try {
        for (String columnName : inputParameters.keySet()) {
            Class runtimeType = expectedTypes.get(columnName);
            if (runtimeType == null) {
                throw new SQLException(IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50105, columnName,
                        procedureName));
            }                
            Object value = inputParameters.get(columnName);
            if (runtimeType.isAssignableFrom(Array.class)) {
                List<String> array = StringUtil.split((String)value, ","); //$NON-NLS-1$
                value = array.toArray(new String[array.size()]);
            }
            else if (runtimeType.isAssignableFrom(DataTypeManager.DefaultDataClasses.VARBINARY)) {
                value = Base64.decode((String)value);
            }
            else {
                if (value != null && DataTypeManager.isTransformable(String.class, runtimeType)) {
                    Transform t = DataTypeManager.getTransform(String.class, runtimeType);
                    value = t.transform(value, runtimeType);
                }
            }
            expectedValues.put(columnName, value);
        }
        return expectedValues;
    } catch (TransformationException e) {
        throw new SQLException(e);
    }
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:34,代码来源:TeiidRSProvider.java

示例6: DepthNode

import org.teiid.core.util.StringUtil; //导入方法依赖的package包/类
DepthNode(String name, int colLocation) {
	this();
	nodes = StringUtil.split(name, ".");
	nodeSize = nodes.size();
	depthNodes = name.substring(0, name.lastIndexOf("."));
	columnLoc = colLocation;
	
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:9,代码来源:InfinispanExecution.java


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