org.msgpack.template.builder
Class BuildContext<T extends FieldEntry>

java.lang.Object
  extended by org.msgpack.template.builder.BuildContext<T>
Direct Known Subclasses:
BeansBuildContext, DefaultBuildContext

public abstract class BuildContext<T extends FieldEntry>
extends Object


Field Summary
protected  JavassistTemplateBuilder director
           
protected  StringBuilder stringBuilder
           
protected  javassist.CtClass tmplCtClass
           
protected  String tmplName
           
 
Constructor Summary
BuildContext(JavassistTemplateBuilder director)
           
 
Method Summary
protected  Template build(String className)
           
protected  void buildClass()
           
protected abstract  void buildConstructor()
           
protected abstract  Template buildInstance(Class<?> c)
           
protected  void buildMethodInit()
           
protected  void buildReadMethod()
           
protected abstract  String buildReadMethodBody()
           
protected  void buildString(String str)
           
protected  void buildString(String format, Object... args)
           
protected abstract  Template buildTemplate(Class<?> targetClass, T[] entries, Template[] templates)
           
protected  void buildWriteMethod()
           
protected abstract  String buildWriteMethodBody()
           
protected  Class<?> createClass()
           
protected  String getBuiltString()
           
protected  Template load(String className)
           
protected abstract  Template loadTemplate(Class<?> targetClass)
           
protected  String primitiveReadName(Class<?> type)
           
protected  String primitiveWriteName(Class<?> type)
           
protected  void reset(String className, boolean isWritten)
           
protected  void resetStringBuilder()
           
protected  void saveClass(String directoryName)
           
protected abstract  void setSuperClass()
           
protected  void write(String className, String directoryName)
           
protected abstract  void writeTemplate(Class<?> targetClass, T[] entries, Template[] templates, String directoryName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

director

protected JavassistTemplateBuilder director

tmplName

protected String tmplName

tmplCtClass

protected javassist.CtClass tmplCtClass

stringBuilder

protected StringBuilder stringBuilder
Constructor Detail

BuildContext

public BuildContext(JavassistTemplateBuilder director)
Method Detail

buildTemplate

protected abstract Template buildTemplate(Class<?> targetClass,
                                          T[] entries,
                                          Template[] templates)

setSuperClass

protected abstract void setSuperClass()
                               throws javassist.CannotCompileException,
                                      javassist.NotFoundException
Throws:
javassist.CannotCompileException
javassist.NotFoundException

buildConstructor

protected abstract void buildConstructor()
                                  throws javassist.CannotCompileException,
                                         javassist.NotFoundException
Throws:
javassist.CannotCompileException
javassist.NotFoundException

build

protected Template build(String className)

reset

protected void reset(String className,
                     boolean isWritten)

buildClass

protected void buildClass()
                   throws javassist.CannotCompileException,
                          javassist.NotFoundException
Throws:
javassist.CannotCompileException
javassist.NotFoundException

buildMethodInit

protected void buildMethodInit()

buildInstance

protected abstract Template buildInstance(Class<?> c)
                                   throws NoSuchMethodException,
                                          InstantiationException,
                                          IllegalAccessException,
                                          InvocationTargetException
Throws:
NoSuchMethodException
InstantiationException
IllegalAccessException
InvocationTargetException

buildWriteMethod

protected void buildWriteMethod()
                         throws javassist.CannotCompileException,
                                javassist.NotFoundException
Throws:
javassist.CannotCompileException
javassist.NotFoundException

buildWriteMethodBody

protected abstract String buildWriteMethodBody()

buildReadMethod

protected void buildReadMethod()
                        throws javassist.CannotCompileException,
                               javassist.NotFoundException
Throws:
javassist.CannotCompileException
javassist.NotFoundException

buildReadMethodBody

protected abstract String buildReadMethodBody()

createClass

protected Class<?> createClass()
                        throws javassist.CannotCompileException
Throws:
javassist.CannotCompileException

saveClass

protected void saveClass(String directoryName)
                  throws javassist.CannotCompileException,
                         IOException
Throws:
javassist.CannotCompileException
IOException

resetStringBuilder

protected void resetStringBuilder()

buildString

protected void buildString(String str)

buildString

protected void buildString(String format,
                           Object... args)

getBuiltString

protected String getBuiltString()

primitiveWriteName

protected String primitiveWriteName(Class<?> type)

primitiveReadName

protected String primitiveReadName(Class<?> type)

writeTemplate

protected abstract void writeTemplate(Class<?> targetClass,
                                      T[] entries,
                                      Template[] templates,
                                      String directoryName)

write

protected void write(String className,
                     String directoryName)

loadTemplate

protected abstract Template loadTemplate(Class<?> targetClass)

load

protected Template load(String className)


Copyright © 2011. All Rights Reserved.