本文整理汇总了Java中org.odata4j.expression.DateTimeOffsetLiteral类的典型用法代码示例。如果您正苦于以下问题:Java DateTimeOffsetLiteral类的具体用法?Java DateTimeOffsetLiteral怎么用?Java DateTimeOffsetLiteral使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DateTimeOffsetLiteral类属于org.odata4j.expression包,在下文中一共展示了DateTimeOffsetLiteral类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSearchValue
import org.odata4j.expression.DateTimeOffsetLiteral; //导入依赖的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.DateTimeOffsetLiteral; //导入依赖的package包/类
@Override
public void validate(CommonExpression searchValue, String propertyName) {
long value = 0L; // odata4jのInt64Literal#gerValueがlong型の値を返すためvalueはlong型とした。
if (searchValue instanceof IntegralLiteral) {
value = ((IntegralLiteral) searchValue).getValue();
} else if (searchValue instanceof Int64Literal) {
value = ((Int64Literal) searchValue).getValue();
} else if (searchValue instanceof DateTimeLiteral) {
value = ((DateTimeLiteral) searchValue).getValue().toDateTime(DateTimeZone.UTC).getMillis();
} else if (searchValue instanceof DateTimeOffsetLiteral) {
value = ((DateTimeOffsetLiteral) searchValue).getValue().getMillis();
} else if (searchValue instanceof NullLiteral) {
value = 0;
} else {
throw PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params(propertyName);
}
// 値の範囲チェック
if (value > ODataUtils.DATETIME_MAX || value < ODataUtils.DATETIME_MIN) {
throw PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params(propertyName);
}
}
示例3: visit
import org.odata4j.expression.DateTimeOffsetLiteral; //导入依赖的package包/类
@Override
public void visit(DateTimeOffsetLiteral expr) {
}
示例4: visit
import org.odata4j.expression.DateTimeOffsetLiteral; //导入依赖的package包/类
@Override
public void visit(DateTimeOffsetLiteral expr) {
// TODO: Customise this generated block
}