本文整理汇总了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));
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
}
}
示例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();
}
}
示例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);
}
}
示例8: depositSchemaProperty
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor; //导入依赖的package包/类
public void depositSchemaProperty(JsonObjectFormatVisitor paramJsonObjectFormatVisitor)
{
if (isRequired())
{
paramJsonObjectFormatVisitor.property(this);
return;
}
paramJsonObjectFormatVisitor.optionalProperty(this);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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");
}
示例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);
}
}
示例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);
}