All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fasterxml.jackson.module.jsonSchema.factories.NumberVisitor Maven / Gradle / Ivy

Go to download

Add-on module for Jackson (http://jackson.codehaus.org) to support JSON Schema (http://tools.ietf.org/html/draft-zyp-json-schema-03) version 3 generation.

The newest version!
package com.fasterxml.jackson.module.jsonSchema.factories;

import java.util.Set;

import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonNumberFormatVisitor;
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonValueFormat;
import com.fasterxml.jackson.module.jsonSchema.types.NumberSchema;

public class NumberVisitor extends JsonNumberFormatVisitor.Base
    implements JsonSchemaProducer
{
    protected final NumberSchema schema;
	
    public NumberVisitor(NumberSchema schema) {
        this.schema = schema;
    }

    /*
    /*********************************************************************
    /* JsonSchemaProducer
    /*********************************************************************
     */

    @Override
    public NumberSchema getSchema() {
        return schema;
    }
    
    /*
    /*********************************************************************
    /* JsonNumberFormatVisitor
    /*********************************************************************
     */

    @Override
    public void enumTypes(Set enums) {
        schema.setEnums(enums);
    }

    @Override
    public void format(JsonValueFormat format) {
        schema.setFormat(format);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy