DeserializationConfig.withAnnotationIntrospector
Code IndexAdd Codota to your IDE (free)

Best code snippets using org.codehaus.jackson.map.DeserializationConfig.withAnnotationIntrospector(Showing top 10 results out of 315)

  • Common ways to obtain DeserializationConfig
private void myMethod () {
DeserializationConfig d =
  • ObjectMapper objectMapper;objectMapper.getDeserializationConfig()
  • AI code suggestions by Codota
}
origin: org.codehaus.jackson/jackson-mapper-asl

/**
 * Method for changing {@link AnnotationIntrospector} used by this
 * mapper instance for both serialization and deserialization
 * 
 * @since 1.8
 */
public ObjectMapper setAnnotationIntrospector(AnnotationIntrospector ai) {
  _serializationConfig = _serializationConfig.withAnnotationIntrospector(ai);
  _deserializationConfig = _deserializationConfig.withAnnotationIntrospector(ai);
  return this;
}

origin: jersey/jersey

private static ObjectMapper createCombinedObjectMapper() {
  final Pair combinedIntrospector = createJaxbJacksonAnnotationIntrospector();
  final ObjectMapper result = new ObjectMapper();
  result.configure(SerializationConfig.Feature.WRAP_ROOT_VALUE, true);
  result.configure(DeserializationConfig.Feature.UNWRAP_ROOT_VALUE, true);
  result.setDeserializationConfig(result.getDeserializationConfig().withAnnotationIntrospector(combinedIntrospector));
  result.setSerializationConfig(result.getSerializationConfig().withAnnotationIntrospector(combinedIntrospector));
  return result;
}
origin: GluuFederation/oxAuth

public static ObjectMapper createJsonMapper() {
  final AnnotationIntrospector jaxb = new JaxbAnnotationIntrospector();
  final AnnotationIntrospector jackson = new JacksonAnnotationIntrospector();
  final AnnotationIntrospector pair = new AnnotationIntrospector.Pair(jackson, jaxb);
  final ObjectMapper mapper = new ObjectMapper();
  mapper.getDeserializationConfig().withAnnotationIntrospector(pair);
  mapper.getSerializationConfig().withAnnotationIntrospector(pair);
  return mapper;
}
origin: OpenNMS/opennms

  public static ObjectMapper createDefaultObjectMapper() {
    final ObjectMapper mapper = new ObjectMapper();
    final AnnotationIntrospector introspectorPair = AnnotationIntrospector.pair(
        new JacksonAnnotationIntrospector(),
        new JaxbAnnotationIntrospector());
    mapper.setDeserializationConfig(mapper.getDeserializationConfig().withAnnotationIntrospector(introspectorPair));
    mapper.setSerializationConfig(mapper.getSerializationConfig().withAnnotationIntrospector(introspectorPair));
    return mapper;
  }
}
origin: oVirt/ovirt-engine

protected CustomObjectMapper addSerializationConfig() {
  // We need the instrospector that takes into account the JAXB annotations,
  // both for the serializer and for the deserializer:
  JaxbAnnotationIntrospector introspector = new JaxbAnnotationIntrospector();
  // Configure the serializer:
  SerializationConfig serCfg = getSerializationConfig()
      .withAnnotationIntrospector(introspector);
  setSerializationConfig(serCfg);
  // Configure the deserializer:
  DeserializationConfig deserCfg = getDeserializationConfig()
      .withAnnotationIntrospector(introspector);
  setDeserializationConfig(deserCfg);
  return this;
}
origin: com.atlassian.plugins.rest/atlassian-rest-common

  public JacksonJsonProvider create(Iterable<? extends Module> modules) {
    ObjectMapper mapper = new ObjectMapper();

    /* This is what MapperConfigurator would do to a default ObjectMapper */
    AnnotationIntrospector intr = AnnotationIntrospector.pair(new JacksonAnnotationIntrospector(), new JaxbAnnotationIntrospector());
    mapper.setDeserializationConfig(mapper.getDeserializationConfig().withAnnotationIntrospector(intr));
    mapper.setSerializationConfig(mapper.getSerializationConfig().withAnnotationIntrospector(intr));

    /* In the absence of a specific annotation for @JsonSerialize(include), ignore null fields when serializing */
    mapper.setSerializationInclusion(Inclusion.NON_NULL);

    for (Module module : modules) {
      mapper.registerModule(module);
    }

    mapper.registerModule(new GuavaIterableCapableModule());

    JacksonJaxbJsonProvider provider = new JacksonJaxbJsonProvider(mapper, JacksonJaxbJsonProvider.DEFAULT_ANNOTATIONS);

    // Make sure we only rely on annotations for de-/serialization
    provider.configure(SerializationConfig.Feature.AUTO_DETECT_GETTERS, false);
    provider.configure(SerializationConfig.Feature.AUTO_DETECT_FIELDS, false);
    provider.configure(DeserializationConfig.Feature.AUTO_DETECT_SETTERS, false);
    provider.configure(DeserializationConfig.Feature.AUTO_DETECT_FIELDS, false);
    return provider;
  }
}
origin: oVirt/ovirt-engine

protected V3CustomObjectMapper addSerializationConfig() {
  // We need the instrospector that takes into account the JAXB annotations,
  // both for the serializer and for the deserializer:
  JaxbAnnotationIntrospector introspector = new JaxbAnnotationIntrospector();
  // Configure the serializer:
  SerializationConfig serCfg = getSerializationConfig()
      .withAnnotationIntrospector(introspector);
  setSerializationConfig(serCfg);
  // Configure the deserializer:
  DeserializationConfig deserCfg = getDeserializationConfig()
      .withAnnotationIntrospector(introspector);
  setDeserializationConfig(deserCfg);
  return this;
}
origin: org.kie/kie-server-api

public JSONMarshaller() {
  objectMapper = new ObjectMapper();
  // this is needed because we are using Jackson 1.x which by default ignores Jaxb annotations
  // one we move to Jackson 2.x, the config below should not be needed
  AnnotationIntrospector primary = new JaxbAnnotationIntrospector();
  AnnotationIntrospector secondary = new JacksonAnnotationIntrospector();
  AnnotationIntrospector introspectorPair = new AnnotationIntrospector.Pair(primary, secondary);
  objectMapper.setDeserializationConfig(objectMapper.getDeserializationConfig().withAnnotationIntrospector(introspectorPair));
  objectMapper.setSerializationConfig(objectMapper.getSerializationConfig().withAnnotationIntrospector(introspectorPair));
}
origin: intuit/wasabi

/**
 * Method for changing {@link AnnotationIntrospector} used by this
 * mapper instance for both serialization and deserialization
 * 
 * @since 1.8
 */
public ObjectMapper setAnnotationIntrospector(AnnotationIntrospector ai) {
  _serializationConfig = _serializationConfig.withAnnotationIntrospector(ai);
  _deserializationConfig = _deserializationConfig.withAnnotationIntrospector(ai);
  return this;
}

origin: org.codehaus.jackson/jackson-mapper-lgpl

/**
 * Method for changing {@link AnnotationIntrospector} used by this
 * mapper instance for both serialization and deserialization
 * 
 * @since 1.8
 */
public ObjectMapper setAnnotationIntrospector(AnnotationIntrospector ai) {
  _serializationConfig = _serializationConfig.withAnnotationIntrospector(ai);
  _deserializationConfig = _deserializationConfig.withAnnotationIntrospector(ai);
  return this;
}

org.codehaus.jackson.mapDeserializationConfigwithAnnotationIntrospector

Popular methods of DeserializationConfig

  • addMixInAnnotations
  • set
  • getTypeFactory
  • constructType
  • without
    Fluent factory method that will construct and return a new configuration object instance with specif
  • <init>
  • canOverrideAccessModifiers
  • collectFeatureDefaults
  • constructSpecializedType
  • createUnshared
    Method that is called to create a non-shared copy of the configuration to be used for a deserializat
  • deserializerInstance
  • getAnnotationIntrospector
    Method for getting AnnotationIntrospector configured to introspect annotation values used for config
  • deserializerInstance,
  • getAnnotationIntrospector,
  • getBase64Variant,
  • getClassIntrospector,
  • getDateFormat,
  • getDefaultTyper,
  • getDefaultVisibilityChecker,
  • getHandlerInstantiator,
  • getNodeFactory

Popular classes and methods

  • putExtra (Intent)
  • notifyDataSetChanged (ArrayAdapter)
  • startActivity (Activity)
  • Graphics2D (java.awt)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • ImageIO (javax.imageio)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr

For IntelliJ IDEA and
Android Studio

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)