本文整理匯總了Java中org.apache.wicket.util.string.StringValueConversionException類的典型用法代碼示例。如果您正苦於以下問題:Java StringValueConversionException類的具體用法?Java StringValueConversionException怎麽用?Java StringValueConversionException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
StringValueConversionException類屬於org.apache.wicket.util.string包,在下文中一共展示了StringValueConversionException類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: fromParameters
import org.apache.wicket.util.string.StringValueConversionException; //導入依賴的package包/類
@Override
public SearchContext fromParameters(PageParameters params) {
final StringValue indexParam = params.get(VloWebAppParameters.SEARCH_INDEX);
final StringValue countParam = params.get(VloWebAppParameters.SEARCH_COUNT);
final QueryFacetsSelection selection = selectionConverter.fromParameters(params);
if (!indexParam.isEmpty() && !countParam.isEmpty() && selection != null) {
try {
return new SearchContextModel(indexParam.toLong(), countParam.toLong(), Model.of(selection));
} catch (StringValueConversionException ex) {
logger.warn("Illegal query parameter value", ex);
}
}
return null;
}
示例2: toBoolean
import org.apache.wicket.util.string.StringValueConversionException; //導入依賴的package包/類
private static Boolean toBoolean(String[] value) throws ConversionException {
String tmp = value != null && value.length > 0 ? value[0] : null;
try {
return Strings.toBoolean(tmp);
} catch (StringValueConversionException e) {
final ConversionException conversionException = new ConversionException(
String.format("Invalid boolean input value posted \"%s\"", tmp), e);
conversionException.setTargetType(Boolean.class);
throw conversionException;
}
}
示例3: isChecked
import org.apache.wicket.util.string.StringValueConversionException; //導入依賴的package包/類
public boolean isChecked() {
final String value = getValue();
if (value != null) {
try {
return Strings.isTrue(value);
} catch (StringValueConversionException e) {
return false;
}
}
return false;
}