当前位置: 首页>>代码示例>>Java>>正文


Java JsonFormatVisitorWrapper.expectArrayFormat方法代码示例

本文整理汇总了Java中com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper.expectArrayFormat方法的典型用法代码示例。如果您正苦于以下问题:Java JsonFormatVisitorWrapper.expectArrayFormat方法的具体用法?Java JsonFormatVisitorWrapper.expectArrayFormat怎么用?Java JsonFormatVisitorWrapper.expectArrayFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper的用法示例。


在下文中一共展示了JsonFormatVisitorWrapper.expectArrayFormat方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: acceptJsonFormatVisitor

import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper; //导入方法依赖的package包/类
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper paramJsonFormatVisitorWrapper, JavaType paramJavaType)
{
  JsonArrayFormatVisitor localJsonArrayFormatVisitor1;
  if (paramJsonFormatVisitorWrapper == null)
    localJsonArrayFormatVisitor1 = null;
  else
    localJsonArrayFormatVisitor1 = paramJsonFormatVisitorWrapper.expectArrayFormat(paramJavaType);
  JsonArrayFormatVisitor localJsonArrayFormatVisitor2 = localJsonArrayFormatVisitor1;
  if (localJsonArrayFormatVisitor1 != null)
  {
    JavaType localJavaType = paramJsonFormatVisitorWrapper.getProvider().getTypeFactory().moreSpecificType(this._elementType, paramJavaType.getContentType());
    if (localJavaType == null)
      throw new JsonMappingException("Could not resolve type");
    JsonSerializer localJsonSerializer1 = this._elementSerializer;
    JsonSerializer localJsonSerializer2 = localJsonSerializer1;
    if (localJsonSerializer1 == null)
      localJsonSerializer2 = paramJsonFormatVisitorWrapper.getProvider().findValueSerializer(localJavaType, this._property);
    localJsonArrayFormatVisitor2.itemsFormat(localJsonSerializer2, localJavaType);
  }
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:21,代码来源:AsArraySerializerBase.java

示例2: _acceptTimestampVisitor

import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper; //导入方法依赖的package包/类
protected void _acceptTimestampVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException
{
    // By default, most sub-types use JSON Array, so do this:
    JsonArrayFormatVisitor v2 = visitor.expectArrayFormat(typeHint);
    if (v2 != null) {
        v2.itemsFormat(JsonFormatTypes.INTEGER);
    }
}
 
开发者ID:FasterXML,项目名称:jackson-modules-java8,代码行数:9,代码来源:JSR310FormattedSerializerBase.java

示例3: acceptJsonFormatVisitor

import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper; //导入方法依赖的package包/类
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper paramJsonFormatVisitorWrapper, JavaType paramJavaType)
{
  JsonArrayFormatVisitor localJsonArrayFormatVisitor = paramJsonFormatVisitorWrapper.expectArrayFormat(paramJavaType);
  if (localJsonArrayFormatVisitor != null)
  {
    JavaType localJavaType = paramJsonFormatVisitorWrapper.getProvider().getTypeFactory().moreSpecificType(this._elementType, paramJavaType.getContentType());
    if (localJavaType == null)
      throw new JsonMappingException("Could not resolve type");
    JsonSerializer localJsonSerializer1 = this._elementSerializer;
    JsonSerializer localJsonSerializer2 = localJsonSerializer1;
    if (localJsonSerializer1 == null)
      localJsonSerializer2 = paramJsonFormatVisitorWrapper.getProvider().findValueSerializer(localJavaType, this._property);
    localJsonArrayFormatVisitor.itemsFormat(localJsonSerializer2, localJavaType);
  }
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:16,代码来源:ObjectArraySerializer.java

示例4: acceptJsonFormatVisitor

import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper; //导入方法依赖的package包/类
public final void acceptJsonFormatVisitor(JsonFormatVisitorWrapper paramJsonFormatVisitorWrapper, JavaType paramJavaType)
{
  if (paramJsonFormatVisitorWrapper != null)
  {
    JsonArrayFormatVisitor localJsonArrayFormatVisitor = paramJsonFormatVisitorWrapper.expectArrayFormat(paramJavaType);
    if (localJsonArrayFormatVisitor != null)
      localJsonArrayFormatVisitor.itemsFormat(JsonFormatTypes.BOOLEAN);
  }
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:10,代码来源:StdArraySerializers.java

示例5: acceptJsonFormatVisitor

import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper; //导入方法依赖的package包/类
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper paramJsonFormatVisitorWrapper, JavaType paramJavaType)
{
  if (paramJsonFormatVisitorWrapper != null)
  {
    JsonArrayFormatVisitor localJsonArrayFormatVisitor = paramJsonFormatVisitorWrapper.expectArrayFormat(paramJavaType);
    if (localJsonArrayFormatVisitor != null)
      localJsonArrayFormatVisitor.itemsFormat(JsonFormatTypes.STRING);
  }
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:10,代码来源:StringArraySerializer.java

示例6: acceptJsonFormatVisitor

import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper; //导入方法依赖的package包/类
@Override
    public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
    {
        /* 15-Jan-2010, tatu: This should probably be rewritten, given that
         *    more information about content type is actually being explicitly
         *    passed. So there should be less need to try to re-process that
         *    information.
         */
        //ObjectNode o = createSchemaNode("array", true);
        JsonArrayFormatVisitor arrayVisitor = visitor.expectArrayFormat(typeHint);
        JavaType contentType = null;
        if (typeHint != null) {
            contentType = typeHint.getContentType();
            if (contentType == null) { // could still be parameterized (Iterators)
                // 30-Sep-2012, tatu: This is wrong, should use TypeFactory... but it is alas
                //    not being passed (oversight)
                if (typeHint instanceof ParameterizedType) {
                    Type[] typeArgs = ((ParameterizedType) typeHint).getActualTypeArguments();
                    if (typeArgs.length == 1) {
                        contentType = visitor.getProvider().constructType(typeArgs[0]);
                    }
                }
            }
        }
        if (contentType == null && _elementType != null) {
            contentType = _elementType;
        }
        if (contentType != null) {
//            JsonNode schemaNode = null;
            arrayVisitor.itemsFormat(contentType);
        }
    }
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:33,代码来源:AsArraySerializerBase.java


注:本文中的com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper.expectArrayFormat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。