public class BeanBuilder extends Object
Modifier and Type | Field and Description |
---|---|
protected Map<String,POJOProperty> |
_beanProperties |
protected Class<?> |
_implementedType
Abstract class or interface that the bean is created to extend or implement.
|
protected com.fasterxml.jackson.databind.type.TypeFactory |
_typeFactory |
protected LinkedHashMap<String,Method> |
_unsupportedMethods |
Constructor and Description |
---|
BeanBuilder(Class<?> implType,
com.fasterxml.jackson.databind.type.TypeFactory tf) |
Modifier and Type | Method and Description |
---|---|
protected void |
addGetter(Method m) |
protected void |
addSetter(Method m) |
byte[] |
build(String className)
Method that generates byte code for class that implements abstract
types requested so far.
|
protected String |
buildGetterName(String fieldName) |
protected String |
buildSetterName(String fieldName) |
protected String |
cap(String prefix,
String name) |
protected void |
createField(org.objectweb.asm.ClassWriter cw,
POJOProperty prop,
com.fasterxml.jackson.module.mrbean.BeanBuilder.TypeDescription type) |
protected void |
createGetter(org.objectweb.asm.ClassWriter cw,
String internalClassName,
POJOProperty prop,
com.fasterxml.jackson.module.mrbean.BeanBuilder.TypeDescription propertyType) |
protected void |
createSetter(org.objectweb.asm.ClassWriter cw,
String internalClassName,
POJOProperty prop,
com.fasterxml.jackson.module.mrbean.BeanBuilder.TypeDescription propertyType) |
protected void |
createUnimplementedMethod(org.objectweb.asm.ClassWriter cw,
String internalClassName,
Method method)
Builder for methods that just throw an exception, basically "unsupported
operation" implementation.
|
protected String |
decap(String name) |
protected POJOProperty |
findProperty(String propName) |
protected static void |
generateDefaultConstructor(org.objectweb.asm.ClassWriter cw,
String superName)
NOTE: only static because it is needed from TypeDetector
|
protected String |
getInternalClassName(String className) |
protected String |
getPropertyName(String methodName) |
protected boolean |
hasConcreteOverride(Method m0,
Class<?> implementedType)
Helper method used to detect if an abstract method found in a base class
may actually be implemented in a (more) concrete sub-class.
|
BeanBuilder |
implement(boolean failOnUnrecognized) |
protected static boolean |
returnsBoolean(Method m) |
protected Map<String,POJOProperty> _beanProperties
protected LinkedHashMap<String,Method> _unsupportedMethods
protected final Class<?> _implementedType
protected final com.fasterxml.jackson.databind.type.TypeFactory _typeFactory
public BeanBuilder(Class<?> implType, com.fasterxml.jackson.databind.type.TypeFactory tf)
public BeanBuilder implement(boolean failOnUnrecognized)
failOnUnrecognized
- If true, and an unrecognized (non-getter, non-setter)
method is encountered, will throw IllegalArgumentException
; if false,
will implement bogus method that will throw UnsupportedOperationException
if called.public byte[] build(String className)
className
- Fully-qualified name of the class to generateprotected boolean hasConcreteOverride(Method m0, Class<?> implementedType)
protected void addGetter(Method m)
protected void addSetter(Method m)
protected POJOProperty findProperty(String propName)
protected static final boolean returnsBoolean(Method m)
protected static void generateDefaultConstructor(org.objectweb.asm.ClassWriter cw, String superName)
protected void createField(org.objectweb.asm.ClassWriter cw, POJOProperty prop, com.fasterxml.jackson.module.mrbean.BeanBuilder.TypeDescription type)
protected void createSetter(org.objectweb.asm.ClassWriter cw, String internalClassName, POJOProperty prop, com.fasterxml.jackson.module.mrbean.BeanBuilder.TypeDescription propertyType)
protected void createGetter(org.objectweb.asm.ClassWriter cw, String internalClassName, POJOProperty prop, com.fasterxml.jackson.module.mrbean.BeanBuilder.TypeDescription propertyType)
protected void createUnimplementedMethod(org.objectweb.asm.ClassWriter cw, String internalClassName, Method method)
Copyright © 2014–2016 FasterXML. All rights reserved.