JsonSchema.getDefaultSchemaNode
Code IndexAdd Codota to your IDE (free)

Best code snippets using com.fasterxml.jackson.databind.jsonschema.JsonSchema.getDefaultSchemaNode(Showing top 15 results out of 315)

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

@SuppressWarnings("deprecation")
@Override
public JsonNode getSchema(SerializerProvider provider, Type typeHint)
  throws JsonMappingException
{
  if (_valueSerializer instanceof SchemaAware) {
    return ((SchemaAware)_valueSerializer).getSchema(provider, null);
  }
  return com.fasterxml.jackson.databind.jsonschema.JsonSchema.getDefaultSchemaNode();
}
origin: com.fasterxml.jackson.core/jackson-databind

@SuppressWarnings("deprecation")
@Override
public JsonNode getSchema(SerializerProvider provider, Type typeHint)
  throws JsonMappingException
{
  ObjectNode o = createSchemaNode("array", true);
  if (_elementSerializer != null) {
    JsonNode schemaNode = null;
    if (_elementSerializer instanceof SchemaAware) {
      schemaNode = ((SchemaAware) _elementSerializer).getSchema(provider, null);
    }
    if (schemaNode == null) {
      schemaNode = com.fasterxml.jackson.databind.jsonschema.JsonSchema.getDefaultSchemaNode();
    }
    o.set("items", schemaNode);
  }
  return o;
}
origin: com.fasterxml.jackson.core/jackson-databind

/**
 * The method to be called by {@link ObjectMapper}
 * to generate <a href="http://json-schema.org/">JSON schema</a> for
 * given type.
 *
 * @param type The type for which to generate schema
 * 
 * @deprecated Should not be used any more
 */
@Deprecated // since 2.6
public com.fasterxml.jackson.databind.jsonschema.JsonSchema generateJsonSchema(Class<?> type)
  throws JsonMappingException
{
  /* no need for embedded type information for JSON schema generation (all
   * type information it needs is accessible via "untyped" serializer)
   */
  JsonSerializer<Object> ser = findValueSerializer(type, null);
  JsonNode schemaNode = (ser instanceof SchemaAware) ?
      ((SchemaAware) ser).getSchema(this, null) : com.fasterxml.jackson.databind.jsonschema.JsonSchema.getDefaultSchemaNode();
  if (!(schemaNode instanceof ObjectNode)) {
    throw new IllegalArgumentException("Class " + type.getName()
        +" would not be serialized as a JSON object and therefore has no schema");
  }
  return new com.fasterxml.jackson.databind.jsonschema.JsonSchema((ObjectNode) schemaNode);
}

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

} else {
  schemaNode = com.fasterxml.jackson.databind.jsonschema.JsonSchema
      .getDefaultSchemaNode();
origin: redisson/redisson

@SuppressWarnings("deprecation")
@Override
public JsonNode getSchema(SerializerProvider provider, Type typeHint)
  throws JsonMappingException
{
  ObjectNode o = createSchemaNode("array", true);
  if (typeHint != null) {
    JavaType javaType = provider.constructType(typeHint);
    if (javaType.isArrayType()) {
      Class<?> componentType = ((ArrayType) javaType).getContentType().getRawClass();
      // 15-Oct-2010, tatu: We can't serialize plain Object.class; but what should it produce here? Untyped?
      if (componentType == Object.class) {
        o.set("items", com.fasterxml.jackson.databind.jsonschema.JsonSchema.getDefaultSchemaNode());
      } else {
        JsonSerializer<Object> ser = provider.findValueSerializer(componentType, _property);
        JsonNode schemaNode = (ser instanceof SchemaAware) ?
            ((SchemaAware) ser).getSchema(provider, null) :
              com.fasterxml.jackson.databind.jsonschema.JsonSchema.getDefaultSchemaNode();
        o.set("items", schemaNode);
      }
    }
  }
  return o;
}
origin: redisson/redisson

@SuppressWarnings("deprecation")
@Override
public JsonNode getSchema(SerializerProvider provider, Type typeHint)
  throws JsonMappingException
{
  ObjectNode o = createSchemaNode("array", true);
  JavaType contentType = _elementType;
  if (contentType != null) {
    JsonNode schemaNode = null;
    // 15-Oct-2010, tatu: We can't serialize plain Object.class; but what should it produce here? Untyped?
    if (contentType.getRawClass() != Object.class) {
      JsonSerializer<Object> ser = provider.findValueSerializer(contentType, _property);
      if (ser instanceof SchemaAware) {
        schemaNode = ((SchemaAware) ser).getSchema(provider, null);
      }
    }
    if (schemaNode == null) {
      schemaNode = com.fasterxml.jackson.databind.jsonschema.JsonSchema.getDefaultSchemaNode();
    }
    o.set("items", schemaNode);
  }
  return o;
}
origin: com.fasterxml.jackson.core/jackson-databind

@SuppressWarnings("deprecation")
@Override
public JsonNode getSchema(SerializerProvider provider, Type typeHint)
  throws JsonMappingException
{
  if (_valueSerializer instanceof SchemaAware) {
    return ((SchemaAware)_valueSerializer).getSchema(provider, null);
  }
  return com.fasterxml.jackson.databind.jsonschema.JsonSchema.getDefaultSchemaNode();
}
origin: com.fasterxml.jackson.core/jackson-databind

@SuppressWarnings("deprecation")
@Override
public JsonNode getSchema(SerializerProvider provider, Type typeHint)
  throws JsonMappingException
{
  if (_valueSerializer instanceof SchemaAware) {
    return ((SchemaAware)_valueSerializer).getSchema(provider, null);
  }
  return com.fasterxml.jackson.databind.jsonschema.JsonSchema.getDefaultSchemaNode();
}
origin: redisson/redisson

@SuppressWarnings("deprecation")
@Override
public JsonNode getSchema(SerializerProvider provider, Type typeHint)
  throws JsonMappingException
{
  if (_valueSerializer instanceof SchemaAware) {
    return ((SchemaAware)_valueSerializer).getSchema(provider, null);
  }
  return com.fasterxml.jackson.databind.jsonschema.JsonSchema.getDefaultSchemaNode();
}
origin: com.fasterxml.jackson.core/jackson-databind

@SuppressWarnings("deprecation")
@Override
public JsonNode getSchema(SerializerProvider provider, Type typeHint)
  throws JsonMappingException
{
  ObjectNode o = createSchemaNode("array", true);
  if (_elementSerializer != null) {
    JsonNode schemaNode = null;
    if (_elementSerializer instanceof SchemaAware) {
      schemaNode = ((SchemaAware) _elementSerializer).getSchema(provider, null);
    }
    if (schemaNode == null) {
      schemaNode = com.fasterxml.jackson.databind.jsonschema.JsonSchema.getDefaultSchemaNode();
    }
    o.set("items", schemaNode);
  }
  return o;
}
origin: com.fasterxml.jackson.core/jackson-databind

@SuppressWarnings("deprecation")
@Override
public JsonNode getSchema(SerializerProvider provider, Type typeHint)
  throws JsonMappingException
{
  ObjectNode o = createSchemaNode("array", true);
  if (_elementSerializer != null) {
    JsonNode schemaNode = null;
    if (_elementSerializer instanceof SchemaAware) {
      schemaNode = ((SchemaAware) _elementSerializer).getSchema(provider, null);
    }
    if (schemaNode == null) {
      schemaNode = com.fasterxml.jackson.databind.jsonschema.JsonSchema.getDefaultSchemaNode();
    }
    o.set("items", schemaNode);
  }
  return o;
}
origin: com.fasterxml.jackson.core/jackson-databind

/**
 * The method to be called by {@link ObjectMapper}
 * to generate <a href="http://json-schema.org/">JSON schema</a> for
 * given type.
 *
 * @param type The type for which to generate schema
 * 
 * @deprecated Should not be used any more
 */
@Deprecated // since 2.6
public com.fasterxml.jackson.databind.jsonschema.JsonSchema generateJsonSchema(Class<?> type)
  throws JsonMappingException
{
  /* no need for embedded type information for JSON schema generation (all
   * type information it needs is accessible via "untyped" serializer)
   */
  JsonSerializer<Object> ser = findValueSerializer(type, null);
  JsonNode schemaNode = (ser instanceof SchemaAware) ?
      ((SchemaAware) ser).getSchema(this, null) : com.fasterxml.jackson.databind.jsonschema.JsonSchema.getDefaultSchemaNode();
  if (!(schemaNode instanceof ObjectNode)) {
    throw new IllegalArgumentException("Class " + type.getName()
        +" would not be serialized as a JSON object and therefore has no schema");
  }
  return new com.fasterxml.jackson.databind.jsonschema.JsonSchema((ObjectNode) schemaNode);
}

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

/**
 * The method to be called by {@link ObjectMapper}
 * to generate <a href="http://json-schema.org/">JSON schema</a> for
 * given type.
 *
 * @param type The type for which to generate schema
 * 
 * @deprecated Should not be used any more
 */
@Deprecated // since 2.6
public com.fasterxml.jackson.databind.jsonschema.JsonSchema generateJsonSchema(Class<?> type)
  throws JsonMappingException
{
  /* no need for embedded type information for JSON schema generation (all
   * type information it needs is accessible via "untyped" serializer)
   */
  JsonSerializer<Object> ser = findValueSerializer(type, null);
  JsonNode schemaNode = (ser instanceof SchemaAware) ?
      ((SchemaAware) ser).getSchema(this, null) : com.fasterxml.jackson.databind.jsonschema.JsonSchema.getDefaultSchemaNode();
  if (!(schemaNode instanceof ObjectNode)) {
    throw new IllegalArgumentException("Class " + type.getName()
        +" would not be serialized as a JSON object and therefore has no schema");
  }
  return new com.fasterxml.jackson.databind.jsonschema.JsonSchema((ObjectNode) schemaNode);
}

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

} else {
  schemaNode = com.fasterxml.jackson.databind.jsonschema.JsonSchema
      .getDefaultSchemaNode();
origin: com.fasterxml.jackson.core/jackson-databind

} else {
  schemaNode = com.fasterxml.jackson.databind.jsonschema.JsonSchema
      .getDefaultSchemaNode();
com.fasterxml.jackson.databind.jsonschemaJsonSchemagetDefaultSchemaNode

Javadoc

Get the default schema node.

Popular methods of JsonSchema

  • <init>
    Main constructor for schema instances. This is the creator constructor used by Jackson itself when d
  • getSchemaNode
    Method for accessing root JSON object of the contained schema. Note: this method is specified with J

Popular classes and methods

  • getSystemService (Context)
  • onCreateOptionsMenu (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Path (java.nio.file)
  • SortedMap (java.util)
    A Map that further provides a total ordering on its keys. The map is ordered according to the Compar
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on *
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • JLabel (javax.swing)
  • JOptionPane (javax.swing)

For IntelliJ IDEA,
Android Studio or Eclipse

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