@@ -9,6 +9,9 @@ import semmle.code.java.Reflection
99import semmle.code.java.dataflow.DataFlow
1010import semmle.code.java.dataflow.DataFlow5
1111
12+ /**
13+ * A `@com.fasterxml.jackson.annotation.JsonIgnore` annoation.
14+ */
1215class JacksonJSONIgnoreAnnotation extends NonReflectiveAnnotation {
1316 JacksonJSONIgnoreAnnotation ( ) {
1417 exists ( AnnotationType anntp | anntp = this .getType ( ) |
@@ -17,6 +20,7 @@ class JacksonJSONIgnoreAnnotation extends NonReflectiveAnnotation {
1720 }
1821}
1922
23+ /** A type whose values may be serialized using the Jackson JSON framework. */
2024abstract class JacksonSerializableType extends Type { }
2125
2226/**
@@ -34,6 +38,7 @@ library class JacksonWriteValueMethod extends Method {
3438 }
3539}
3640
41+ /** A type whose values are explicitly serialized in a call to a Jackson method. */
3742library class ExplicitlyWrittenJacksonSerializableType extends JacksonSerializableType {
3843 ExplicitlyWrittenJacksonSerializableType ( ) {
3944 exists ( MethodAccess ma |
@@ -45,12 +50,14 @@ library class ExplicitlyWrittenJacksonSerializableType extends JacksonSerializab
4550 }
4651}
4752
53+ /** A type used in a `JacksonSerializableField` declaration. */
4854library class FieldReferencedJacksonSerializableType extends JacksonSerializableType {
4955 FieldReferencedJacksonSerializableType ( ) {
5056 exists ( JacksonSerializableField f | usesType ( f .getType ( ) , this ) )
5157 }
5258}
5359
60+ /** A type whose values may be deserialized by the Jackson JSON framework. */
5461abstract class JacksonDeserializableType extends Type { }
5562
5663private class TypeLiteralToJacksonDatabindFlowConfiguration extends DataFlow5:: Configuration {
@@ -76,6 +83,7 @@ private class TypeLiteralToJacksonDatabindFlowConfiguration extends DataFlow5::C
7683 TypeLiteral getSourceWithFlowToJacksonDatabind ( ) { hasFlow ( DataFlow:: exprNode ( result ) , _) }
7784}
7885
86+ /** A type whose values are explicitly deserialized in a call to a Jackson method. */
7987library class ExplicitlyReadJacksonDeserializableType extends JacksonDeserializableType {
8088 ExplicitlyReadJacksonDeserializableType ( ) {
8189 exists ( TypeLiteralToJacksonDatabindFlowConfiguration conf |
@@ -84,12 +92,14 @@ library class ExplicitlyReadJacksonDeserializableType extends JacksonDeserializa
8492 }
8593}
8694
95+ /** A type used in a `JacksonDeserializableField` declaration. */
8796library class FieldReferencedJacksonDeSerializableType extends JacksonDeserializableType {
8897 FieldReferencedJacksonDeSerializableType ( ) {
8998 exists ( JacksonDeserializableField f | usesType ( f .getType ( ) , this ) )
9099 }
91100}
92101
102+ /** A field that may be serialized using the Jackson JSON framework. */
93103class JacksonSerializableField extends SerializableField {
94104 JacksonSerializableField ( ) {
95105 exists ( JacksonSerializableType superType |
@@ -101,6 +111,7 @@ class JacksonSerializableField extends SerializableField {
101111 }
102112}
103113
114+ /** A field that may be deserialized using the Jackson JSON framework. */
104115class JacksonDeserializableField extends DeserializableField {
105116 JacksonDeserializableField ( ) {
106117 exists ( JacksonDeserializableType superType |
@@ -183,6 +194,7 @@ class JacksonMixinType extends ClassOrInterface {
183194 }
184195}
185196
197+ /** A callable used as a Jackson mixin callable. */
186198class JacksonMixedInCallable extends Callable {
187199 JacksonMixedInCallable ( ) {
188200 exists ( JacksonMixinType mixinType | this = mixinType .getAMixedInCallable ( ) )
0 commit comments