|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jibx.binding.classes.BoundClass
public class BoundClass
Bound class handler. Each instance controls and organizes information for a class included in one or more binding definitions.
Field Summary | |
---|---|
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. |
Constructor Summary | |
---|---|
private |
BoundClass(ClassFile bound,
MungedClass munge)
Constructor. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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).
Constructor Detail |
---|
private BoundClass(ClassFile bound, MungedClass munge)
bound
- target class file informationmunge
- class file for class hosting generated codeMethod Detail |
---|
public 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 required
JiBXException
- on configuration errorpublic ClassItem getStoreMethod(ClassItem item, ClassFile from) throws JiBXException
item
- field or method to be accessedfrom
- context class from which access is required
JiBXException
- on configuration errorpublic BindingMethod getUniqueMethod(MethodBuilder builder) throws JiBXException
builder
- method to be defined
JiBXException
- on configuration errorpublic BindingMethod getUniqueNamed(MethodBuilder builder) throws JiBXException
builder
- method to be defined
JiBXException
- 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 class
private static BoundClass findOrCreateInstance(ClassFile bound, MungedClass munge)
bound
- class information for bound classmunge
- information for surrogate class receiving generated code
public static BoundClass getInstance(ClassFile cf, BoundClass context) throws JiBXException
cf
- bound class informationcontext
- context class for code generation, or null
if no context
JiBXException
- 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 context
JiBXException
- 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
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |