Class Compile


  • public class Compile
    extends java.lang.Object
    Binding compiler. This version checks the modified and generated classes by loading them and listing method information.
    Author:
    Dennis M. Sosnoski
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static class  Compile.DirectLoader
      Direct class loader.
    • Constructor Summary

      Constructors 
      Constructor Description
      Compile()
      Default constructor.
      Compile​(boolean verbose1, boolean verbose2, boolean load, boolean verify, boolean track, boolean over)
      Constructor with settings specified.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void compile​(java.lang.String[] paths, java.lang.String[] files)
      Compile a set of bindings using supplied classpaths.
      static void main​(java.lang.String[] args)
      Main method for running compiler as application.
      void setLoad​(boolean load)
      Set control flag for test loading generated/modified classes.
      void setSkipValidate​(boolean skip)
      Set control flag for skipping binding validation.
      void setVerbose​(boolean verbose)
      Set control flag for verbose processing reports.
      void setVerify​(boolean verify)
      Set control flag for verifying generated/modified classes with BCEL.
      private boolean verifyBCEL​(ClassFile file)
      Verify generated and modified files using BCEL verifier.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • m_verbose1

        private boolean m_verbose1
      • m_verbose2

        private boolean m_verbose2
      • m_load

        private boolean m_load
      • m_verify

        private boolean m_verify
      • m_trackBranches

        private boolean m_trackBranches
      • m_errorOverride

        private boolean m_errorOverride
      • m_skipValidate

        private boolean m_skipValidate
    • Constructor Detail

      • Compile

        public Compile()
        Default constructor. This just initializes all options disabled.
      • Compile

        public Compile​(boolean verbose1,
                       boolean verbose2,
                       boolean load,
                       boolean verify,
                       boolean track,
                       boolean over)
        Constructor with settings specified.
        Parameters:
        verbose1 - report binding details and results
        verbose2 - report second pass binding details
        load - test load modified classes to validate
        verify - use BCEL validation of modified classes
        track - keep tracking information for source of branch generation
        over - override code generation error handling
    • Method Detail

      • verifyBCEL

        private boolean verifyBCEL​(ClassFile file)
        Verify generated and modified files using BCEL verifier. This provides a more comprehensive listing of errors than just loading a class in the JVM.
        Parameters:
        file - information for class to be verified
        Returns:
        true if successfully verified, false if problem found (automatically reported)
      • setLoad

        public void setLoad​(boolean load)
        Set control flag for test loading generated/modified classes.
        Parameters:
        load - test load generated/modified classes flag
      • setVerbose

        public void setVerbose​(boolean verbose)
        Set control flag for verbose processing reports.
        Parameters:
        verbose - report verbose information in processing bindings flag
      • setVerify

        public void setVerify​(boolean verify)
        Set control flag for verifying generated/modified classes with BCEL.
        Parameters:
        verify - use BCEL verification for generated/modified classes flag
      • setSkipValidate

        public void setSkipValidate​(boolean skip)
        Set control flag for skipping binding validation. This flag is intended only for use while processing the binding model components within JiBX. Otherwise it'd be impossible to correct errors in the binding validation.
        Parameters:
        skip - test load generated/modified classes flag
      • compile

        public void compile​(java.lang.String[] paths,
                            java.lang.String[] files)
                     throws JiBXException
        Compile a set of bindings using supplied classpaths.
        Parameters:
        paths - list of paths for loading classes
        files - list of binding definition files
        Throws:
        JiBXException - if error in processing the binding definition
      • main

        public static void main​(java.lang.String[] args)
        Main method for running compiler as application.
        Parameters:
        args - command line arguments