org.codehaus.mojo.idlj
Class IdljTranslator

java.lang.Object
  extended by org.codehaus.mojo.idlj.AbstractTranslator
      extended by org.codehaus.mojo.idlj.IdljTranslator
All Implemented Interfaces:
CompilerTranslator

public class IdljTranslator
extends AbstractTranslator
implements CompilerTranslator

This class implement the CompilerTranslator for the Sun idlj IDL compiler

Version:
$Id: IdljTranslator.java 9344 2009-04-03 22:25:02Z aheritier $
Author:
Anders Hessellund Jensen

Constructor Summary
IdljTranslator()
          Default constructor
 
Method Summary
static String fixSeparator(String filename)
          Convert the provided filename from a Windows separator \\ to a unix/java separator /
static String getCanonicalPath(File file)
           
 void invokeCompiler(String sourceDirectory, File[] includeDirs, String targetDirectory, String idlFile, Source source)
          This method it's used to invoke the compiler
static String toRelativeAndFixSeparator(File fromdir, File todir, boolean replaceSlashesWithDashes)
          Taken from maven-eclipse-plugin
 
Methods inherited from class org.codehaus.mojo.idlj.AbstractTranslator
getLog, isDebug, isFailOnError, setDebug, setFailOnError, setLog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.codehaus.mojo.idlj.CompilerTranslator
setDebug, setFailOnError, setLog
 

Constructor Detail

IdljTranslator

public IdljTranslator()
Default constructor

Method Detail

invokeCompiler

public void invokeCompiler(String sourceDirectory,
                           File[] includeDirs,
                           String targetDirectory,
                           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 tag available in the configuration tree of the maven plugin
Throws:
org.apache.maven.plugin.MojoExecutionException - the exception is thrown whenever the compilation fails or crashes
See Also:
CompilerTranslator#invokeCompiler(String, List, String, String, Source)

fixSeparator

public static String fixSeparator(String filename)
Convert the provided filename from a Windows separator \\ to a unix/java separator /

Parameters:
filename - file name to fix separator
Returns:
filename with all \\ replaced with /

getCanonicalPath

public static String getCanonicalPath(File file)
                               throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

toRelativeAndFixSeparator

public static String toRelativeAndFixSeparator(File fromdir,
                                               File todir,
                                               boolean replaceSlashesWithDashes)
                                        throws org.apache.maven.plugin.MojoExecutionException
Taken from maven-eclipse-plugin

Parameters:
fromdir -
todir -
replaceSlashesWithDashes -
Returns:
the relative path between fromdir to todir
Throws:
org.apache.maven.plugin.MojoExecutionException


Copyright © 2005-2011 Codehaus. All Rights Reserved.