com.fasterxml.jackson.module.jsonSchema.factories.StringVisitor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jackson-module-jsonSchema Show documentation
Show all versions of jackson-module-jsonSchema Show documentation
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.JsonStringFormatVisitor;
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonValueFormat;
import com.fasterxml.jackson.module.jsonSchema.types.StringSchema;
public class StringVisitor extends JsonStringFormatVisitor.Base
implements JsonSchemaProducer
{
protected final StringSchema schema;
public StringVisitor(StringSchema schema) {
this.schema = schema;
}
/*
/*********************************************************************
/* JsonSchemaProducer
/*********************************************************************
*/
@Override
public void enumTypes(Set enums) {
schema.setEnums(enums);
}
@Override
public void format(JsonValueFormat format) {
schema.setFormat(format);
}
@Override
public StringSchema getSchema() {
return schema;
}
}