org.msgpack.template.builder
Class DefaultBuildContext

java.lang.Object
  extended by org.msgpack.template.builder.BuildContext<FieldEntry>
      extended by org.msgpack.template.builder.DefaultBuildContext

public class DefaultBuildContext
extends BuildContext<FieldEntry>


Field Summary
protected  FieldEntry[] entries
           
protected  Class<?> origClass
           
protected  String origName
           
protected  Template<?>[] templates
           
 
Fields inherited from class org.msgpack.template.builder.BuildContext
director, stringBuilder, tmplCtClass, tmplName
 
Constructor Summary
DefaultBuildContext(JavassistTemplateBuilder director)
           
 
Method Summary
protected  void buildConstructor()
           
protected  Template buildInstance(Class<?> c)
           
protected  void buildMethodInit()
           
protected  String buildReadMethodBody()
           
 Template buildTemplate(Class targetClass, FieldEntry[] entries, Template[] templates)
           
protected  String buildWriteMethodBody()
           
 Template loadTemplate(Class<?> targetClass)
           
static void readPrivateField(Unpacker unpacker, Object target, String fieldName, Template tmpl)
           
protected  void setSuperClass()
           
static void writePrivateField(Packer packer, Object target, String fieldName, Template tmpl)
           
 void writeTemplate(Class<?> targetClass, FieldEntry[] entries, Template[] templates, String directoryName)
           
 
Methods inherited from class org.msgpack.template.builder.BuildContext
build, buildClass, buildReadMethod, buildString, buildString, buildWriteMethod, createClass, getBuiltString, load, primitiveReadName, primitiveWriteName, reset, resetStringBuilder, saveClass, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entries

protected FieldEntry[] entries

origClass

protected Class<?> origClass

origName

protected String origName

templates

protected Template<?>[] templates
Constructor Detail

DefaultBuildContext

public DefaultBuildContext(JavassistTemplateBuilder director)
Method Detail

buildTemplate

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

setSuperClass

protected void setSuperClass()
                      throws javassist.CannotCompileException,
                             javassist.NotFoundException
Specified by:
setSuperClass in class BuildContext<FieldEntry>
Throws:
javassist.CannotCompileException
javassist.NotFoundException

buildConstructor

protected void buildConstructor()
                         throws javassist.CannotCompileException,
                                javassist.NotFoundException
Specified by:
buildConstructor in class BuildContext<FieldEntry>
Throws:
javassist.CannotCompileException
javassist.NotFoundException

buildInstance

protected Template buildInstance(Class<?> c)
                          throws NoSuchMethodException,
                                 InstantiationException,
                                 IllegalAccessException,
                                 InvocationTargetException
Specified by:
buildInstance in class BuildContext<FieldEntry>
Throws:
NoSuchMethodException
InstantiationException
IllegalAccessException
InvocationTargetException

buildMethodInit

protected void buildMethodInit()
Overrides:
buildMethodInit in class BuildContext<FieldEntry>

buildWriteMethodBody

protected String buildWriteMethodBody()
Specified by:
buildWriteMethodBody in class BuildContext<FieldEntry>

writePrivateField

public static void writePrivateField(Packer packer,
                                     Object target,
                                     String fieldName,
                                     Template tmpl)

buildReadMethodBody

protected String buildReadMethodBody()
Specified by:
buildReadMethodBody in class BuildContext<FieldEntry>

readPrivateField

public static void readPrivateField(Unpacker unpacker,
                                    Object target,
                                    String fieldName,
                                    Template tmpl)

writeTemplate

public void writeTemplate(Class<?> targetClass,
                          FieldEntry[] entries,
                          Template[] templates,
                          String directoryName)
Specified by:
writeTemplate in class BuildContext<FieldEntry>

loadTemplate

public Template loadTemplate(Class<?> targetClass)
Specified by:
loadTemplate in class BuildContext<FieldEntry>


Copyright © 2011. All Rights Reserved.