org.msgpack.template.builder
Class JavassistTemplateBuilder

java.lang.Object
  extended by org.msgpack.template.builder.AbstractTemplateBuilder
      extended by org.msgpack.template.builder.JavassistTemplateBuilder
All Implemented Interfaces:
TemplateBuilder
Direct Known Subclasses:
JavassistBeansTemplateBuilder

public class JavassistTemplateBuilder
extends AbstractTemplateBuilder


Nested Class Summary
static class JavassistTemplateBuilder.JavassistTemplate<T>
           
 
Field Summary
protected  javassist.ClassPool pool
           
protected  int seqId
           
 
Fields inherited from class org.msgpack.template.builder.AbstractTemplateBuilder
registry
 
Constructor Summary
JavassistTemplateBuilder(TemplateRegistry registry)
           
 
Method Summary
 void addClassLoader(ClassLoader cl)
           
<T> Template<T>
buildTemplate(Class<T> targetClass, FieldEntry[] entries)
           
protected  BuildContext createBuildContext()
           
protected  javassist.CtClass getCtClass(String className)
           
<T> Template<T>
loadTemplate(Type targetType)
           
protected  javassist.CtClass makeCtClass(String className)
           
 boolean matchType(Type targetType, boolean hasAnnotation)
           
protected  int nextSeqId()
           
 void writeTemplate(Type targetType, String directoryName)
           
 
Methods inherited from class org.msgpack.template.builder.AbstractTemplateBuilder
buildTemplate, buildTemplate, checkClassValidation, getFieldOption, isAnnotated, isAnnotated, matchAtArrayTemplateBuilder, matchAtClassTemplateBuilder, matchAtOrdinalEnumTemplateBuilder, toFieldEntries
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pool

protected javassist.ClassPool pool

seqId

protected int seqId
Constructor Detail

JavassistTemplateBuilder

public JavassistTemplateBuilder(TemplateRegistry registry)
Method Detail

matchType

public boolean matchType(Type targetType,
                         boolean hasAnnotation)

addClassLoader

public void addClassLoader(ClassLoader cl)

makeCtClass

protected javassist.CtClass makeCtClass(String className)

getCtClass

protected javassist.CtClass getCtClass(String className)
                                throws javassist.NotFoundException
Throws:
javassist.NotFoundException

nextSeqId

protected int nextSeqId()

createBuildContext

protected BuildContext createBuildContext()

buildTemplate

public <T> Template<T> buildTemplate(Class<T> targetClass,
                                     FieldEntry[] entries)
Specified by:
buildTemplate in class AbstractTemplateBuilder

writeTemplate

public void writeTemplate(Type targetType,
                          String directoryName)
Specified by:
writeTemplate in interface TemplateBuilder
Overrides:
writeTemplate in class AbstractTemplateBuilder

loadTemplate

public <T> Template<T> loadTemplate(Type targetType)
Specified by:
loadTemplate in interface TemplateBuilder
Overrides:
loadTemplate in class AbstractTemplateBuilder


Copyright © 2011. All Rights Reserved.