本文整理汇总了Java中com.fasterxml.jackson.databind.jsonFormatVisitors.JsonValueFormat类的典型用法代码示例。如果您正苦于以下问题:Java JsonValueFormat类的具体用法?Java JsonValueFormat怎么用?Java JsonValueFormat使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JsonValueFormat类属于com.fasterxml.jackson.databind.jsonFormatVisitors包,在下文中一共展示了JsonValueFormat类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: acceptJsonFormatVisitor
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonValueFormat; //导入依赖的package包/类
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper paramJsonFormatVisitorWrapper, JavaType paramJavaType)
{
boolean bool1 = this._useTimestamp;
boolean bool2 = bool1;
if ((!bool1) && (this._customFormat == null))
bool2 = paramJsonFormatVisitorWrapper.getProvider().isEnabled(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
if (bool2)
{
JsonIntegerFormatVisitor localJsonIntegerFormatVisitor = paramJsonFormatVisitorWrapper.expectIntegerFormat(paramJavaType);
if (localJsonIntegerFormatVisitor != null)
{
localJsonIntegerFormatVisitor.numberType(JsonParser.NumberType.LONG);
localJsonIntegerFormatVisitor.format(JsonValueFormat.UTC_MILLISEC);
}
return;
}
JsonStringFormatVisitor localJsonStringFormatVisitor = paramJsonFormatVisitorWrapper.expectStringFormat(paramJavaType);
if (localJsonStringFormatVisitor != null)
localJsonStringFormatVisitor.format(JsonValueFormat.DATE_TIME);
}
示例2: acceptJsonFormatVisitor
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonValueFormat; //导入依赖的package包/类
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
{
//todo: (ryan) add a format for the date in the schema?
boolean asNumber = _useTimestamp;
if (!asNumber) {
if (_customFormat == null) {
asNumber = visitor.getProvider().isEnabled(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
}
}
if (asNumber) {
visitor.expectNumberFormat(typeHint).format(JsonValueFormat.UTC_MILLISEC);
} else {
visitor.expectStringFormat(typeHint).format(JsonValueFormat.DATE_TIME);
}
}
示例3: _acceptTimestampVisitor
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonValueFormat; //导入依赖的package包/类
@Override
protected void _acceptTimestampVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException
{
SerializerProvider provider = visitor.getProvider();
boolean useTimestamp = (provider != null) && useTimestamp(provider);
if (useTimestamp) {
super._acceptTimestampVisitor(visitor, typeHint);
} else {
JsonStringFormatVisitor v2 = visitor.expectStringFormat(typeHint);
if (v2 != null) {
v2.format(JsonValueFormat.DATE_TIME);
}
}
}
示例4: _acceptTimestampVisitor
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonValueFormat; //导入依赖的package包/类
@Override
protected void _acceptTimestampVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException
{
JsonIntegerFormatVisitor v2 = visitor.expectIntegerFormat(typeHint);
if (v2 != null) {
v2.numberType(JsonParser.NumberType.LONG);
SerializerProvider provider = visitor.getProvider();
if ((provider != null) && provider.isEnabled(SerializationFeature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS)) {
// big number, no more specific qualifier to use...
} else { // otherwise good old Unix timestamp, in milliseconds
v2.format(JsonValueFormat.UTC_MILLISEC);
}
}
}
示例5: acceptJsonFormatVisitor
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonValueFormat; //导入依赖的package包/类
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException
{
SerializerProvider provider = visitor.getProvider();
boolean useTimestamp = (provider != null) && useTimestamp(provider);
if (useTimestamp) {
_acceptTimestampVisitor(visitor, typeHint);
} else {
JsonStringFormatVisitor v2 = visitor.expectStringFormat(typeHint);
if (v2 != null) {
v2.format(JsonValueFormat.DATE_TIME);
}
}
}
示例6: acceptJsonFormatVisitor
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonValueFormat; //导入依赖的package包/类
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException
{
SerializerProvider provider = visitor.getProvider();
boolean useTimestamp = (provider != null) && useTimestamp(provider);
if (useTimestamp) {
_acceptTimestampVisitor(visitor, typeHint);
} else {
JsonStringFormatVisitor v2 = visitor.expectStringFormat(typeHint);
if (v2 != null) {
v2.format(JsonValueFormat.DATE);
}
}
}
示例7: acceptJsonFormatVisitor
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonValueFormat; //导入依赖的package包/类
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper paramJsonFormatVisitorWrapper, JavaType paramJavaType)
{
JsonStringFormatVisitor localJsonStringFormatVisitor1;
if (paramJsonFormatVisitorWrapper == null)
localJsonStringFormatVisitor1 = null;
else
localJsonStringFormatVisitor1 = paramJsonFormatVisitorWrapper.expectStringFormat(paramJavaType);
JsonStringFormatVisitor localJsonStringFormatVisitor2 = localJsonStringFormatVisitor1;
if (localJsonStringFormatVisitor1 != null)
localJsonStringFormatVisitor2.format(JsonValueFormat.DATE_TIME);
}
示例8: schemaFor
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonValueFormat; //导入依赖的package包/类
static JsonSchema schemaFor(final JDBCType jdbcType) {
final JsonSchemaFactory factory = new JsonSchemaFactory();
switch (jdbcType) {
case ARRAY:
return factory.arraySchema();
case BINARY:
case BLOB:
case LONGVARBINARY:
case VARBINARY:
final ArraySchema binary = factory.arraySchema();
binary.setItemsSchema(factory.integerSchema());
return binary;
case BIT:
case BOOLEAN:
return factory.booleanSchema();
case CHAR:
case CLOB:
case DATALINK:
case LONGNVARCHAR:
case LONGVARCHAR:
case NCHAR:
case NCLOB:
case NVARCHAR:
case ROWID:
case SQLXML:
case VARCHAR:
return factory.stringSchema();
case DATE:
case TIME:
case TIMESTAMP:
case TIMESTAMP_WITH_TIMEZONE:
case TIME_WITH_TIMEZONE:
final StringSchema date = factory.stringSchema();
date.setFormat(JsonValueFormat.DATE_TIME);
return date;
case DECIMAL:
case DOUBLE:
case FLOAT:
case NUMERIC:
case REAL:
return factory.numberSchema();
case INTEGER:
case BIGINT:
case SMALLINT:
case TINYINT:
return factory.integerSchema();
case NULL:
return factory.nullSchema();
case DISTINCT:
case JAVA_OBJECT:
case OTHER:
case REF:
case REF_CURSOR:
case STRUCT:
default:
return factory.anySchema();
}
}
示例9: acceptJsonFormatVisitor
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonValueFormat; //导入依赖的package包/类
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
{
visitor.expectStringFormat(typeHint).format(JsonValueFormat.DATE_TIME);
}