Class JacorbTranslator

    • Constructor Detail

      • JacorbTranslator

        JacorbTranslator()
        Default constructor
    • Method Detail

      • invokeCompiler

        private void invokeCompiler​(java.lang.Class<?> compilerClass,
                                    java.util.List<java.lang.String> args)
                             throws org.apache.maven.plugin.MojoExecutionException
        Invoke the specified compiler with a set of arguments
        Parameters:
        compilerClass - the Class that implements the compiler
        args - a List that contains the arguments to use for the compiler
        Throws:
        org.apache.maven.plugin.MojoExecutionException - if the compilation fail or the compiler crashes
      • runCompiler

        protected int runCompiler​(java.lang.Class<?> compilerClass,
                                  java.lang.String... arguments)
                           throws java.lang.NoSuchMethodException,
                                  java.lang.IllegalAccessException,
                                  java.lang.reflect.InvocationTargetException
        Description copied from class: AbstractTranslator
        Runs the IDL compiler
        Specified by:
        runCompiler in class AbstractTranslator
        Parameters:
        compilerClass - the class which implements the compiler
        arguments - the arguments to pass to the compiler
        Returns:
        the return status (a non-zero value indicates an error)
        Throws:
        java.lang.NoSuchMethodException - if the method which should run the compiler does not exist
        java.lang.IllegalAccessException - if no constructor is available
        java.lang.reflect.InvocationTargetException - if an error occurs while invoking the compiler
      • invokeCompiler

        public void invokeCompiler​(java.lang.String sourceDirectory,
                                   java.io.File[] includeDirs,
                                   java.lang.String targetDirectory,
                                   java.lang.String idlFile,
                                   Source source)
                            throws org.apache.maven.plugin.MojoExecutionException
        This method it's used to invoke the compiler
        Specified by:
        invokeCompiler in interface CompilerTranslator
        Parameters:
        sourceDirectory - the path to the sources
        includeDirs - the File[] of directories where to find the includes
        targetDirectory - the path to the destination of the compilation
        idlFile - the path to the file to compile
        source - the source set on which to run the compiler
        Throws:
        org.apache.maven.plugin.MojoExecutionException - the exeception is thrown whenever the compilation fails or crashes
      • redirectStream

        private static void redirectStream​(java.io.InputStream in,
                                           java.io.OutputStream out)
        This methos it's used to redirect an InputeStream to a OutputStream
        Parameters:
        in - the InputStream to read from
        out - the OutputStream to write into