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


Java StringUtils.toUpperEnglish方法代码示例

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


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

示例1: readProperties

import org.h2.util.StringUtils; //导入方法依赖的package包/类
private void readProperties(Properties info) {
    Object[] list = new Object[info.size()];
    info.keySet().toArray(list);
    DbSettings s = null;
    for (Object k : list) {
        String key = StringUtils.toUpperEnglish(k.toString());
        if (prop.containsKey(key)) {
            throw DbException.get(ErrorCode.DUPLICATE_PROPERTY_1, key);
        }
        Object value = info.get(k);
        if (isKnownSetting(key)) {
            prop.put(key, value);
        } else {
            if (s == null) {
                s = getDbSettings();
            }
            if (s.containsKey(key)) {
                prop.put(key, value);
            }
        }
    }
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:23,代码来源:ConnectionInfo.java

示例2: parseDatabaseShortName

import org.h2.util.StringUtils; //导入方法依赖的package包/类
private String parseDatabaseShortName() {
    String n = databaseName;
    if (n.endsWith(":")) {
        n = null;
    }
    if (n != null) {
        StringTokenizer tokenizer = new StringTokenizer(n, "/\\:,;");
        while (tokenizer.hasMoreTokens()) {
            n = tokenizer.nextToken();
        }
    }
    if (n == null || n.length() == 0) {
        n = "unnamed";
    }
    return dbSettings.databaseToUpper ? StringUtils.toUpperEnglish(n) : n;
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:17,代码来源:Database.java

示例3: getDefaultSchemaName

import org.h2.util.StringUtils; //导入方法依赖的package包/类
private String getDefaultSchemaName(DatabaseMetaData meta) {
    String defaultSchemaName = "";
    try {
        if (isOracle) {
            return meta.getUserName();
        } else if (isPostgreSQL) {
            return "public";
        } else if (isMySQL) {
            return "";
        } else if (isDerby) {
            return StringUtils.toUpperEnglish(meta.getUserName());
        } else if (isFirebird) {
            return null;
        }
        ResultSet rs = meta.getSchemas();
        int index = rs.findColumn("IS_DEFAULT");
        while (rs.next()) {
            if (rs.getBoolean(index)) {
                defaultSchemaName = rs.getString("TABLE_SCHEM");
            }
        }
    } catch (SQLException e) {
        // IS_DEFAULT not found
    }
    return defaultSchemaName;
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:27,代码来源:DbContents.java

示例4: getFunction

import org.h2.util.StringUtils; //导入方法依赖的package包/类
/**
 * Get an instance of the given function for this database.
 * If no function with this name is found, null is returned.
 *
 * @param database the database
 * @param name the function name
 * @return the function object or null
 */
public static Function getFunction(Database database, String name) {
    if (!database.getSettings().databaseToUpper) {
        // if not yet converted to uppercase, do it now
        name = StringUtils.toUpperEnglish(name);
    }
    FunctionInfo info = getFunctionInfo(name);
    if (info == null) {
        return null;
    }
    switch(info.type) {
    case TABLE:
    case TABLE_DISTINCT:
        return new TableFunction(database, info, Long.MAX_VALUE);
    default:
        return new Function(database, info);
    }
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:26,代码来源:Function.java

示例5: setTranslations

import org.h2.util.StringUtils; //导入方法依赖的package包/类
/**
 * Initialize the SQL statement translation of this database.
 *
 * @param prop the properties with the translations to use
 */
void setTranslations(Properties prop) {
    String databaseType = url.substring("jdbc:".length());
    databaseType = databaseType.substring(0, databaseType.indexOf(':'));
    for (Object k : prop.keySet()) {
        String key = (String) k;
        if (key.startsWith(databaseType + ".")) {
            String pattern = key.substring(databaseType.length() + 1);
            pattern = StringUtils.replaceAll(pattern, "_", " ");
            pattern = StringUtils.toUpperEnglish(pattern);
            String replacement = prop.getProperty(key);
            replace.add(new String[]{pattern, replacement});
        }
    }
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:20,代码来源:Database.java

示例6: readSettingsFromURL

import org.h2.util.StringUtils; //导入方法依赖的package包/类
private void readSettingsFromURL() {
    DbSettings defaultSettings = DbSettings.getDefaultSettings();
    int idx = url.indexOf(';');
    if (idx >= 0) {
        String settings = url.substring(idx + 1);
        url = url.substring(0, idx);
        String[] list = StringUtils.arraySplit(settings, ';', false);
        for (String setting : list) {
            if (setting.length() == 0) {
                continue;
            }
            int equal = setting.indexOf('=');
            if (equal < 0) {
                throw getFormatException();
            }
            String value = setting.substring(equal + 1);
            String key = setting.substring(0, equal);
            key = StringUtils.toUpperEnglish(key);
            if (!isKnownSetting(key) && !defaultSettings.containsKey(key)) {
                throw DbException.get(ErrorCode.UNSUPPORTED_SETTING_1, key);
            }
            String old = prop.getProperty(key);
            if (old != null && !old.equals(value)) {
                throw DbException.get(ErrorCode.DUPLICATE_PROPERTY_1, key);
            }
            prop.setProperty(key, value);
        }
    }
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:30,代码来源:ConnectionInfo.java

示例7: getName

import org.h2.util.StringUtils; //导入方法依赖的package包/类
/**
 * Get the collation name.
 *
 * @param l the locale
 * @return the name of the collation
 */
public static String getName(Locale l) {
    Locale english = Locale.ENGLISH;
    String name = l.getDisplayLanguage(english) + ' ' +
            l.getDisplayCountry(english) + ' ' + l.getVariant();
    name = StringUtils.toUpperEnglish(name.trim().replace(' ', '_'));
    return name;
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:14,代码来源:CompareMode.java

示例8: setQuery

import org.h2.util.StringUtils; //导入方法依赖的package包/类
/**
 * Set the query string.
 *
 * @param query the query string
 */
public void setQuery(String query) {
    if (!StringUtils.equals(this.query, query)) {
        this.query = query;
        this.queryUpper = StringUtils.toUpperEnglish(query);
    }
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:12,代码来源:Sentence.java

示例9: quoteIdentifier

import org.h2.util.StringUtils; //导入方法依赖的package包/类
/**
 * Add double quotes around an identifier if required.
 * For the H2 database, all identifiers are quoted.
 *
 * @param identifier the identifier
 * @return the quoted identifier
 */
public String quoteIdentifier(String identifier) {
    if (identifier == null) {
        return null;
    }
    if (isH2 && !isH2ModeMySQL) {
        return Parser.quoteIdentifier(identifier);
    }
    return StringUtils.toUpperEnglish(identifier);
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:17,代码来源:DbContents.java

示例10: getCompressAlgorithm

import org.h2.util.StringUtils; //导入方法依赖的package包/类
/**
 * INTERNAL
 */
public static int getCompressAlgorithm(String algorithm) {
    algorithm = StringUtils.toUpperEnglish(algorithm);
    if ("NO".equals(algorithm)) {
        return Compressor.NO;
    } else if ("LZF".equals(algorithm)) {
        return Compressor.LZF;
    } else if ("DEFLATE".equals(algorithm)) {
        return Compressor.DEFLATE;
    } else {
        throw DbException.get(
                ErrorCode.UNSUPPORTED_COMPRESSION_ALGORITHM_1,
                algorithm);
    }
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:18,代码来源:CompressTool.java

示例11: convertColumnName

import org.h2.util.StringUtils; //导入方法依赖的package包/类
private String convertColumnName(String columnName) {
    if ((storesMixedCase || storesLowerCase) &&
            columnName.equals(StringUtils.toLowerEnglish(columnName))) {
        columnName = StringUtils.toUpperEnglish(columnName);
    } else if (storesMixedCase && !supportsMixedCaseIdentifiers) {
        // TeraData
        columnName = StringUtils.toUpperEnglish(columnName);
    } else if (storesMixedCase && storesMixedCaseQuoted) {
        // MS SQL Server (identifiers are case insensitive even if quoted)
        columnName = StringUtils.toUpperEnglish(columnName);
    }
    return columnName;
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:14,代码来源:TableLink.java

示例12: getAggregateType

import org.h2.util.StringUtils; //导入方法依赖的package包/类
private int getAggregateType(String name) {
    if (!identifiersToUpper) {
        // if not yet converted to uppercase, do it now
        name = StringUtils.toUpperEnglish(name);
    }
    return Aggregate.getAggregateType(name);
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:8,代码来源:Parser.java

示例13: getTokenType

import org.h2.util.StringUtils; //导入方法依赖的package包/类
private int getTokenType(String s) {
    int len = s.length();
    if (len == 0) {
        throw getSyntaxError();
    }
    if (!identifiersToUpper) {
        // if not yet converted to uppercase, do it now
        s = StringUtils.toUpperEnglish(s);
    }
    return getSaveTokenType(s, database.getMode().supportOffsetFetch);
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:12,代码来源:Parser.java

示例14: isKeyword

import org.h2.util.StringUtils; //导入方法依赖的package包/类
private boolean isKeyword(String s) {
    if (!identifiersToUpper) {
        // if not yet converted to uppercase, do it now
        s = StringUtils.toUpperEnglish(s);
    }
    return isKeyword(s, false);
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:8,代码来源:Parser.java

示例15: Database

import org.h2.util.StringUtils; //导入方法依赖的package包/类
public Database(ConnectionInfo ci, String cipher) {
    String name = ci.getName();
    this.dbSettings = ci.getDbSettings();
    this.reconnectCheckDelay = dbSettings.reconnectCheckDelay;
    this.compareMode = CompareMode.getInstance(null, 0);
    this.persistent = ci.isPersistent();
    this.filePasswordHash = ci.getFilePasswordHash();
    this.fileEncryptionKey = ci.getFileEncryptionKey();
    this.databaseName = name;
    this.databaseShortName = parseDatabaseShortName();
    this.maxLengthInplaceLob = Constants.DEFAULT_MAX_LENGTH_INPLACE_LOB;
    this.cipher = cipher;
    String lockMethodName = ci.getProperty("FILE_LOCK", null);
    this.accessModeData = StringUtils.toLowerEnglish(
            ci.getProperty("ACCESS_MODE_DATA", "rw"));
    this.autoServerMode = ci.getProperty("AUTO_SERVER", false);
    this.autoServerPort = ci.getProperty("AUTO_SERVER_PORT", 0);
    int defaultCacheSize = Utils.scaleForAvailableMemory(
            Constants.CACHE_SIZE_DEFAULT);
    this.cacheSize =
            ci.getProperty("CACHE_SIZE", defaultCacheSize);
    this.pageSize = ci.getProperty("PAGE_SIZE",
            Constants.DEFAULT_PAGE_SIZE);
    if ("r".equals(accessModeData)) {
        readOnly = true;
    }
    if (dbSettings.mvStore && lockMethodName == null) {
        if (autoServerMode) {
            fileLockMethod = FileLock.LOCK_FILE;
        } else {
            fileLockMethod = FileLock.LOCK_FS;
        }
    } else {
        fileLockMethod = FileLock.getFileLockMethod(lockMethodName);
    }
    if (dbSettings.mvStore && fileLockMethod == FileLock.LOCK_SERIALIZED) {
        throw DbException.getUnsupportedException(
                "MV_STORE combined with FILE_LOCK=SERIALIZED");
    }
    this.databaseURL = ci.getURL();
    String listener = ci.removeProperty("DATABASE_EVENT_LISTENER", null);
    if (listener != null) {
        listener = StringUtils.trim(listener, true, true, "'");
        setEventListenerClass(listener);
    }
    String modeName = ci.removeProperty("MODE", null);
    if (modeName != null) {
        this.mode = Mode.getInstance(modeName);
    }
    this.multiVersion =
            ci.getProperty("MVCC", dbSettings.mvStore);
    this.logMode =
            ci.getProperty("LOG", PageStore.LOG_MODE_SYNC);
    this.javaObjectSerializerName =
            ci.getProperty("JAVA_OBJECT_SERIALIZER", null);
    this.multiThreaded =
            ci.getProperty("MULTI_THREADED", false);

    boolean closeAtVmShutdown =
            dbSettings.dbCloseOnExit;
    int traceLevelFile =
            ci.getIntProperty(SetTypes.TRACE_LEVEL_FILE,
            TraceSystem.DEFAULT_TRACE_LEVEL_FILE);
    int traceLevelSystemOut =
            ci.getIntProperty(SetTypes.TRACE_LEVEL_SYSTEM_OUT,
            TraceSystem.DEFAULT_TRACE_LEVEL_SYSTEM_OUT);
    this.cacheType = StringUtils.toUpperEnglish(
            ci.removeProperty("CACHE_TYPE", Constants.CACHE_TYPE_DEFAULT));
    openDatabase(traceLevelFile, traceLevelSystemOut, closeAtVmShutdown);
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:71,代码来源:Database.java


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