|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jibx.binding.classes.MungedClass
public class MungedClass
Modifiable class handler. Each instance controls changes to a particular class modified by one or more binding definitions. As methods are generated they're checked for uniqueness. If an already-generated method is found with the same characteristics (including byte code) as the one being generated, the already-generated is used instead.
Nested Class Summary | |
---|---|
private static class |
MungedClass.JiBXFilter
Filter for class files generated by JiBX. |
Field Summary | |
---|---|
private static java.lang.String |
BINDING_LISTNAME
Name for list of binding factory names. |
private static ClassFile[] |
EMPTY_CLASSFILE_ARRAY
Empty class file array. |
private static java.lang.String[] |
EXTRA_METHODS_MATCHES
Name and signature for generated methods without standard prefix. |
private ClassFile |
m_classFile
Munged class file information. |
private ExistingMethod[] |
m_existingMethods
Existing binding methods in class. |
private java.lang.String |
m_factoryList
List of factory names for this class. |
private java.util.HashMap |
m_methodMap
Map from method byte code and signature to method item. |
private static java.util.ArrayList |
s_classes
Munged class information. |
private static java.util.HashMap |
s_classMap
Map from generated class to binding information. |
private static java.util.HashMap |
s_directories
Map of directories already checked for JiBX classes. |
private static java.util.HashMap |
s_nameMap
Map from class name to binding information. |
private static java.util.ArrayList |
s_pendingClasses
Munged classes to be unique-added at end of binding. |
Constructor Summary | |
---|---|
private |
MungedClass(ClassFile cf)
Constructor. |
Method Summary | |
---|---|
(package private) void |
addFactory(java.lang.String fact)
Add binding factory to class. |
(package private) static void |
checkDirectory(java.io.File root,
java.lang.String pack)
Check directory for JiBX generated files. |
static void |
delayedAddUnique(ClassFile cf)
Add unique support class at end of binding process. |
static ClassFile[][] |
fixChanges(boolean write)
Finalize changes to modified class files. |
(package private) ClassFile |
getClassFile()
Get munged class file information. |
(package private) static MungedClass |
getInstance(ClassFile cf)
Get modification tracking information for class. |
(package private) BindingMethod |
getUniqueMethod(MethodBuilder builder,
boolean suffix)
Get unique method. |
static ClassFile |
getUniqueSupportClass(ClassFile cf)
Get unique generated support class. |
private void |
purgeUnusedMethods()
Delete pre-existing binding methods that are no longer needed. |
static void |
reset()
Discard cached information and reset in preparation for a new binding run. |
(package private) void |
setFactoryList()
Generate factory list. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final ClassFile[] EMPTY_CLASSFILE_ARRAY
private static final java.lang.String BINDING_LISTNAME
private static final java.lang.String[] EXTRA_METHODS_MATCHES
private static java.util.ArrayList s_classes
private static java.util.HashMap s_classMap
private static java.util.HashMap s_directories
private static java.util.HashMap s_nameMap
private static java.util.ArrayList s_pendingClasses
private ClassFile m_classFile
private java.util.HashMap m_methodMap
private ExistingMethod[] m_existingMethods
private java.lang.String m_factoryList
Constructor Detail |
---|
private MungedClass(ClassFile cf)
cf
- owning class file informationMethod Detail |
---|
ClassFile getClassFile()
private void purgeUnusedMethods() throws JiBXException
JiBXException
- on configuration errorBindingMethod getUniqueMethod(MethodBuilder builder, boolean suffix) throws JiBXException
builder
- method to be definedsuffix
- append name suffix to assure uniqueness flag
JiBXException
- on configuration errorpublic static ClassFile getUniqueSupportClass(ClassFile cf)
cf
- generated class file
static void checkDirectory(java.io.File root, java.lang.String pack) throws JiBXException
root
- class path root for directorypack
- package relative to root directory
JiBXException
- on configuration errorvoid addFactory(java.lang.String fact)
fact
- binding factory namevoid setFactoryList() throws JiBXException
JiBXException
- on configuration errorstatic MungedClass getInstance(ClassFile cf) throws JiBXException
cf
- information for class to be modified (must be writable)
JiBXException
- on configuration errorpublic static void delayedAddUnique(ClassFile cf)
fixChanges(boolean)
handling.
cf
- class file to be added as unique support class at end of
bindingpublic static ClassFile[][] fixChanges(boolean write) throws JiBXException
write
- replace original class files with modified versions
JiBXException
- on write errorpublic static void reset()
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |