Package com.fasterxml.jackson.databind.jsonFormatVisitors

Examples of com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor


    @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());
View Full Code Here


     */
    @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);
        }
    }
View Full Code Here

     */
    @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);
        }
    }
View Full Code Here

TOP

Related Classes of com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.