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

templates.velocity.java5g.perschema.jsoncodec.vm Maven / Gradle / Ivy

There is a newer version: 5.2.0
Show newest version
#parse( "schema.include.vm" )
#parse( "header.include.vm" )
#set ( $javaClassName = 'JsonCodec' )

$codewriter.setCurrentJavaFilename($pkg, "${javaClassName}.java")
package $pkg;
#####################
#if($codewriter.fastjsonClassDeserializer)
import gu.sql2java.json.FastjsonDeserializer;
import gu.sql2java.json.FastjsonSerializer;
#end
#if($codewriter.jacksonClassDeserializer)
import gu.sql2java.json.JacksonDeserializer;
import gu.sql2java.json.JacksonSerializer;
#end
/**
 * JSON deserializer declaration 
 * @author guyadong
 */
public class $javaClassName {

#foreach($table in $tables)
#set ( $beanClass = ${table.asBeanClassNSP()} )
#if($codewriter.fastjsonClassDeserializer)
    public static class ${beanClass}FastjsonDeserializer extends FastjsonDeserializer{
        public ${beanClass}FastjsonDeserializer() {
            super(${beanClass}.class);
        }
    }
    public static class ${beanClass}FastjsonSerializer extends FastjsonSerializer{
        public ${beanClass}FastjsonSerializer() {
            super(${beanClass}.class);
        }
    }
#end
#if($codewriter.jacksonClassDeserializer)
    public static class ${beanClass}JacksonDeserializer extends JacksonDeserializer{
        private static final long serialVersionUID = ${table.getSerialVersionUID("${pkg}.${javaClassName}.${beanClass}JacksonDeserializer")}L;
        public ${beanClass}JacksonDeserializer() {
            super(${beanClass}.class);
        }
    }
    public static class ${beanClass}JacksonSerializer extends JacksonSerializer{
        private static final long serialVersionUID = ${table.getSerialVersionUID("${pkg}.${javaClassName}.${beanClass}JacksonSerializer")}L;
        public ${beanClass}JacksonSerializer() {
            super(${beanClass}.class);
        }
    }
#end
#end
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy