本文整理匯總了Java中org.teiid.core.util.StringUtil.startsWithIgnoreCase方法的典型用法代碼示例。如果您正苦於以下問題:Java StringUtil.startsWithIgnoreCase方法的具體用法?Java StringUtil.startsWithIgnoreCase怎麽用?Java StringUtil.startsWithIgnoreCase使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.teiid.core.util.StringUtil
的用法示例。
在下文中一共展示了StringUtil.startsWithIgnoreCase方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addNamespace
import org.teiid.core.util.StringUtil; //導入方法依賴的package包/類
public void addNamespace(String prefix, String uri) {
if (uri == null || uri.indexOf('}') != -1) {
throw new MetadataException(DataPlugin.Event.TEIID60018, DataPlugin.Util.gs(DataPlugin.Event.TEIID60018, uri));
}
if (StringUtil.startsWithIgnoreCase(prefix, TEIID_RESERVED)) {
String validURI = BUILTIN_NAMESPACES.get(prefix);
if (validURI == null || !uri.equals(validURI)) {
throw new MetadataException(DataPlugin.Event.TEIID60017, DataPlugin.Util.gs(DataPlugin.Event.TEIID60017, prefix));
}
}
if (this.namespaces == null) {
this.namespaces = new TreeMap<String, String>(String.CASE_INSENSITIVE_ORDER);
}
this.namespaces.put(prefix, uri);
}
示例2: matchesPartialName
import org.teiid.core.util.StringUtil; //導入方法依賴的package包/類
protected boolean matchesPartialName(String partialGroupName, String name, Schema schema) {
if (!StringUtil.endsWithIgnoreCase(name, partialGroupName)) {
return false;
}
int schemaMatch = partialGroupName.length() - name.length();
if (schemaMatch > 0) {
if (schemaMatch != schema.getName().length() + 1
|| !StringUtil.startsWithIgnoreCase(partialGroupName, schema.getName())
|| partialGroupName.charAt(schemaMatch + 1) != '.') {
return false;
}
} else if (schemaMatch < 0 && name.charAt(-schemaMatch - 1) != '.') {
return false;
}
return true;
}
示例3: sendCommandComplete
import org.teiid.core.util.StringUtil; //導入方法依賴的package包/類
@Override
public void sendCommandComplete(String sql, Integer count) {
startMessage('C');
String tag;
if (StringUtil.startsWithIgnoreCase(sql, "BEGIN") || StringUtil.startsWithIgnoreCase(sql, "START TRANSACTION")) {
tag = "BEGIN";
} else if (sql.indexOf(' ') == -1) {
//should already be a completion tag
tag = sql.toUpperCase();
if (count != null) {
tag += " " + count;
}
} else if (StringUtil.startsWithIgnoreCase(sql, "SET ")) {
tag = "SET";
} else {
tag = SqlUtil.getKeyword(sql).toUpperCase();
if (tag.equals("EXEC") || tag.equals("CALL")) {
tag = "SELECT";
}
if (count != null) {
tag += " " + count;
}
}
writeString(tag);
sendMessage();
}
示例4: getElementsUnderNode
import org.teiid.core.util.StringUtil; //導入方法依賴的package包/類
static List<ElementSymbol> getElementsUnderNode(Object mid, Collection<ElementSymbol> validElements, QueryMetadataInterface metadata)
throws TeiidComponentException, QueryMetadataException {
List<ElementSymbol> elements = new ArrayList<ElementSymbol>();
String nodeName = metadata.getFullName(mid);
for (ElementSymbol validElement : validElements) {
String qualifiedName = validElement.getName();
if (StringUtil.startsWithIgnoreCase(qualifiedName, nodeName) && (qualifiedName.length() == nodeName.length() || qualifiedName.charAt(nodeName.length()) == '.')) {
elements.add(validElement);
}
}
return elements;
}
示例5: TeiidURL
import org.teiid.core.util.StringUtil; //導入方法依賴的package包/類
/**
* Create an MMURL from the server URL. For use by the server-side.
* @param serverURL Expected format: mm[s]://server1:port1[,server2:port2]
* @throws MalformedURLException
* @since 4.2
*/
public TeiidURL(String serverURL) throws MalformedURLException {
if (serverURL == null) {
throw new MalformedURLException(INVALID_FORMAT_SERVER);
}
if (StringUtil.startsWithIgnoreCase(serverURL, SECURE_PROTOCOL)) {
usingSSL = true;
} else if (!StringUtil.startsWithIgnoreCase(serverURL, DEFAULT_PROTOCOL)) {
throw new MalformedURLException(INVALID_FORMAT_SERVER);
}
appServerURL = serverURL;
parseServerURL(serverURL.substring(usingSSL?SECURE_PROTOCOL.length():DEFAULT_PROTOCOL.length()), INVALID_FORMAT_SERVER);
}