congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ContextualSerializer
Code IndexAdd Tabnine to your IDE (free)

How to use
ContextualSerializer
in
com.fasterxml.jackson.databind.ser

Best Java code snippets using com.fasterxml.jackson.databind.ser.ContextualSerializer (Showing top 20 results out of 315)

origin: redisson/redisson

/**
 * Method called for primary property serializers (ones
 * directly created to serialize values of a POJO property),
 * to handle details of resolving
 * {@link ContextualSerializer} with given property context.
 * 
 * @param property Property for which the given primary serializer is used; never null.
 * 
 * @since 2.3
 */
public JsonSerializer<?> handlePrimaryContextualization(JsonSerializer<?> ser,
    BeanProperty property)
  throws JsonMappingException
{
  if (ser != null) {
    if (ser instanceof ContextualSerializer) {
      ser = ((ContextualSerializer) ser).createContextual(this, property);
    }
  }
  return ser;
}
origin: redisson/redisson

/**
 * Method called for secondary property serializers (ones
 * NOT directly created to serialize values of a POJO property
 * but instead created as a dependant serializer -- such as value serializers
 * for structured types, or serializers for root values)
 * to handle details of resolving
 * {@link ContextualDeserializer} with given property context.
 * Given that these serializers are not directly related to given property
 * (or, in case of root value property, to any property), annotations
 * accessible may or may not be relevant.
 * 
 * @param property Property for which serializer is used, if any; null
 *    when deserializing root values
 * 
 * @since 2.3
 */
public JsonSerializer<?> handleSecondaryContextualization(JsonSerializer<?> ser,
    BeanProperty property)
  throws JsonMappingException
{
  if (ser != null) {
    if (ser instanceof ContextualSerializer) {
      ser = ((ContextualSerializer) ser).createContextual(this, property);
    }
  }
  return ser;
}

origin: com.fasterxml.jackson.datatype/jackson-datatype-guava

valueSer = ((ContextualSerializer) valueSer).createContextual(provider, property);
rowKeySer = ((ContextualSerializer) rowKeySer).createContextual(provider, property);
columnKeySer = ((ContextualSerializer) columnKeySer).createContextual(provider, property);
origin: com.fasterxml.jackson.datatype/jackson-datatype-guava

@Override
public JsonSerializer<?> createContextual(SerializerProvider prov,
    BeanProperty property) throws JsonMappingException
{
  if (_endpointSerializer == null) {
    JavaType endpointType = _rangeType.containedTypeOrUnknown(0);
    // let's not consider "untyped" (java.lang.Object) to be meaningful here...
    if (endpointType != null && !endpointType.hasRawClass(Object.class)) {
      JsonSerializer<?> ser = prov.findValueSerializer(endpointType, property);
      return new RangeSerializer(_rangeType, ser);
    }
    /* 21-Sep-2014, tatu: Need to make sure all serializers get proper contextual
     *   access, in case they rely on annotations on properties... (or, more generally,
     *   in getting a chance to be contextualized)
     */
  } else if (_endpointSerializer instanceof ContextualSerializer) {
    JsonSerializer<?> cs = ((ContextualSerializer)_endpointSerializer).createContextual(prov, property);
    if (cs != _endpointSerializer) {
      return new RangeSerializer(_rangeType, cs);
    }
  }
  return this;
}
origin: com.fasterxml.jackson.core/com.springsource.com.fasterxml.jackson.core.jackson-databind

@SuppressWarnings("unchecked")
protected JsonSerializer<Object> _handleContextual(JsonSerializer<?> ser,
    BeanProperty property)
  throws JsonMappingException
{
  if (ser instanceof ContextualSerializer) {
    ser = ((ContextualSerializer) ser).createContextual(this, property);
  }
  return (JsonSerializer<Object>) ser;
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

@SuppressWarnings("unchecked")
protected JsonSerializer<Object> _handleContextual(JsonSerializer<?> ser,
    BeanProperty property)
  throws JsonMappingException
{
  if (ser instanceof ContextualSerializer) {
    ser = ((ContextualSerializer) ser).createContextual(this, property);
  }
  return (JsonSerializer<Object>) ser;
}
origin: com.eclipsesource.jaxrs/jersey-all

/**
 * Method called for primary property serializers (ones
 * directly created to serialize values of a POJO property),
 * to handle details of resolving
 * {@link ContextualSerializer} with given property context.
 * 
 * @param property Property for which the given primary serializer is used; never null.
 * 
 * @since 2.3
 */
public JsonSerializer<?> handlePrimaryContextualization(JsonSerializer<?> ser,
    BeanProperty property)
  throws JsonMappingException
{
  if (ser != null) {
    if (ser instanceof ContextualSerializer) {
      ser = ((ContextualSerializer) ser).createContextual(this, property);
    }
  }
  return ser;
}
origin: com.jwebmp.jackson.core/jackson-databind

/**
 * Method called for primary property serializers (ones
 * directly created to serialize values of a POJO property),
 * to handle details of resolving
 * {@link ContextualSerializer} with given property context.
 * 
 * @param property Property for which the given primary serializer is used; never null.
 * 
 * @since 2.3
 */
public JsonSerializer<?> handlePrimaryContextualization(JsonSerializer<?> ser,
    BeanProperty property)
  throws JsonMappingException
{
  if (ser != null) {
    if (ser instanceof ContextualSerializer) {
      ser = ((ContextualSerializer) ser).createContextual(this, property);
    }
  }
  return ser;
}
origin: hstaudacher/osgi-jax-rs-connector

/**
 * Method called for primary property serializers (ones
 * directly created to serialize values of a POJO property),
 * to handle details of resolving
 * {@link ContextualSerializer} with given property context.
 * 
 * @param property Property for which the given primary serializer is used; never null.
 * 
 * @since 2.3
 */
public JsonSerializer<?> handlePrimaryContextualization(JsonSerializer<?> ser,
    BeanProperty property)
  throws JsonMappingException
{
  if (ser != null) {
    if (ser instanceof ContextualSerializer) {
      ser = ((ContextualSerializer) ser).createContextual(this, property);
    }
  }
  return ser;
}
origin: Nextdoor/bender

/**
 * Method called for primary property serializers (ones
 * directly created to serialize values of a POJO property),
 * to handle details of resolving
 * {@link ContextualSerializer} with given property context.
 * 
 * @param property Property for which the given primary serializer is used; never null.
 * 
 * @since 2.3
 */
public JsonSerializer<?> handlePrimaryContextualization(JsonSerializer<?> ser,
    BeanProperty property)
  throws JsonMappingException
{
  if (ser != null) {
    if (ser instanceof ContextualSerializer) {
      ser = ((ContextualSerializer) ser).createContextual(this, property);
    }
  }
  return ser;
}
origin: hstaudacher/osgi-jax-rs-connector

/**
 * Method called for secondary property serializers (ones
 * NOT directly created to serialize values of a POJO property
 * but instead created as a dependant serializer -- such as value serializers
 * for structured types, or serializers for root values)
 * to handle details of resolving
 * {@link ContextualDeserializer} with given property context.
 * Given that these serializers are not directly related to given property
 * (or, in case of root value property, to any property), annotations
 * accessible may or may not be relevant.
 * 
 * @param property Property for which serializer is used, if any; null
 *    when deserializing root values
 * 
 * @since 2.3
 */
public JsonSerializer<?> handleSecondaryContextualization(JsonSerializer<?> ser,
    BeanProperty property)
  throws JsonMappingException
{
  if (ser != null) {
    if (ser instanceof ContextualSerializer) {
      ser = ((ContextualSerializer) ser).createContextual(this, property);
    }
  }
  return ser;
}

origin: Nextdoor/bender

/**
 * Method called for secondary property serializers (ones
 * NOT directly created to serialize values of a POJO property
 * but instead created as a dependant serializer -- such as value serializers
 * for structured types, or serializers for root values)
 * to handle details of resolving
 * {@link ContextualDeserializer} with given property context.
 * Given that these serializers are not directly related to given property
 * (or, in case of root value property, to any property), annotations
 * accessible may or may not be relevant.
 * 
 * @param property Property for which serializer is used, if any; null
 *    when deserializing root values
 * 
 * @since 2.3
 */
public JsonSerializer<?> handleSecondaryContextualization(JsonSerializer<?> ser,
    BeanProperty property)
  throws JsonMappingException
{
  if (ser != null) {
    if (ser instanceof ContextualSerializer) {
      ser = ((ContextualSerializer) ser).createContextual(this, property);
    }
  }
  return ser;
}

origin: com.eclipsesource.jaxrs/jersey-all

/**
 * Method called for secondary property serializers (ones
 * NOT directly created to serialize values of a POJO property
 * but instead created as a dependant serializer -- such as value serializers
 * for structured types, or serializers for root values)
 * to handle details of resolving
 * {@link ContextualDeserializer} with given property context.
 * Given that these serializers are not directly related to given property
 * (or, in case of root value property, to any property), annotations
 * accessible may or may not be relevant.
 * 
 * @param property Property for which serializer is used, if any; null
 *    when deserializing root values
 * 
 * @since 2.3
 */
public JsonSerializer<?> handleSecondaryContextualization(JsonSerializer<?> ser,
    BeanProperty property)
  throws JsonMappingException
{
  if (ser != null) {
    if (ser instanceof ContextualSerializer) {
      ser = ((ContextualSerializer) ser).createContextual(this, property);
    }
  }
  return ser;
}

origin: com.jwebmp.jackson.core/jackson-databind

/**
 * Method called for secondary property serializers (ones
 * NOT directly created to serialize values of a POJO property
 * but instead created as a dependant serializer -- such as value serializers
 * for structured types, or serializers for root values)
 * to handle details of resolving
 * {@link ContextualDeserializer} with given property context.
 * Given that these serializers are not directly related to given property
 * (or, in case of root value property, to any property), annotations
 * accessible may or may not be relevant.
 * 
 * @param property Property for which serializer is used, if any; null
 *    when deserializing root values
 * 
 * @since 2.3
 */
public JsonSerializer<?> handleSecondaryContextualization(JsonSerializer<?> ser,
    BeanProperty property)
  throws JsonMappingException
{
  if (ser != null) {
    if (ser instanceof ContextualSerializer) {
      ser = ((ContextualSerializer) ser).createContextual(this, property);
    }
  }
  return ser;
}

origin: com.fasterxml.jackson.datatype/jackson-datatype-guava

valueSer = ((ContextualSerializer) valueSer).createContextual(provider, property);
origin: com.bazaarvoice.emodb/emodb-common-json

  /**
   * Override to preserve the delegating behavior when a contextualized serializer is created.
   */
  @Override
  public JsonSerializer<?> createContextual(SerializerProvider prov, BeanProperty property)
      throws JsonMappingException {
    if (_delegateSerializer instanceof ContextualSerializer) {
      JsonSerializer<?> contextualDelegate = ((ContextualSerializer) _delegateSerializer).createContextual(prov, property);
      // Check for different instance
      if (contextualDelegate != _delegateSerializer) {
        return new DelegatingMapSerializer(contextualDelegate);
      }
    }
    return this;
  }
}
origin: bazaarvoice/emodb

  /**
   * Override to preserve the delegating behavior when a contextualized serializer is created.
   */
  @Override
  public JsonSerializer<?> createContextual(SerializerProvider prov, BeanProperty property)
      throws JsonMappingException {
    if (_delegateSerializer instanceof ContextualSerializer) {
      JsonSerializer<?> contextualDelegate = ((ContextualSerializer) _delegateSerializer).createContextual(prov, property);
      // Check for different instance
      if (contextualDelegate != _delegateSerializer) {
        return new DelegatingMapSerializer(contextualDelegate);
      }
    }
    return this;
  }
}
origin: com.fasterxml.jackson.core/com.springsource.com.fasterxml.jackson.core.jackson-databind

public JsonSerializer<?> createContextual(SerializerProvider provider,
    BeanProperty property)
  throws JsonMappingException
{
  if (_valueSerializer == null) {
    if (_staticTyping) {
      return withValueSerializer(property, provider.findValueSerializer(_valueType, property));
    }
  } else if (_valueSerializer instanceof ContextualSerializer) {
    return withValueSerializer(property, ((ContextualSerializer) _valueSerializer)
        .createContextual(provider, property));
  }
  return this;
}

origin: com.fasterxml.jackson.core/com.springsource.com.fasterxml.jackson.core.jackson-databind

public JsonSerializer<?> createContextual(SerializerProvider provider,
    BeanProperty property)
  throws JsonMappingException
{
  TypeSerializer vts = _valueTypeSerializer;
  if (vts != null) {
    vts = vts.forProperty(property);
  }
  JsonSerializer<?> ser = _elementSerializer;
  if (ser == null) {
    if (_staticTyping) {
      ser = provider.findValueSerializer(_elementType, property);
    }
  } else if (ser instanceof ContextualSerializer) {
    ser = ((ContextualSerializer) _elementSerializer).createContextual(provider, property);
  }
  return withResolved(property, vts, ser);
}
origin: com.fasterxml.jackson.core/com.springsource.com.fasterxml.jackson.core.jackson-databind

  ser = ((ContextualSerializer) ser).createContextual(provider, property);
  keySer = provider.findKeySerializer(_keyType, property);
} else if (keySer instanceof ContextualSerializer) {
  keySer = ((ContextualSerializer) keySer).createContextual(provider, property);
com.fasterxml.jackson.databind.serContextualSerializer

Javadoc

Add-on interface that JsonSerializers can implement to get a callback that can be used to create contextual instances of serializer to use for handling properties of supported type. This can be useful for serializers that can be configured by annotations, or should otherwise have differing behavior depending on what kind of property is being serialized.

Note that in cases where serializer needs both contextualization and resolution -- that is, implements both this interface and ResolvableSerializer-- resolution via ResolvableSerializer occurs first, and contextual resolution (via this interface) later on.

Most used methods

  • createContextual
    Method called to see if a different (or differently configured) serializer is needed to serialize va

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getContentResolver (Context)
  • findViewById (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now