本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}