Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

1package com.fasterxml.jackson.databind.ser.std;
2
3import java.io.IOException;
4import java.lang.reflect.InvocationTargetException;
5import java.lang.reflect.Type;
6import java.util.LinkedHashSet;
7import java.util.Set;
8
9import com.fasterxml.jackson.core.*;
10import com.fasterxml.jackson.databind.*;
11import com.fasterxml.jackson.databind.annotation.JacksonStdImpl;
12import com.fasterxml.jackson.databind.introspect.AnnotatedMethod;
13import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable;
14import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper;
15import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonStringFormatVisitor;
16import com.fasterxml.jackson.databind.jsonschema.SchemaAware;
17import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
18import com.fasterxml.jackson.databind.ser.BeanSerializer;
19import com.fasterxml.jackson.databind.ser.ContextualSerializer;
20
21/**
22 * Serializer class that can serialize Object that have a
23 * {@link com.fasterxml.jackson.annotation.JsonValue} annotation to
…lines 24–219 unchanged (196 lines)
220 return;
221 }
222 }
223 // 28-Sep-2016, tatu: As per [databind#1385], we do need to do some juggling
224 // to use different Object for type id (logical type) and actual serialization
225 // (delegat type).
226 ser.serializeWithType(value, gen, provider, typeSer0);
227 } catch (IOException ioe) {
228 throw ioe;
229 } catch (Exception e) {
230 Throwable t = e;
231 // Need to unwrap this specific type, to see infinite recursion...
232 while (t instanceof InvocationTargetException && t.getCause() != null) {
…lines 233–356 unchanged (124 lines)
357
358 /**
359 * Silly little wrapper class we need to re-route type serialization so that we can
360 * override Object to use for type id (logical type) even when asking serialization
361 * of something else (delegate type)
362 */
363
364
365
366
367
368
369
…lines 370–384 unchanged (15 lines)

After

1package com.fasterxml.jackson.databind.ser.std;
2
3import java.io.IOException;
4import java.lang.reflect.InvocationTargetException;
5import java.lang.reflect.Type;
6import java.util.LinkedHashSet;
7import java.util.Set;
8
9import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
10import com.fasterxml.jackson.core.*;
11import com.fasterxml.jackson.databind.*;
12import com.fasterxml.jackson.databind.annotation.JacksonStdImpl;
13import com.fasterxml.jackson.databind.introspect.AnnotatedMethod;
14import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable;
15import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper;
16import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonStringFormatVisitor;
17import com.fasterxml.jackson.databind.jsonschema.SchemaAware;
18import com.fasterxml.jackson.databind.jsontype.TypeIdResolver;
19import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
20import com.fasterxml.jackson.databind.ser.BeanSerializer;
21import com.fasterxml.jackson.databind.ser.ContextualSerializer;
22
23/**
24 * Serializer class that can serialize Object that have a
…lines 25–221 unchanged (197 lines)
222 return;
223 }
224 }
225 // 28-Sep-2016, tatu: As per [databind#1385], we do need to do some juggling
226 // to use different Object for type id (logical type) and actual serialization
227 // (delegat type).
228 TypeSerializerRerouter rr = new TypeSerializerRerouter(typeSer0, bean);
229 ser.serializeWithType(value, gen, provider, rr);
230 } catch (IOException ioe) {
231 throw ioe;
232 } catch (Exception e) {
233 Throwable t = e;
234 // Need to unwrap this specific type, to see infinite recursion...
235 while (t instanceof InvocationTargetException && t.getCause() != null) {
…lines 236–359 unchanged (124 lines)
360
361 /**
362 * Silly little wrapper class we need to re-route type serialization so that we can
363 * override Object to use for type id (logical type) even when asking serialization
364 * of something else (delegate type)
365 */
366 static class TypeSerializerRerouter
367 extends TypeSerializer
368 {
369 protected final TypeSerializer _typeSerializer;
370 protected final Object _forObject;
371
372 public TypeSerializerRerouter(TypeSerializer ts, Object ob) {
373 _typeSerializer = ts;
374 _forObject = ob;
375 }
376
377 @Override
378 public TypeSerializer forProperty(BeanProperty prop) { // should never get called
379 throw new UnsupportedOperationException();
380 }
381
382 @Override
383 public As getTypeInclusion() {
384 return _typeSerializer.getTypeInclusion();
385 }
386
387 @Override
388 public String getPropertyName() {
389 return _typeSerializer.getPropertyName();
390 }
391
392 @Override
393 public TypeIdResolver getTypeIdResolver() {
394 return _typeSerializer.getTypeIdResolver();
395 }
396
397 @Override
398 public void writeTypePrefixForScalar(Object value, JsonGenerator gen) throws IOException {
399 _typeSerializer.writeTypePrefixForScalar(_forObject, gen);
400 }
401
402 @Override
403 public void writeTypePrefixForObject(Object value, JsonGenerator gen) throws IOException {
404 _typeSerializer.writeTypePrefixForObject(_forObject, gen);
405 }
406
407 @Override
408 public void writeTypePrefixForArray(Object value, JsonGenerator gen) throws IOException {
409 _typeSerializer.writeTypePrefixForArray(_forObject, gen);
410 }
411
412 @Override
413 public void writeTypeSuffixForScalar(Object value, JsonGenerator gen) throws IOException {
414 _typeSerializer.writeTypeSuffixForScalar(_forObject, gen);
415 }
416
417 @Override
418 public void writeTypeSuffixForObject(Object value, JsonGenerator gen) throws IOException {
419 _typeSerializer.writeTypeSuffixForObject(_forObject, gen);
420 }
421
422 @Override
423 public void writeTypeSuffixForArray(Object value, JsonGenerator gen) throws IOException {
424 _typeSerializer.writeTypeSuffixForArray(_forObject, gen);
425 }
426
427 public void writeTypePrefixForScalar(Object value, JsonGenerator gen, Class<?> type) throws IOException {
428 _typeSerializer.writeTypePrefixForScalar(_forObject, gen, type);
429 }
430
431 public void writeTypePrefixForObject(Object value, JsonGenerator gen, Class<?> type) throws IOException {
432 _typeSerializer.writeTypePrefixForObject(_forObject, gen, type);
433 }
434
435 public void writeTypePrefixForArray(Object value, JsonGenerator gen, Class<?> type) throws IOException {
436 _typeSerializer.writeTypePrefixForArray(_forObject, gen, type);
437 }
438
439 @Override
440 public void writeCustomTypePrefixForScalar(Object value, JsonGenerator gen, String typeId)
441 throws IOException {
442 _typeSerializer.writeCustomTypePrefixForScalar(_forObject, gen, typeId);
443 }
444
445 @Override
446 public void writeCustomTypePrefixForObject(Object value, JsonGenerator gen, String typeId) throws IOException {
447 _typeSerializer.writeCustomTypePrefixForObject(_forObject, gen, typeId);
448 }
449
450 @Override
451 public void writeCustomTypePrefixForArray(Object value, JsonGenerator gen, String typeId) throws IOException {
452 _typeSerializer.writeCustomTypePrefixForArray(_forObject, gen, typeId);
453 }
454
455 @Override
456 public void writeCustomTypeSuffixForScalar(Object value, JsonGenerator gen, String typeId) throws IOException {
457 _typeSerializer.writeCustomTypeSuffixForScalar(_forObject, gen, typeId);
458 }
459
460 @Override
461 public void writeCustomTypeSuffixForObject(Object value, JsonGenerator gen, String typeId) throws IOException {
462 _typeSerializer.writeCustomTypeSuffixForObject(_forObject, gen, typeId);
463 }
464
465 @Override
466 public void writeCustomTypeSuffixForArray(Object value, JsonGenerator gen, String typeId) throws IOException {
467 _typeSerializer.writeCustomTypeSuffixForArray(_forObject, gen, typeId);
468 }
469 }
470}
471

Before

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "ser"
. "."
identifier "std"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "IOException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "lang"
. "."
identifier "reflect"
. "."
identifier "InvocationTargetException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "lang"
. "."
identifier "reflect"
. "."
identifier "Type"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "LinkedHashSet"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Set"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "core"
. "."
asterisk
* "*"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
asterisk
* "*"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "annotation"
. "."
identifier "JacksonStdImpl"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "introspect"
. "."
identifier "AnnotatedMethod"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "jsonFormatVisitors"
. "."
identifier "JsonFormatVisitable"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "jsonFormatVisitors"
. "."
identifier "JsonFormatVisitorWrapper"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "jsonFormatVisitors"
. "."
identifier "JsonStringFormatVisitor"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "jsonschema"
. "."
identifier "SchemaAware"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "jsontype"
. "."
identifier "TypeSerializer"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "ser"
. "."
identifier "BeanSerializer"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "ser"
. "."
identifier "ContextualSerializer"
; ";"
block_comment "/**\n * Serializer class that can serialize Object that have "...
class_declaration
modifiers
annotation
@ "@"
identifier "SuppressWarnings"
annotation_argument_list
( "("
string_literal
" "\""
string_fragment "serial"
" "\""
) ")"
marker_annotation
@ "@"
identifier "JacksonStdImpl"
public "public"
class "class"
identifier "JsonValueSerializer"
superclass
extends "extends"
generic_type
type_identifier "StdSerializer"
type_arguments
< "<"
type_identifier "Object"
> ">"
super_interfaces
implements "implements"
type_list
type_identifier "ContextualSerializer"
, ","
type_identifier "JsonFormatVisitable"
, ","
type_identifier "SchemaAware"
class_body
{ "{"
block_comment "/**\n * @since 2.8 (was \"plain\" method before)\n */"
field_declaration
modifiers
protected "protected"
final "final"
type_identifier "AnnotatedMethod"
variable_declarator
identifier "_accessorMethod"
; ";"
field_declaration
modifiers
protected "protected"
final "final"
generic_type
type_identifier "JsonSerializer"
type_arguments
< "<"
type_identifier "Object"
> ">"
variable_declarator
identifier "_valueSerializer"
; ";"
field_declaration
modifiers
protected "protected"
final "final"
type_identifier "BeanProperty"
variable_declarator
identifier "_property"
; ";"
block_comment "/**\n * This is a flag that is set in rare (?) cases wher"...
field_declaration
modifiers
protected "protected"
final "final"
boolean_type "boolean"
variable_declarator
identifier "_forceTypeInformation"
; ";"
block_comment "/*\n /****************************************************"...
block_comment "/**\n * @param ser Explicit serializer to use, if caller "...
constructor_declaration (+80 nodes collapsed)
constructor_declaration (+95 nodes collapsed)
method_declaration (+64 nodes collapsed)
method_declaration (+72 nodes collapsed)
block_comment "/*\n /****************************************************"...
block_comment "/**\n * We can try to find the actual serializer for valu"...
method_declaration (+187 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration (+267 nodes collapsed)
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
void_type "void"
identifier "serializeWithType"
formal_parameters
( "("
formal_parameter
type_identifier "Object"
identifier "bean"
, ","
formal_parameter
type_identifier "JsonGenerator"
identifier "gen"
, ","
formal_parameter
type_identifier "SerializerProvider"
identifier "provider"
, ","
formal_parameter
type_identifier "TypeSerializer"
identifier "typeSer0"
) ")"
throws
throws "throws"
type_identifier "IOException"
block
{ "{"
line_comment "// Regardless of other parts, first need to find value to se"...
local_variable_declaration
type_identifier "Object"
variable_declarator
identifier "value"
= "="
null_literal "null"
; ";"
try_statement
try "try"
block
{ "{"
expression_statement
assignment_expression
identifier "value"
= "="
method_invocation
identifier "_accessorMethod"
. "."
identifier "getValue"
argument_list
( "("
identifier "bean"
) ")"
; ";"
line_comment "// and if we got null, can also just write it directly"
if_statement (+25 nodes collapsed)
local_variable_declaration
generic_type
type_identifier "JsonSerializer"
type_arguments
< "<"
type_identifier "Object"
> ">"
variable_declarator
identifier "ser"
= "="
identifier "_valueSerializer"
; ";"
if_statement (+90 nodes collapsed)
line_comment "// 28-Sep-2016, tatu: As per [databind#1385], we do need to "...
line_comment "// to use different Object for type id (logical type) and"...
line_comment "// (delegat type)."
expression_statement
method_invocation
identifier "ser"
. "."
identifier "serializeWithType"
argument_list
( "("
identifier "value"
, ","
identifier "gen"
, ","
identifier "provider"
, ","
identifier "typeSer0"
) ")"
; ";"
} "}"
catch_clause
catch "catch"
( "("
catch_formal_parameter
catch_type
type_identifier "IOException"
identifier "ioe"
) ")"
block
{ "{"
throw_statement
throw "throw"
identifier "ioe"
; ";"
} "}"
catch_clause (+104 nodes collapsed)
} "}"
method_declaration (+91 nodes collapsed)
method_declaration (+189 nodes collapsed)
block_comment "/**\n * Overridable helper method used for special case h"...
method_declaration (+244 nodes collapsed)
method_declaration (+142 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration (+51 nodes collapsed)
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Silly little wrapper class we need to re-route ty"...
} "}"

After

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "ser"
. "."
identifier "std"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "IOException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "lang"
. "."
identifier "reflect"
. "."
identifier "InvocationTargetException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "lang"
. "."
identifier "reflect"
. "."
identifier "Type"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "LinkedHashSet"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Set"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "annotation"
. "."
identifier "JsonTypeInfo"
. "."
identifier "As"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "core"
. "."
asterisk
* "*"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
asterisk
* "*"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "annotation"
. "."
identifier "JacksonStdImpl"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "introspect"
. "."
identifier "AnnotatedMethod"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "jsonFormatVisitors"
. "."
identifier "JsonFormatVisitable"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "jsonFormatVisitors"
. "."
identifier "JsonFormatVisitorWrapper"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "jsonFormatVisitors"
. "."
identifier "JsonStringFormatVisitor"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "jsonschema"
. "."
identifier "SchemaAware"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "jsontype"
. "."
identifier "TypeIdResolver"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "jsontype"
. "."
identifier "TypeSerializer"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "ser"
. "."
identifier "BeanSerializer"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "fasterxml"
. "."
identifier "jackson"
. "."
identifier "databind"
. "."
identifier "ser"
. "."
identifier "ContextualSerializer"
; ";"
block_comment "/**\n * Serializer class that can serialize Object that have "...
class_declaration
modifiers
annotation
@ "@"
identifier "SuppressWarnings"
annotation_argument_list
( "("
string_literal
" "\""
string_fragment "serial"
" "\""
) ")"
marker_annotation
@ "@"
identifier "JacksonStdImpl"
public "public"
class "class"
identifier "JsonValueSerializer"
superclass
extends "extends"
generic_type
type_identifier "StdSerializer"
type_arguments
< "<"
type_identifier "Object"
> ">"
super_interfaces
implements "implements"
type_list
type_identifier "ContextualSerializer"
, ","
type_identifier "JsonFormatVisitable"
, ","
type_identifier "SchemaAware"
class_body
{ "{"
block_comment "/**\n * @since 2.8 (was \"plain\" method before)\n */"
field_declaration
modifiers
protected "protected"
final "final"
type_identifier "AnnotatedMethod"
variable_declarator
identifier "_accessorMethod"
; ";"
field_declaration
modifiers
protected "protected"
final "final"
generic_type
type_identifier "JsonSerializer"
type_arguments
< "<"
type_identifier "Object"
> ">"
variable_declarator
identifier "_valueSerializer"
; ";"
field_declaration
modifiers
protected "protected"
final "final"
type_identifier "BeanProperty"
variable_declarator
identifier "_property"
; ";"
block_comment "/**\n * This is a flag that is set in rare (?) cases wher"...
field_declaration
modifiers
protected "protected"
final "final"
boolean_type "boolean"
variable_declarator
identifier "_forceTypeInformation"
; ";"
block_comment "/*\n /****************************************************"...
block_comment "/**\n * @param ser Explicit serializer to use, if caller "...
constructor_declaration (+80 nodes collapsed)
constructor_declaration (+95 nodes collapsed)
method_declaration (+64 nodes collapsed)
method_declaration (+72 nodes collapsed)
block_comment "/*\n /****************************************************"...
block_comment "/**\n * We can try to find the actual serializer for valu"...
method_declaration (+187 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration (+267 nodes collapsed)
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
void_type "void"
identifier "serializeWithType"
formal_parameters
( "("
formal_parameter
type_identifier "Object"
identifier "bean"
, ","
formal_parameter
type_identifier "JsonGenerator"
identifier "gen"
, ","
formal_parameter
type_identifier "SerializerProvider"
identifier "provider"
, ","
formal_parameter
type_identifier "TypeSerializer"
identifier "typeSer0"
) ")"
throws
throws "throws"
type_identifier "IOException"
block
{ "{"
line_comment "// Regardless of other parts, first need to find value to se"...
local_variable_declaration
type_identifier "Object"
variable_declarator
identifier "value"
= "="
null_literal "null"
; ";"
try_statement
try "try"
block
{ "{"
expression_statement
assignment_expression
identifier "value"
= "="
method_invocation
identifier "_accessorMethod"
. "."
identifier "getValue"
argument_list
( "("
identifier "bean"
) ")"
; ";"
line_comment "// and if we got null, can also just write it directly"
if_statement (+25 nodes collapsed)
local_variable_declaration
generic_type
type_identifier "JsonSerializer"
type_arguments
< "<"
type_identifier "Object"
> ">"
variable_declarator
identifier "ser"
= "="
identifier "_valueSerializer"
; ";"
if_statement (+90 nodes collapsed)
line_comment "// 28-Sep-2016, tatu: As per [databind#1385], we do need to "...
line_comment "// to use different Object for type id (logical type) and"...
line_comment "// (delegat type)."
local_variable_declaration
type_identifier "TypeSerializerRerouter"
variable_declarator
identifier "rr"
= "="
object_creation_expression
new "new"
type_identifier "TypeSerializerRerouter"
argument_list
( "("
identifier "typeSer0"
, ","
identifier "bean"
) ")"
; ";"
expression_statement
method_invocation
identifier "ser"
. "."
identifier "serializeWithType"
argument_list
( "("
identifier "value"
, ","
identifier "gen"
, ","
identifier "provider"
, ","
identifier "rr"
) ")"
; ";"
} "}"
catch_clause
catch "catch"
( "("
catch_formal_parameter
catch_type
type_identifier "IOException"
identifier "ioe"
) ")"
block
{ "{"
throw_statement
throw "throw"
identifier "ioe"
; ";"
} "}"
catch_clause (+104 nodes collapsed)
} "}"
method_declaration (+91 nodes collapsed)
method_declaration (+189 nodes collapsed)
block_comment "/**\n * Overridable helper method used for special case h"...
method_declaration (+244 nodes collapsed)
method_declaration (+142 nodes collapsed)
block_comment "/*\n /****************************************************"...
method_declaration (+51 nodes collapsed)
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Silly little wrapper class we need to re-route ty"...
class_declaration
modifiers
static "static"
class "class"
identifier "TypeSerializerRerouter"
superclass
extends "extends"
type_identifier "TypeSerializer"
class_body
{ "{"
field_declaration
modifiers
protected "protected"
final "final"
type_identifier "TypeSerializer"
variable_declarator
identifier "_typeSerializer"
; ";"
field_declaration
modifiers
protected "protected"
final "final"
type_identifier "Object"
variable_declarator
identifier "_forObject"
; ";"
constructor_declaration
modifiers
public "public"
identifier "TypeSerializerRerouter"
formal_parameters
( "("
formal_parameter
type_identifier "TypeSerializer"
identifier "ts"
, ","
formal_parameter
type_identifier "Object"
identifier "ob"
) ")"
constructor_body
{ "{"
expression_statement
assignment_expression
identifier "_typeSerializer"
= "="
identifier "ts"
; ";"
expression_statement
assignment_expression
identifier "_forObject"
= "="
identifier "ob"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
type_identifier "TypeSerializer"
identifier "forProperty"
formal_parameters
( "("
formal_parameter
type_identifier "BeanProperty"
identifier "prop"
) ")"
block
{ "{"
line_comment "// should never get called"
throw_statement
throw "throw"
object_creation_expression
new "new"
type_identifier "UnsupportedOperationException"
argument_list
( "("
) ")"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
type_identifier "As"
identifier "getTypeInclusion"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
method_invocation
identifier "_typeSerializer"
. "."
identifier "getTypeInclusion"
argument_list
( "("
) ")"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
type_identifier "String"
identifier "getPropertyName"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
method_invocation
identifier "_typeSerializer"
. "."
identifier "getPropertyName"
argument_list
( "("
) ")"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
type_identifier "TypeIdResolver"
identifier "getTypeIdResolver"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
method_invocation
identifier "_typeSerializer"
. "."
identifier "getTypeIdResolver"
argument_list
( "("
) ")"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
void_type "void"
identifier "writeTypePrefixForScalar"
formal_parameters
( "("
formal_parameter
type_identifier "Object"
identifier "value"
, ","
formal_parameter
type_identifier "JsonGenerator"
identifier "gen"
) ")"
throws
throws "throws"
type_identifier "IOException"
block
{ "{"
expression_statement
method_invocation
identifier "_typeSerializer"
. "."
identifier "writeTypePrefixForScalar"
argument_list
( "("
identifier "_forObject"
, ","
identifier "gen"
) ")"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
void_type "void"
identifier "writeTypePrefixForObject"
formal_parameters
( "("
formal_parameter
type_identifier "Object"
identifier "value"
, ","
formal_parameter
type_identifier "JsonGenerator"
identifier "gen"
) ")"
throws
throws "throws"
type_identifier "IOException"
block
{ "{"
expression_statement
method_invocation
identifier "_typeSerializer"
. "."
identifier "writeTypePrefixForObject"
argument_list
( "("
identifier "_forObject"
, ","
identifier "gen"
) ")"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
void_type "void"
identifier "writeTypePrefixForArray"
formal_parameters
( "("
formal_parameter
type_identifier "Object"
identifier "value"
, ","
formal_parameter
type_identifier "JsonGenerator"
identifier "gen"
) ")"
throws
throws "throws"
type_identifier "IOException"
block
{ "{"
expression_statement
method_invocation
identifier "_typeSerializer"
. "."
identifier "writeTypePrefixForArray"
argument_list
( "("
identifier "_forObject"
, ","
identifier "gen"
) ")"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
void_type "void"
identifier "writeTypeSuffixForScalar"
formal_parameters
( "("
formal_parameter
type_identifier "Object"
identifier "value"
, ","
formal_parameter
type_identifier "JsonGenerator"
identifier "gen"
) ")"
throws
throws "throws"
type_identifier "IOException"
block
{ "{"
expression_statement
method_invocation
identifier "_typeSerializer"
. "."
identifier "writeTypeSuffixForScalar"
argument_list
( "("
identifier "_forObject"
, ","
identifier "gen"
) ")"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
void_type "void"
identifier "writeTypeSuffixForObject"
formal_parameters
( "("
formal_parameter
type_identifier "Object"
identifier "value"
, ","
formal_parameter
type_identifier "JsonGenerator"
identifier "gen"
) ")"
throws
throws "throws"
type_identifier "IOException"
block
{ "{"
expression_statement
method_invocation
identifier "_typeSerializer"
. "."
identifier "writeTypeSuffixForObject"
argument_list
( "("
identifier "_forObject"
, ","
identifier "gen"
) ")"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
void_type "void"
identifier "writeTypeSuffixForArray"
formal_parameters
( "("
formal_parameter
type_identifier "Object"
identifier "value"
, ","
formal_parameter
type_identifier "JsonGenerator"
identifier "gen"
) ")"
throws
throws "throws"
type_identifier "IOException"
block
{ "{"
expression_statement
method_invocation
identifier "_typeSerializer"
. "."
identifier "writeTypeSuffixForArray"
argument_list
( "("
identifier "_forObject"
, ","
identifier "gen"
) ")"
; ";"
} "}"
method_declaration
modifiers
public "public"
void_type "void"
identifier "writeTypePrefixForScalar"
formal_parameters
( "("
formal_parameter
type_identifier "Object"
identifier "value"
, ","
formal_parameter
type_identifier "JsonGenerator"
identifier "gen"
, ","
formal_parameter
generic_type
type_identifier "Class"
type_arguments
< "<"
wildcard
? "?"
> ">"
identifier "type"
) ")"
throws
throws "throws"
type_identifier "IOException"
block
{ "{"
expression_statement
method_invocation
identifier "_typeSerializer"
. "."
identifier "writeTypePrefixForScalar"
argument_list
( "("
identifier "_forObject"
, ","
identifier "gen"
, ","
identifier "type"
) ")"
; ";"
} "}"
method_declaration
modifiers
public "public"
void_type "void"
identifier "writeTypePrefixForObject"
formal_parameters
( "("
formal_parameter
type_identifier "Object"
identifier "value"
, ","
formal_parameter
type_identifier "JsonGenerator"
identifier "gen"
, ","
formal_parameter
generic_type
type_identifier "Class"
type_arguments
< "<"
wildcard
? "?"
> ">"
identifier "type"
) ")"
throws
throws "throws"
type_identifier "IOException"
block
{ "{"
expression_statement
method_invocation
identifier "_typeSerializer"
. "."
identifier "writeTypePrefixForObject"
argument_list
( "("
identifier "_forObject"
, ","
identifier "gen"
, ","
identifier "type"
) ")"
; ";"
} "}"
method_declaration
modifiers
public "public"
void_type "void"
identifier "writeTypePrefixForArray"
formal_parameters
( "("
formal_parameter
type_identifier "Object"
identifier "value"
, ","
formal_parameter
type_identifier "JsonGenerator"
identifier "gen"
, ","
formal_parameter
generic_type
type_identifier "Class"
type_arguments
< "<"
wildcard
? "?"
> ">"
identifier "type"
) ")"
throws
throws "throws"
type_identifier "IOException"
block
{ "{"
expression_statement
method_invocation
identifier "_typeSerializer"
. "."
identifier "writeTypePrefixForArray"
argument_list
( "("
identifier "_forObject"
, ","
identifier "gen"
, ","
identifier "type"
) ")"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
void_type "void"
identifier "writeCustomTypePrefixForScalar"
formal_parameters
( "("
formal_parameter
type_identifier "Object"
identifier "value"
, ","
formal_parameter
type_identifier "JsonGenerator"
identifier "gen"
, ","
formal_parameter
type_identifier "String"
identifier "typeId"
) ")"
throws
throws "throws"
type_identifier "IOException"
block
{ "{"
expression_statement
method_invocation
identifier "_typeSerializer"
. "."
identifier "writeCustomTypePrefixForScalar"
argument_list
( "("
identifier "_forObject"
, ","
identifier "gen"
, ","
identifier "typeId"
) ")"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
void_type "void"
identifier "writeCustomTypePrefixForObject"
formal_parameters
( "("
formal_parameter
type_identifier "Object"
identifier "value"
, ","
formal_parameter
type_identifier "JsonGenerator"
identifier "gen"
, ","
formal_parameter
type_identifier "String"
identifier "typeId"
) ")"
throws
throws "throws"
type_identifier "IOException"
block
{ "{"
expression_statement
method_invocation
identifier "_typeSerializer"
. "."
identifier "writeCustomTypePrefixForObject"
argument_list
( "("
identifier "_forObject"
, ","
identifier "gen"
, ","
identifier "typeId"
) ")"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
void_type "void"
identifier "writeCustomTypePrefixForArray"
formal_parameters
( "("
formal_parameter
type_identifier "Object"
identifier "value"
, ","
formal_parameter
type_identifier "JsonGenerator"
identifier "gen"
, ","
formal_parameter
type_identifier "String"
identifier "typeId"
) ")"
throws
throws "throws"
type_identifier "IOException"
block
{ "{"
expression_statement
method_invocation
identifier "_typeSerializer"
. "."
identifier "writeCustomTypePrefixForArray"
argument_list
( "("
identifier "_forObject"
, ","
identifier "gen"
, ","
identifier "typeId"
) ")"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
void_type "void"
identifier "writeCustomTypeSuffixForScalar"
formal_parameters
( "("
formal_parameter
type_identifier "Object"
identifier "value"
, ","
formal_parameter
type_identifier "JsonGenerator"
identifier "gen"
, ","
formal_parameter
type_identifier "String"
identifier "typeId"
) ")"
throws
throws "throws"
type_identifier "IOException"
block
{ "{"
expression_statement
method_invocation
identifier "_typeSerializer"
. "."
identifier "writeCustomTypeSuffixForScalar"
argument_list
( "("
identifier "_forObject"
, ","
identifier "gen"
, ","
identifier "typeId"
) ")"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
void_type "void"
identifier "writeCustomTypeSuffixForObject"
formal_parameters
( "("
formal_parameter
type_identifier "Object"
identifier "value"
, ","
formal_parameter
type_identifier "JsonGenerator"
identifier "gen"
, ","
formal_parameter
type_identifier "String"
identifier "typeId"
) ")"
throws
throws "throws"
type_identifier "IOException"
block
{ "{"
expression_statement
method_invocation
identifier "_typeSerializer"
. "."
identifier "writeCustomTypeSuffixForObject"
argument_list
( "("
identifier "_forObject"
, ","
identifier "gen"
, ","
identifier "typeId"
) ")"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
void_type "void"
identifier "writeCustomTypeSuffixForArray"
formal_parameters
( "("
formal_parameter
type_identifier "Object"
identifier "value"
, ","
formal_parameter
type_identifier "JsonGenerator"
identifier "gen"
, ","
formal_parameter
type_identifier "String"
identifier "typeId"
) ")"
throws
throws "throws"
type_identifier "IOException"
block
{ "{"
expression_statement
method_invocation
identifier "_typeSerializer"
. "."
identifier "writeCustomTypeSuffixForArray"
argument_list
( "("
identifier "_forObject"
, ","
identifier "gen"
, ","
identifier "typeId"
) ")"
; ";"
} "}"
} "}"
} "}"