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


Java JsonObjectFormatVisitor类代码示例

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


JsonObjectFormatVisitor类属于com.fasterxml.jackson.databind.jsonFormatVisitors包,在下文中一共展示了JsonObjectFormatVisitor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: acceptJsonFormatVisitor

import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor; //导入依赖的package包/类
@Override
public void acceptJsonFormatVisitor(final JsonFormatVisitorWrapper wrapper, final JavaType hint)
        throws JsonMappingException {

    final JsonObjectFormatVisitor visitor = wrapper.expectObjectFormat(hint);

    visitor.property(names.getAmount(),
            wrapper.getProvider().findValueSerializer(writer.getType()),
            wrapper.getProvider().constructType(writer.getType()));

    visitor.property(names.getCurrency(),
            wrapper.getProvider().findValueSerializer(CurrencyUnit.class),
            wrapper.getProvider().constructType(CurrencyUnit.class));

    visitor.optionalProperty(names.getFormatted(),
            wrapper.getProvider().findValueSerializer(String.class),
            wrapper.getProvider().constructType(String.class));
}
 
开发者ID:zalando,项目名称:jackson-datatype-money,代码行数:19,代码来源:MonetaryAmountSerializer.java

示例2: acceptJsonFormatVisitor

import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor; //导入依赖的package包/类
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper paramJsonFormatVisitorWrapper, JavaType paramJavaType)
{
  JsonObjectFormatVisitor localJsonObjectFormatVisitor1;
  if (paramJsonFormatVisitorWrapper == null)
    localJsonObjectFormatVisitor1 = null;
  else
    localJsonObjectFormatVisitor1 = paramJsonFormatVisitorWrapper.expectObjectFormat(paramJavaType);
  JsonObjectFormatVisitor localJsonObjectFormatVisitor2 = localJsonObjectFormatVisitor1;
  if (localJsonObjectFormatVisitor1 != null)
  {
    if (this._propertyFilterId != null)
    {
      BeanPropertyFilter localBeanPropertyFilter = findFilter(paramJsonFormatVisitorWrapper.getProvider());
      for (int j = 0; j < this._props.length; j++)
        localBeanPropertyFilter.depositSchemaProperty(this._props[j], localJsonObjectFormatVisitor2, paramJsonFormatVisitorWrapper.getProvider());
      return;
    }
    for (int i = 0; i < this._props.length; i++)
      this._props[i].depositSchemaProperty(localJsonObjectFormatVisitor2);
  }
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:22,代码来源:BeanSerializerBase.java

示例3: acceptJsonFormatVisitor

import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor; //导入依赖的package包/类
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
    throws JsonMappingException
{
	//deposit your output format 
	JsonObjectFormatVisitor objectVisitor = visitor.expectObjectFormat(typeHint);
 
    if (_propertyFilterId != null) {
        BeanPropertyFilter filter = findFilter(visitor.getProvider());
        for (int i = 0; i < _props.length; i++) {
            filter.depositSchemaProperty(_props[i], objectVisitor, visitor.getProvider());
        }
    } else {
        for (int i = 0; i < _props.length; i++) {
            _props[i].depositSchemaProperty(objectVisitor);
        }
    }
}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:19,代码来源:BeanSerializerBase.java

示例4: acceptJsonFormatVisitor

import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor; //导入依赖的package包/类
@Override
    public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
        throws JsonMappingException
    {
    	JsonObjectFormatVisitor objectVisitor = visitor.expectObjectFormat(typeHint);
    	/*
        JavaType enumType = typeHint.containedType(0);
    	if (enumType == null) {
    	    enumType = visitor.getProvider().constructType(Object.class);
    	}
    	*/
        JavaType valueType = typeHint.containedType(1);
    	if (valueType == null) {
    	    valueType = visitor.getProvider().constructType(Object.class);
    	}
        JsonSerializer<Object> ser = _valueSerializer;
//        Class<Enum<?>> enumClass = (Class<Enum<?>>) enumType.getRawClass();
        for (Map.Entry<?,SerializedString> entry : _keyEnums.internalMap().entrySet()) {
            String name = entry.getValue().getValue();
            // should all have the same type, so:
            if (ser == null) {
                ser = visitor.getProvider().findValueSerializer(entry.getKey().getClass(), _property);
            }
            objectVisitor.property(name, (JsonFormatVisitable) ser, valueType);
        }
    }
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:27,代码来源:EnumMapSerializer.java

示例5: depositSchemaProperty

import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor; //导入依赖的package包/类
@Override
public void depositSchemaProperty(JsonObjectFormatVisitor objectVisitor)
    throws JsonMappingException
{
    if (objectVisitor != null) {
        if (isRequired()) {
            objectVisitor.property(this); 
        } else {
            objectVisitor.optionalProperty(this);
        }
    }
}
 
开发者ID:yinshipeng,项目名称:sosoapi-base,代码行数:13,代码来源:BeanPropertyWriter.java

示例6: expectObjectFormat

import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor; //导入依赖的package包/类
@Override
public JsonObjectFormatVisitor expectObjectFormat(JavaType type) throws JsonMappingException {
    addFieldIfPresent("Object");
    if (shouldExpand() && (topLevelPath() || !wasVisited(type))) {
        log.trace("({}) {} expanding", path, toString(type));
        return new FieldDocumentationObjectVisitor(provider, context, path,
                withVisitedType(type), typeFactory);
    } else {
        log.trace("({}) {} NOT expanding", path, toString(type));
        return new JsonObjectFormatVisitor.Base();
    }
}
 
开发者ID:ScaCap,项目名称:spring-auto-restdocs,代码行数:13,代码来源:FieldDocumentationVisitorWrapper.java

示例7: depositSchemaProperty

import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor; //导入依赖的package包/类
public void depositSchemaProperty(JsonObjectFormatVisitor paramJsonObjectFormatVisitor)
{
  if (paramJsonObjectFormatVisitor != null)
  {
    if (isRequired())
    {
      paramJsonObjectFormatVisitor.property(this);
      return;
    }
    paramJsonObjectFormatVisitor.optionalProperty(this);
  }
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:13,代码来源:BeanPropertyWriter.java

示例8: depositSchemaProperty

import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor; //导入依赖的package包/类
public void depositSchemaProperty(JsonObjectFormatVisitor paramJsonObjectFormatVisitor)
{
  if (isRequired())
  {
    paramJsonObjectFormatVisitor.property(this);
    return;
  }
  paramJsonObjectFormatVisitor.optionalProperty(this);
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:10,代码来源:SettableBeanProperty.java

示例9: depositSchemaProperty

import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor; //导入依赖的package包/类
@Override
public void depositSchemaProperty(final PropertyWriter writer,
                                  final JsonObjectFormatVisitor objectVisitor,
                                  final SerializerProvider provider) throws JsonMappingException {
    if (include(writer.getName())) {
        writer.depositSchemaProperty(objectVisitor, provider);
    }
}
 
开发者ID:icode,项目名称:ameba,代码行数:9,代码来源:JacksonObjectProvider.java

示例10: depositSchemaProperty

import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor; //导入依赖的package包/类
/**
 * Method called to handle appropriate type-specific visiting
 * over logical property this writer handles.
 * 
 * @param objectVisitor ObjectVisitor which can receive the property
 * 
 * @since 2.1
 */
public void depositSchemaProperty(JsonObjectFormatVisitor objectVisitor)
    throws JsonMappingException
{
    if (isRequired(objectVisitor.getProvider().getAnnotationIntrospector())) {
        objectVisitor.property(this); 
    } else {
        objectVisitor.optionalProperty(this);
    }
}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:18,代码来源:BeanPropertyWriter.java

示例11: depositSchemaProperty

import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor; //导入依赖的package包/类
public void depositSchemaProperty(BeanPropertyWriter writer,
        JsonObjectFormatVisitor objectVisitor, SerializerProvider provider)
    throws JsonMappingException
{
    if (include(writer)) {
        writer.depositSchemaProperty(objectVisitor);
    }
}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:9,代码来源:SimpleBeanPropertyFilter.java

示例12: depositSchemaProperty

import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor; //导入依赖的package包/类
@Override
public void depositSchemaProperty(PropertyWriter writer, JsonObjectFormatVisitor objectVisitor,
    SerializerProvider provider) throws JsonMappingException {
  delegate.depositSchemaProperty(writer, objectVisitor, provider);
}
 
开发者ID:shihyuho,项目名称:jackson-dynamic-filter,代码行数:6,代码来源:DynamicFilterProvider.java

示例13: depositSchemaProperty

import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor; //导入依赖的package包/类
public void depositSchemaProperty(JsonObjectFormatVisitor paramJsonObjectFormatVisitor)
{
  throw new UnsupportedOperationException("Instances of " + getClass().getName() + " should not get visited");
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:5,代码来源:BeanProperty.java

示例14: acceptJsonFormatVisitor

import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor; //导入依赖的package包/类
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper paramJsonFormatVisitorWrapper, JavaType paramJavaType)
{
  if (paramJsonFormatVisitorWrapper == null)
    return;
  JsonObjectFormatVisitor localJsonObjectFormatVisitor = paramJsonFormatVisitorWrapper.expectObjectFormat(paramJavaType);
  if (localJsonObjectFormatVisitor == null)
    return;
  JavaType localJavaType1 = paramJavaType.containedType(1);
  JsonSerializer localJsonSerializer1 = this._valueSerializer;
  JsonSerializer localJsonSerializer2 = localJsonSerializer1;
  if ((localJsonSerializer1 == null) && (localJavaType1 != null))
    localJsonSerializer2 = paramJsonFormatVisitorWrapper.getProvider().findValueSerializer(localJavaType1, this._property);
  if (localJavaType1 == null)
    localJavaType1 = paramJsonFormatVisitorWrapper.getProvider().constructType(Object.class);
  EnumValues localEnumValues1 = this._keyEnums;
  EnumValues localEnumValues2 = localEnumValues1;
  if (localEnumValues1 == null)
  {
    JavaType localJavaType2 = paramJavaType.containedType(0);
    if (localJavaType2 == null)
      throw new IllegalStateException("Can not resolve Enum type of EnumMap: " + paramJavaType);
    JsonSerializer localJsonSerializer3;
    if (localJavaType2 == null)
      localJsonSerializer3 = null;
    else
      localJsonSerializer3 = paramJsonFormatVisitorWrapper.getProvider().findValueSerializer(localJavaType2, this._property);
    JsonSerializer localJsonSerializer4 = localJsonSerializer3;
    if (!(localJsonSerializer3 instanceof EnumSerializer))
      throw new IllegalStateException("Can not resolve Enum type of EnumMap: " + paramJavaType);
    localEnumValues2 = ((EnumSerializer)localJsonSerializer4).getEnumValues();
  }
  Iterator localIterator = localEnumValues2.internalMap().entrySet().iterator();
  while (localIterator.hasNext())
  {
    Map.Entry localEntry = (Map.Entry)localIterator.next();
    String str = ((SerializedString)localEntry.getValue()).getValue();
    if (localJsonSerializer2 == null)
      localJsonSerializer2 = paramJsonFormatVisitorWrapper.getProvider().findValueSerializer(localEntry.getKey().getClass(), this._property);
    localJsonObjectFormatVisitor.property(str, localJsonSerializer2, localJavaType1);
  }
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:42,代码来源:EnumMapSerializer.java

示例15: depositSchemaProperty

import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor; //导入依赖的package包/类
public void depositSchemaProperty(BeanPropertyWriter paramBeanPropertyWriter, JsonObjectFormatVisitor paramJsonObjectFormatVisitor, SerializerProvider paramSerializerProvider)
{
  if (include(paramBeanPropertyWriter))
    paramBeanPropertyWriter.depositSchemaProperty(paramJsonObjectFormatVisitor);
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:6,代码来源:SimpleBeanPropertyFilter.java


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