Class MungedClass


  • public class MungedClass
    extends Object
    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.
    Author:
    Dennis M. Sosnoski
    • Method Detail

      • getUniqueSupportClass

        public static ClassFile getUniqueSupportClass​(ClassFile cf)
        Get unique generated support class. Allows tracking of all generated classes for common handling with the bound classes. Each generated support class is associated with a particular bound class.
        Parameters:
        cf - generated class file
        Returns:
        unique class file information
      • delayedAddUnique

        public static void delayedAddUnique​(ClassFile cf)
        Add unique support class at end of binding process. This allows a class to be constructed in steps during handling of one or more bindings, with the class finished and checked for uniqueness only after all bindings have been handled. The actual add of the class is done during the fixDispositions() handling.
        Parameters:
        cf - class file to be added as unique support class at end of binding
      • addModifiedClass

        public static void addModifiedClass​(ClassFile cf)
        Add class file to set modified. This uses the class name as a identifier to prevent duplicate entries in the list, so that classes which are still under construction can be handled.
        Parameters:
        cf - Class file
      • fixDispositions

        public static ClassFile[][] fixDispositions()
        Finalize class name assignments and dispositions.
        Returns:
        three-way array of class files, for modified, unchanged, and deleted
      • writeChanges

        public static void writeChanges()
                                 throws org.jibx.runtime.JiBXException
        Write all modified class files, and delete all obsolete class files from previous runs of the binding compiler.
        Throws:
        org.jibx.runtime.JiBXException - on write error
      • reset

        public static void reset()
        Discard cached information and reset in preparation for a new binding run.