本文整理匯總了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);
}