Class JsonIdentityReferenceDefinitionProvider

    • Constructor Detail

      • JsonIdentityReferenceDefinitionProvider

        public JsonIdentityReferenceDefinitionProvider()
    • Method Detail

      • provideCustomPropertySchemaDefinition

        public CustomPropertyDefinition provideCustomPropertySchemaDefinition​(MemberScope<?,​?> scope,
                                                                              SchemaGenerationContext context)
        Implementation of the CustomPropertyDefinitionProvider interface that can be used for both fields and methods.
        Parameters:
        scope - field/method on which to check for the @JsonIdentityReference annotation
        context - generation context enabling the standard schema generation for the identity property's value type
        Returns:
        created custom definition (may be null)
      • getIdentityReferenceType

        public Optional<com.fasterxml.classmate.ResolvedType> getIdentityReferenceType​(com.fasterxml.classmate.ResolvedType javaType,
                                                                                       TypeContext typeContext)
        If applicable, determine the type of the identity reference that should replace the given actual type, if the @JsonIdentityReference(alwaysAsId = true) annotation is present as well as a corresponding @JsonIdentityInfo annotation on the type itself.
        Parameters:
        javaType - reference type that may be replaced by a reference to its identity property
        typeContext - type context providing convenience methods, e.g., for the annotation or member look-up
        Returns:
        designated type of the applicable identity reference (may be empty)
      • getIdentityReferenceType

        public Optional<com.fasterxml.classmate.ResolvedType> getIdentityReferenceType​(MemberScope<?,​?> scope)
        If applicable, determine the type of the identity reference that should replace the given field/method's type, if the @JsonIdentityReference(alwaysAsId = true) annotation is present as well as a corresponding @JsonIdentityInfo annotation on the type itself.
        Parameters:
        scope - field/method that may be replaced by a reference to its identity property
        Returns:
        designated type of the applicable identity reference (may be empty)