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