org.msgpack.template.builder
Class AbstractTemplateBuilder

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

public abstract class AbstractTemplateBuilder
extends Object
implements TemplateBuilder


Field Summary
protected  TemplateRegistry registry
           
 
Constructor Summary
protected AbstractTemplateBuilder(TemplateRegistry registry)
           
 
Method Summary
protected abstract
<T> Template<T>
buildTemplate(Class<T> targetClass, FieldEntry[] entries)
           
<T> Template<T>
buildTemplate(Class<T> targetClass, FieldList fieldList)
           
<T> Template<T>
buildTemplate(Type targetType)
           
protected  void checkClassValidation(Class<?> targetClass)
           
protected  FieldOption getFieldOption(Class<?> targetClass)
           
static boolean isAnnotated(AccessibleObject accessibleObject, Class<? extends Annotation> with)
           
static boolean isAnnotated(Class<?> targetClass, Class<? extends Annotation> with)
           
<T> Template<T>
loadTemplate(Type targetType)
           
static boolean matchAtArrayTemplateBuilder(Class<?> targetClass, boolean hasAnnotation)
           
static boolean matchAtClassTemplateBuilder(Class<?> targetClass, boolean hasAnnotation)
           
static boolean matchAtOrdinalEnumTemplateBuilder(Class<?> targetClass, boolean hasAnnotation)
           
protected  FieldEntry[] toFieldEntries(Class<?> targetClass, FieldOption from)
           
 void writeTemplate(Type targetType, String directoryName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.msgpack.template.builder.TemplateBuilder
matchType
 

Field Detail

registry

protected TemplateRegistry registry
Constructor Detail

AbstractTemplateBuilder

protected AbstractTemplateBuilder(TemplateRegistry registry)
Method Detail

buildTemplate

public <T> Template<T> buildTemplate(Type targetType)
                          throws TemplateBuildException
Specified by:
buildTemplate in interface TemplateBuilder
Throws:
TemplateBuildException

buildTemplate

public <T> Template<T> buildTemplate(Class<T> targetClass,
                                     FieldList fieldList)
                          throws TemplateBuildException
Specified by:
buildTemplate in interface TemplateBuilder
Throws:
TemplateBuildException

buildTemplate

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

checkClassValidation

protected void checkClassValidation(Class<?> targetClass)

getFieldOption

protected FieldOption getFieldOption(Class<?> targetClass)

toFieldEntries

protected FieldEntry[] toFieldEntries(Class<?> targetClass,
                                      FieldOption from)

writeTemplate

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

loadTemplate

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

isAnnotated

public static boolean isAnnotated(Class<?> targetClass,
                                  Class<? extends Annotation> with)

isAnnotated

public static boolean isAnnotated(AccessibleObject accessibleObject,
                                  Class<? extends Annotation> with)

matchAtClassTemplateBuilder

public static boolean matchAtClassTemplateBuilder(Class<?> targetClass,
                                                  boolean hasAnnotation)

matchAtArrayTemplateBuilder

public static boolean matchAtArrayTemplateBuilder(Class<?> targetClass,
                                                  boolean hasAnnotation)

matchAtOrdinalEnumTemplateBuilder

public static boolean matchAtOrdinalEnumTemplateBuilder(Class<?> targetClass,
                                                        boolean hasAnnotation)


Copyright © 2011. All Rights Reserved.