本文整理匯總了Java中org.odata4j.expression.DoubleLiteral類的典型用法代碼示例。如果您正苦於以下問題:Java DoubleLiteral類的具體用法?Java DoubleLiteral怎麽用?Java DoubleLiteral使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
DoubleLiteral類屬於org.odata4j.expression包,在下文中一共展示了DoubleLiteral類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getSearchValue
import org.odata4j.expression.DoubleLiteral; //導入依賴的package包/類
/**
* elasticsearchの検索文字列を返卻する.
* @param expr CommonExpression
* @return elasticsearchの検索文字列
*/
private Object getSearchValue(CommonExpression expr) {
if (expr instanceof IntegralLiteral) {
return ((IntegralLiteral) expr).getValue();
} else if (expr instanceof Int64Literal) {
return ((Int64Literal) expr).getValue();
} else if (expr instanceof DoubleLiteral) {
return ((DoubleLiteral) expr).getValue();
} else if (expr instanceof BooleanLiteral) {
return ((BooleanLiteral) expr).getValue();
} else if (expr instanceof DateTimeLiteral) {
return ((DateTimeLiteral) expr).getValue().toDateTime(DateTimeZone.UTC).getMillis();
} else if (expr instanceof DateTimeOffsetLiteral) {
return ((DateTimeOffsetLiteral) expr).getValue().getMillis();
} else {
String value;
try {
value = StringEscapeUtils.unescapeJavaScript(((StringLiteral) expr).getValue());
} catch (Exception e) {
log.info("Failed to unescape searchValue.", e);
throw PersoniumCoreException.OData.OPERATOR_AND_OPERAND_UNABLE_TO_UNESCAPE.params(((StringLiteral) expr)
.getValue());
}
return value;
}
}
示例2: validate
import org.odata4j.expression.DoubleLiteral; //導入依賴的package包/類
@Override
public void validate(CommonExpression searchValue, String propertyName) {
double value = 0D; // odata4jのDoubleLiteral#gerValueがdouble型の値を返すためvalueはdouble型とした。
if (searchValue instanceof IntegralLiteral) {
value = ((IntegralLiteral) searchValue).getValue();
} else if (searchValue instanceof Int64Literal) {
value = ((Int64Literal) searchValue).getValue();
} else if (searchValue instanceof DoubleLiteral) {
value = ((DoubleLiteral) searchValue).getValue();
} else if (searchValue instanceof NullLiteral) {
value = 0;
} else {
throw PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params(propertyName);
}
// 値の範囲チェック
if (!ODataUtils.validateSingle(String.valueOf(value))) {
throw PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params(propertyName);
}
}
示例3: visit
import org.odata4j.expression.DoubleLiteral; //導入依賴的package包/類
@Override
public void visit(DoubleLiteral expr) {
}
示例4: visit
import org.odata4j.expression.DoubleLiteral; //導入依賴的package包/類
@Override
public void visit(DoubleLiteral expr) {
// TODO: Customise this generated block
}