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