org.apache.bval.json
Class JSONGenerator
java.lang.Object
org.apache.bval.json.JSONGenerator
public class JSONGenerator
- extends Object
Description: Generate a JSON String for a collection of MetaBean
s.
This implementation uses a freemarker template to generate the output.
This is an optional module which requires the freemarker dependency
and template resourece file "bean-infos-json.ftl" with it.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JSONGenerator
public JSONGenerator()
throws IOException
- Throws:
IOException
JSONGenerator
public JSONGenerator(String templateName)
throws IOException
- Throws:
IOException
JSONGenerator
public JSONGenerator(freemarker.template.Template template)
toJSON
public String toJSON(MetaBean metaBean)
throws IOException,
freemarker.template.TemplateException
- Throws:
IOException
freemarker.template.TemplateException
toJSON
public String toJSON(Collection<MetaBean> metaBeans)
throws IOException,
freemarker.template.TemplateException
- Throws:
IOException
freemarker.template.TemplateException
toJSON
public void toJSON(Collection<MetaBean> metaBeans,
Writer out)
throws IOException,
freemarker.template.TemplateException
- Throws:
IOException
freemarker.template.TemplateException
Copyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.