本文整理汇总了Java中org.databene.commons.ParseUtil类的典型用法代码示例。如果您正苦于以下问题:Java ParseUtil类的具体用法?Java ParseUtil怎么用?Java ParseUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ParseUtil类属于org.databene.commons包,在下文中一共展示了ParseUtil类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseSequence
import org.databene.commons.ParseUtil; //导入依赖的package包/类
private static DBSequence parseSequence(Element e, DBSchema schema) {
DBSequence sequence = new DBSequence(e.getAttribute("name"), schema);
String start = e.getAttribute("start");
if (!StringUtil.isEmpty(start))
sequence.setStart(new BigInteger(start));
String increment = e.getAttribute("increment");
if (!StringUtil.isEmpty(increment))
sequence.setIncrement(new BigInteger(increment));
String maxValue = e.getAttribute("maxValue");
if (!StringUtil.isEmpty(maxValue))
sequence.setMaxValue(new BigInteger(maxValue));
String minValue = e.getAttribute("minValue");
if (!StringUtil.isEmpty(minValue))
sequence.setMinValue(new BigInteger(minValue));
String cycle = e.getAttribute("cycle");
if (!StringUtil.isEmpty(cycle))
sequence.setCycle(ParseUtil.parseBoolean(cycle));
String cache = e.getAttribute("cache");
if (!StringUtil.isEmpty(cache))
sequence.setCache(Long.parseLong(cache));
String order = e.getAttribute("order");
if (!StringUtil.isEmpty(order))
sequence.setOrder(ParseUtil.parseBoolean(order));
return sequence;
}
示例2: parseSingleDbProperties
import org.databene.commons.ParseUtil; //导入依赖的package包/类
public static JDBCConnectData parseSingleDbProperties(String filename) throws IOException {
Map<String, String> properties = IOUtil.readProperties(filename);
String readOnlyConfig = properties.get("db_readonly");
boolean readOnly = (!StringUtil.isEmpty(readOnlyConfig) ? ParseUtil.parseBoolean(readOnlyConfig, true) : false);
return new JDBCConnectData(
properties.get("db_driver"), properties.get("db_url"),
properties.get("db_user"), properties.get("db_password"),
properties.get("db_catalog"), properties.get("db_schema"),
readOnly);
}
示例3: assertCustomToStringMethod
import org.databene.commons.ParseUtil; //导入依赖的package包/类
protected void assertCustomToStringMethod(Generator<?> generator) {
String s = generator.toString();
String className = generator.getClass().getName();
if (s.startsWith(className) && s.length() >= className.length() + 2
&& s.charAt(className.length()) == '@'
&& ParseUtil.isHex(s.substring(className.length() + 1)))
throw new AssertionFailedError("The toString() method of class " + generator.getClass() +
" is not customized");
}
示例4: setOverwrite
import org.databene.commons.ParseUtil; //导入依赖的package包/类
/** Verifies and sets the {@link #overwrite} flag.
* @param overwrite must be 'true', 'false' or null */
public final void setOverwrite(String overwrite) {
ParseUtil.parseBoolean(overwrite); // verifies that the flag is true, false or null
this.overwrite = overwrite;
}
示例5: parseBoolean
import org.databene.commons.ParseUtil; //导入依赖的package包/类
/** Parses a boolean value in a string ("true" or "false").
* @param text the text to parse
* @return <code>true</code> or <code>false</code> */
public static boolean parseBoolean(String text) {
return ParseUtil.parseBoolean(text);
}