public class IdljTranslator extends AbstractTranslator implements CompilerTranslator
CompilerTranslator for the Sun idlj IDL compilerAbstractTranslator.ClassLoaderFacade, AbstractTranslator.ClassLoaderFacadeImpl| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
AIX_IDLJ_COMPILER_NAME |
private static java.lang.String |
ORACLE_IDLJ_COMPILER_NAME |
| Constructor and Description |
|---|
IdljTranslator()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
private void |
addToolsJarToPath() |
static java.lang.String |
fixSeparator(java.lang.String filename)
Convert the provided filename from a Windows separator \\ to a unix/java separator /
|
static java.lang.String |
getCanonicalPath(java.io.File file)
Return the unique path to the resource.
|
private java.lang.Class<?> |
getCompilerClass() |
private static java.lang.String |
getIDLCompilerClassName() |
private java.lang.String |
getToolsJarPath() |
private void |
invokeCompiler(java.lang.Class<?> compilerClass,
java.util.List<java.lang.String> args)
Invoke the specified compiler with a set of arguments
|
void |
invokeCompiler(java.lang.String sourceDirectory,
java.io.File[] includeDirs,
java.lang.String targetDirectory,
java.lang.String idlFile,
Source source)
This method it's used to invoke the compiler
|
private static boolean |
isAix() |
private boolean |
isMacOSX() |
private boolean |
isOptionEnabled(java.lang.Boolean option) |
protected int |
runCompiler(java.lang.Class<?> compilerClass,
java.lang.String... arguments)
Runs the IDL compiler
|
static java.lang.String |
toRelativeAndFixSeparator(java.io.File fromdir,
java.io.File todir,
boolean replaceSlashesWithDashes)
Taken from maven-eclipse-plugin
|
getClassLoaderFacade, getLog, invokeCompilerInProcess, isDebug, isFailOnError, isFork, setClassLoaderFacade, setDebug, setFailOnError, setLogclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetDebug, setFailOnError, setLogprivate static final java.lang.String AIX_IDLJ_COMPILER_NAME
private static final java.lang.String ORACLE_IDLJ_COMPILER_NAME
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
invokeCompiler in interface CompilerTranslatorsourceDirectory - the path to the sourcesincludeDirs - the File[] of directories where to find the includestargetDirectory - the path to the destination of the compilationidlFile - the path to the file to compilesource - the source tag available in the configuration tree of the maven pluginorg.apache.maven.plugin.MojoExecutionException - the exception is thrown whenever the compilation fails or crashesprivate boolean isOptionEnabled(java.lang.Boolean option)
private java.lang.Class<?> getCompilerClass()
throws org.apache.maven.plugin.MojoExecutionException
Class that implements the idlj compilerorg.apache.maven.plugin.MojoExecutionException - if the search for the class failsprivate void addToolsJarToPath()
throws java.net.MalformedURLException,
java.lang.ClassNotFoundException
java.net.MalformedURLExceptionjava.lang.ClassNotFoundExceptionprivate java.lang.String getToolsJarPath()
private boolean isMacOSX()
private static boolean isAix()
private static java.lang.String getIDLCompilerClassName()
private void invokeCompiler(java.lang.Class<?> compilerClass,
java.util.List<java.lang.String> args)
throws org.apache.maven.plugin.MojoExecutionException
compilerClass - the Class that implements the compilerargs - a List that contains the arguments to use for the compilerorg.apache.maven.plugin.MojoExecutionException - if the compilation fail or the compiler crashesprotected int runCompiler(java.lang.Class<?> compilerClass,
java.lang.String... arguments)
throws java.lang.NoSuchMethodException,
java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException
AbstractTranslatorrunCompiler in class AbstractTranslatorcompilerClass - the class which implements the compilerarguments - the arguments to pass to the compilerjava.lang.NoSuchMethodException - if the method which should run the compiler does not existjava.lang.IllegalAccessException - if no constructor is availablejava.lang.reflect.InvocationTargetException - if an error occurs while invoking the compilerpublic static java.lang.String fixSeparator(java.lang.String filename)
filename - file name to fix separatorpublic static java.lang.String getCanonicalPath(java.io.File file)
throws org.apache.maven.plugin.MojoExecutionException
file - a resource to locateorg.apache.maven.plugin.MojoExecutionException - if the infrastructure detects a problempublic static java.lang.String toRelativeAndFixSeparator(java.io.File fromdir,
java.io.File todir,
boolean replaceSlashesWithDashes)
throws org.apache.maven.plugin.MojoExecutionException
fromdir - not suretodir - what these arereplaceSlashesWithDashes - true if we need to replace slashes with dashes to accomodate the OSorg.apache.maven.plugin.MojoExecutionException - thrown if an error is detected by the mojo infrastructure