本文整理汇总了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
}