com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes Java Examples

The following examples show how to use com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ODataMetaDataRetrievalTest.java    From syndesis with Apache License 2.0 6 votes vote down vote up
private static void checkTestServerSchemaMap(Map<String, JsonSchema> schemaMap) {
    JsonSchema descSchema = schemaMap.get("Description");
    JsonSchema specSchema = schemaMap.get("Specification");

    assertNotNull(descSchema);
    assertNotNull(schemaMap.get("ID"));
    assertNotNull(schemaMap.get("Name"));
    assertNotNull(specSchema);

    JsonFormatTypes descType = descSchema.getType();
    assertNotNull(descType);
    assertEquals(JsonFormatTypes.STRING, descType);
    assertEquals(false, descSchema.getRequired());

    JsonFormatTypes specType = specSchema.getType();
    assertNotNull(specType);
    assertEquals(JsonFormatTypes.OBJECT, specType);
    assertEquals(false, specSchema.getRequired());
    assertThat(specSchema).isInstanceOf(ObjectSchema.class);
    ObjectSchema specObjSchema = specSchema.asObjectSchema();
    assertEquals(4, specObjSchema.getProperties().size());
}
 
Example #2
Source File: DataHandlerJsonSerializer.java    From jackson-modules-base with Apache License 2.0 5 votes vote down vote up
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
    throws JsonMappingException
{
    if (visitor != null) {
        JsonArrayFormatVisitor v2 = visitor.expectArrayFormat(typeHint);
        if (v2 != null) {
            v2.itemsFormat(JsonFormatTypes.STRING);
        }
    }
}
 
Example #3
Source File: HttpRequestWrapperProcessorTest.java    From syndesis with Apache License 2.0 5 votes vote down vote up
public HttpRequestWrapperProcessorTest() {
    final ObjectSchema parameters = new ObjectSchema();
    parameters.putProperty("param1", JsonSchema.minimalForFormat(JsonFormatTypes.STRING));
    parameters.putProperty("param2", JsonSchema.minimalForFormat(JsonFormatTypes.STRING));
    schema.putProperty("parameters", parameters);

    final ObjectSchema body = new ObjectSchema();
    body.putProperty("body1", JsonSchema.minimalForFormat(JsonFormatTypes.STRING));
    body.putProperty("body2", JsonSchema.minimalForFormat(JsonFormatTypes.STRING));
    schema.putProperty("body", body);
}
 
Example #4
Source File: HppcContainerSerializers.java    From jackson-datatypes-collections with Apache License 2.0 5 votes vote down vote up
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
        throws JsonMappingException
{
    if (visitor != null) {
        JsonArrayFormatVisitor v2 = visitor.expectArrayFormat(typeHint);
        if (v2 != null) {
            v2.itemsFormat(JsonFormatTypes.BOOLEAN);
        }
    }
}
 
Example #5
Source File: HppcContainerSerializers.java    From jackson-datatypes-collections with Apache License 2.0 5 votes vote down vote up
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
    throws JsonMappingException
{
    if (visitor != null) {
        JsonArrayFormatVisitor v2 = visitor.expectArrayFormat(typeHint);
        if (v2 != null) {
            v2.itemsFormat(JsonFormatTypes.NUMBER);
        }
    }
}
 
Example #6
Source File: HppcContainerSerializers.java    From jackson-datatypes-collections with Apache License 2.0 5 votes vote down vote up
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
    throws JsonMappingException
{
    if (visitor != null) {
        JsonArrayFormatVisitor v2 = visitor.expectArrayFormat(typeHint);
        if (v2 != null) {
            v2.itemsFormat(JsonFormatTypes.NUMBER);
        }
    }
}
 
Example #7
Source File: HppcContainerSerializers.java    From jackson-datatypes-collections with Apache License 2.0 5 votes vote down vote up
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
        throws JsonMappingException
{
    if (visitor != null) {
        JsonArrayFormatVisitor v2 = visitor.expectArrayFormat(typeHint);
        if (v2 != null) {
            v2.itemsFormat(JsonFormatTypes.INTEGER);
        }
    }
}
 
Example #8
Source File: HppcContainerSerializers.java    From jackson-datatypes-collections with Apache License 2.0 5 votes vote down vote up
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
        throws JsonMappingException
{
    if (visitor != null) {
        JsonArrayFormatVisitor v2 = visitor.expectArrayFormat(typeHint);
        if (v2 != null) {
            v2.itemsFormat(JsonFormatTypes.INTEGER);
        }
    }
}
 
Example #9
Source File: HppcContainerSerializers.java    From jackson-datatypes-collections with Apache License 2.0 5 votes vote down vote up
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
        throws JsonMappingException
{
    if (visitor != null) {
        JsonArrayFormatVisitor v2 = visitor.expectArrayFormat(typeHint);
        if (v2 != null) {
            v2.itemsFormat(JsonFormatTypes.INTEGER);
        }
    }
}
 
Example #10
Source File: HppcContainerSerializers.java    From jackson-datatypes-collections with Apache License 2.0 5 votes vote down vote up
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
        throws JsonMappingException
{
    if (visitor != null) {
        JsonArrayFormatVisitor v2 = visitor.expectArrayFormat(typeHint);
        if (v2 != null) {
            v2.itemsFormat(JsonFormatTypes.INTEGER);
        }
    }
}
 
Example #11
Source File: ByteArraySerializer.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
    throws JsonMappingException
{
    // 14-Mar-2016, tatu: while logically (and within JVM) binary, gets encoded as Base64 String,
    // let's try to indicate it is array of Bytes... difficult, thanks to JSON Schema's
    // lackluster listing of types
    //
    // TODO: for 2.8, make work either as String/base64, or array of numbers,
    //   with a qualifier that can be used to determine it's byte[]
    JsonArrayFormatVisitor v2 = visitor.expectArrayFormat(typeHint);
    if (v2 != null) {
        v2.itemsFormat(JsonFormatTypes.INTEGER);
    }
}
 
Example #12
Source File: ByteBufferSerializer.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override // since 2.9
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
    throws JsonMappingException
{
    // 31-Mar-2017, tatu: Use same type as `ByteArraySerializer`: not optimal but has to do
    JsonArrayFormatVisitor v2 = visitor.expectArrayFormat(typeHint);
    if (v2 != null) {
        v2.itemsFormat(JsonFormatTypes.INTEGER);
    }
}
 
Example #13
Source File: StdArraySerializers.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
    throws JsonMappingException
{
    visitArrayFormat(visitor, typeHint, JsonFormatTypes.NUMBER);
}
 
Example #14
Source File: IndexedStringListSerializer.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void acceptContentVisitor(JsonArrayFormatVisitor visitor) throws JsonMappingException {
    visitor.itemsFormat(JsonFormatTypes.STRING);
}
 
Example #15
Source File: StringCollectionSerializer.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void acceptContentVisitor(JsonArrayFormatVisitor visitor) throws JsonMappingException
{
    visitor.itemsFormat(JsonFormatTypes.STRING);
}
 
Example #16
Source File: StringArraySerializer.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException
{
    visitArrayFormat(visitor, typeHint, JsonFormatTypes.STRING);
}
 
Example #17
Source File: StdArraySerializers.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException
{
    visitArrayFormat(visitor, typeHint, JsonFormatTypes.NUMBER);
}
 
Example #18
Source File: StdArraySerializers.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
    throws JsonMappingException
{
    visitArrayFormat(visitor, typeHint, JsonFormatTypes.NUMBER);
}
 
Example #19
Source File: StdArraySerializers.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException
{
    visitArrayFormat(visitor, typeHint, JsonFormatTypes.INTEGER);
}
 
Example #20
Source File: StdArraySerializers.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
    throws JsonMappingException
{
    visitArrayFormat(visitor, typeHint, JsonFormatTypes.STRING);
}
 
Example #21
Source File: StdArraySerializers.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
    throws JsonMappingException
{
    visitArrayFormat(visitor, typeHint, JsonFormatTypes.INTEGER);
}
 
Example #22
Source File: StdArraySerializers.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
    throws JsonMappingException
{
    visitArrayFormat(visitor, typeHint, JsonFormatTypes.BOOLEAN);
}