本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}