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 MungedClass |
m_directMungedClass
Munged version of target class (
null if target class
completely unmodifiable). |
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 (may be same as
m_directMungedClass . |
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 dmunge,
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 dmunge,
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.
|
ClassFile |
getDirectMungedFile()
Get direct munged class file information, if available.
|
private static MungedClass |
getGenericMunge()
Get the generic munge class.
|
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.
|
boolean |
isLimitedDirectAccess()
Check if class being changed directly with restrictions.
|
static void |
reset()
Discard cached information and reset in preparation for a new binding
run.
|
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_directMungedClass
null
if target class
completely unmodifiable).private final MungedClass m_mungedClass
m_directMungedClass
.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 dmunge, MungedClass munge)
bound
- target class file informationdmunge
- information for bound class (null
if not
modifiable)munge
- class file for class hosting generated code (may be same as
dmunge
public ClassFile getClassFile()
public java.lang.String getClassName()
public ClassFile getDirectMungedFile()
public ClassFile getMungedFile()
public boolean isDirectAccess()
true
if bound class is being modified,
false
if using a surrogatepublic boolean isLimitedDirectAccess()
true
if bound class can be modified directly with
basic binding information, 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 nameprivate static BoundClass createInstance(java.lang.String key, ClassFile bound, MungedClass dmunge, MungedClass munge)
key
- text identifier for this bound class and munged class
combinationbound
- class information for bound classdmunge
- information for bound class (null
if not
modifiable)munge
- information for class receiving generated code (may be the
same as dmunge
private 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 errorprivate static MungedClass getGenericMunge() throws JiBXException
JiBXException
public 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)
null
values for unknown parameters that may later be overridden.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