本文整理汇总了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);
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:21,代码来源:DateTimeSerializerBase.java
示例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);
}
}
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:17,代码来源:DateTimeSerializerBase.java
示例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);
}
}
}
开发者ID:FasterXML,项目名称:jackson-modules-java8,代码行数:15,代码来源:YearMonthSerializer.java
示例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);
}
}
}
开发者ID:FasterXML,项目名称:jackson-modules-java8,代码行数:15,代码来源:DurationSerializer.java
示例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);
}
}
}
开发者ID:FasterXML,项目名称:jackson-modules-java8,代码行数:15,代码来源:JSR310FormattedSerializerBase.java
示例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);
}
}
}
开发者ID:FasterXML,项目名称:jackson-modules-java8,代码行数:15,代码来源:LocalDateSerializer.java
示例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);
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:12,代码来源:SqlTimeSerializer.java
示例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();
}
}
开发者ID:syndesisio,项目名称:syndesis-verifier,代码行数:59,代码来源:SqlStoredMetadataAdapter.java
示例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);
}
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:6,代码来源:SqlTimeSerializer.java
注:本文中的com.fasterxml.jackson.databind.jsonFormatVisitors.JsonValueFormat类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论