public class BoundClass
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
ACCESS_PREFIX
Prefix used for access methods.
|
private static Type[] |
EMPTY_TYPE_ARGS
Empty argument type array.
|
private ClassFile |
m_boundClass
Bound class file information.
|
private java.util.HashMap |
m_loadMap
Map from field or method to load access method (lazy create,
null if not used). |
private MungedClass |
m_mungedClass
Class receiving code generated for target class.
|
private java.util.HashMap |
m_storeMap
Map from field or method to store access method (lazy create,
null if not used). |
private static MungedClass |
s_genericMunge
Class used for code generation proxy with unmodifiable classes (lazy
create,
null if not yet needed). |
private static java.lang.String |
s_modifyPackage
Package of first modifiable class.
|
private static java.io.File |
s_modifyRoot
Root for package of first modifiable class.
|
private static java.lang.String |
s_mungeName
Name to be used for code generation proxy class.
|
private static java.util.HashMap |
s_nameMap
Map from bound class name (or bound and munged combination) to binding
information.
|
Modifier | Constructor and Description |
---|---|
private |
BoundClass(ClassFile bound,
MungedClass munge)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addFactory(java.lang.String fact)
Add binding factory to class.
|
private static BoundClass |
createInstance(java.lang.String key,
ClassFile bound,
MungedClass munge)
Create binding information for class.
|
java.lang.String |
deriveClassName(java.lang.String prefix,
java.lang.String suffix)
Derive generated class name for bound class.
|
private static BoundClass |
findOrCreateInstance(ClassFile bound,
MungedClass munge)
Find or create binding information for class.
|
ClassFile |
getClassFile()
Get bound class file information.
|
java.lang.String |
getClassName()
Get bound class file name.
|
static BoundClass |
getInstance(ClassFile cf,
BoundClass context)
Get binding information for class.
|
static BoundClass |
getInstance(java.lang.String name,
BoundClass context)
Get binding information for class.
|
ClassItem |
getLoadMethod(ClassItem item,
ClassFile from)
Get load access method for member of this class.
|
ClassFile |
getMungedFile()
Get munged class file information.
|
ClassItem |
getStoreMethod(ClassItem item,
ClassFile from)
Get store access method for member of this class.
|
BindingMethod |
getUniqueMethod(MethodBuilder builder)
Get unique method.
|
BindingMethod |
getUniqueNamed(MethodBuilder builder)
Get unique method.
|
boolean |
isDirectAccess()
Check if class being changed directly.
|
static void |
reset()
Discard cached information and reset in preparation for a new binding
run.
|
void |
setFactoryList()
Generate factory list.
|
static void |
setModify(java.io.File root,
java.lang.String pkg,
java.lang.String name)
Set override modification information.
|
private static final java.lang.String ACCESS_PREFIX
private static final Type[] EMPTY_TYPE_ARGS
private static java.util.HashMap s_nameMap
private static java.lang.String s_modifyPackage
private static java.io.File s_modifyRoot
private static java.lang.String s_mungeName
private static MungedClass s_genericMunge
null
if not yet needed).private final ClassFile m_boundClass
private final MungedClass m_mungedClass
private java.util.HashMap m_loadMap
null
if not used).private java.util.HashMap m_storeMap
null
if not used).private BoundClass(ClassFile bound, MungedClass munge)
bound
- target class file informationmunge
- class file for class hosting generated codepublic ClassFile getClassFile()
public java.lang.String getClassName()
public ClassFile getMungedFile()
public boolean isDirectAccess()
true
if bound class is being modified,
false
if using a surrogatepublic ClassItem getLoadMethod(ClassItem item, ClassFile from) throws JiBXException
item
- field or method to be accessedfrom
- context class from which access is requiredJiBXException
- on configuration errorpublic ClassItem getStoreMethod(ClassItem item, ClassFile from) throws JiBXException
item
- field or method to be accessedfrom
- context class from which access is requiredJiBXException
- on configuration errorpublic BindingMethod getUniqueMethod(MethodBuilder builder) throws JiBXException
builder
- method to be definedJiBXException
- on configuration errorpublic BindingMethod getUniqueNamed(MethodBuilder builder) throws JiBXException
builder
- method to be definedJiBXException
- on configuration errorpublic void addFactory(java.lang.String fact)
fact
- binding factory namepublic void setFactoryList() throws JiBXException
JiBXException
- on configuration errorprivate static BoundClass createInstance(java.lang.String key, ClassFile bound, MungedClass munge)
key
- text identifier for this bound class and munged class
combinationbound
- class information for bound classmunge
- information for surrogate class receiving generated code, or
null
if no separate classprivate static BoundClass findOrCreateInstance(ClassFile bound, MungedClass munge)
bound
- class information for bound classmunge
- information for surrogate class receiving generated codepublic static BoundClass getInstance(ClassFile cf, BoundClass context) throws JiBXException
cf
- bound class informationcontext
- context class for code generation, or null
if no contextJiBXException
- on configuration errorpublic static BoundClass getInstance(java.lang.String name, BoundClass context) throws JiBXException
name
- fully qualified name of bound classcontext
- context class for code generation, or null
if no contextJiBXException
- on configuration errorpublic static void reset()
public static void setModify(java.io.File root, java.lang.String pkg, java.lang.String name)
root
- classpath root directory for added classespkg
- package for added classesname
- binding namepublic java.lang.String deriveClassName(java.lang.String prefix, java.lang.String suffix)
prefix
- generated class name prefixsuffix
- generated class name suffix