org.vishia.java2C
Class JavaSrcTreeGetter

java.lang.Object
  extended by org.vishia.java2C.JavaSrcTreeGetter

public class JavaSrcTreeGetter
extends java.lang.Object

This class is a helper to get the java source tree from given class path. The class may be used only temporary, it is wrapped around its method JavaSrcTreeGetter#gatherAllJavaSrcFiles(JavaFolder, List). The usage is (new JavaSrcTreeGetter(report)).captureAllJavaSrcFiles(dst, src).


Field Summary
private  Report console
           
private  java.io.FileFilter dirFilter
           
private  JavaSources dstJavaSrcData
          Aggregation to the Instance, which stores the produced data while call of #captureAllJavaSrcFiles(List, JavaSrcTreePkg, List).
private  ConfigSrcPathPkg_ifc inputCfg
           
private  java.io.FileFilter javaFileFilter
           
private  java.util.List<java.lang.String> listInputToTranslate
           
 
Constructor Summary
JavaSrcTreeGetter(JavaSources dstJavaSrcData, ConfigSrcPathPkg_ifc inputCfg, java.util.List<java.lang.String> listInputToTranslate, Report console)
          Constructs an instance, which should be used only temporary to capture the tree.
 
Method Summary
private  void captureAllJavaSrcFilesRecursive(LocalIdents identsToAssignPkgIdents, java.io.File dirPkg, JavaSrcTreePkg dstParent, java.lang.String sPkgPathParent, java.lang.String javaSrcPath, boolean bTranslatePkg)
          Captures the package folders and java files of the given file directory level.
 void gatherAllJavaSrcFiles(LocalIdents identsToAssignFirstPkgIdents, java.util.List<java.lang.String> listJavaSrcpath)
          Captures all Java Files, which are found at file system in all given Java Source pathes evaluates the content of ConfigSrcPathPkg_ifc (association given on constructor) and sets respectively completes the input files.
private  void reportAllJavaSrcFiles(JavaSrcTreePkg javaPkgParent)
           
(package private)  void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

console

private final Report console

inputCfg

private final ConfigSrcPathPkg_ifc inputCfg

dstJavaSrcData

private final JavaSources dstJavaSrcData
Aggregation to the Instance, which stores the produced data while call of #captureAllJavaSrcFiles(List, JavaSrcTreePkg, List).


listInputToTranslate

private final java.util.List<java.lang.String> listInputToTranslate

javaFileFilter

private java.io.FileFilter javaFileFilter

dirFilter

private java.io.FileFilter dirFilter
Constructor Detail

JavaSrcTreeGetter

public JavaSrcTreeGetter(JavaSources dstJavaSrcData,
                         ConfigSrcPathPkg_ifc inputCfg,
                         java.util.List<java.lang.String> listInputToTranslate,
                         Report console)
Constructs an instance, which should be used only temporary to capture the tree.

Parameters:
inputCfg - Association to the instance, which knows the assignment between Java-Packages and C-Pre- and Suffixes.
console -
Method Detail

gatherAllJavaSrcFiles

public void gatherAllJavaSrcFiles(LocalIdents identsToAssignFirstPkgIdents,
                                  java.util.List<java.lang.String> listJavaSrcpath)
                           throws java.text.ParseException
Captures all Java Files, which are found at file system in all given Java Source pathes evaluates the content of ConfigSrcPathPkg_ifc (association given on constructor) and sets respectively completes the input files. Uses the inputCfg aggregation to get the source path and the package replacement

Parameters:
javaSrcTree - The destination, it should be an empty List before.
listJavaSrcpath - List of all source pathes. The list won't be changed here.
listInputToTranslate - List of all sources to translate. The list won't be changed here.
Throws:
java.text.ParseException

captureAllJavaSrcFilesRecursive

private void captureAllJavaSrcFilesRecursive(LocalIdents identsToAssignPkgIdents,
                                             java.io.File dirPkg,
                                             JavaSrcTreePkg dstParent,
                                             java.lang.String sPkgPathParent,
                                             java.lang.String javaSrcPath,
                                             boolean bTranslatePkg)
                                      throws java.text.ParseException
Captures the package folders and java files of the given file directory level. Creates a JavaSrcTreeFile for all found files, but not if the FileInfo exists already. It exists, if the file is found in another source-path already or if it is defined in the CRuntimeJavalikeClassData or it is defined by a package.file-replacement in the config-file, see Java2C_Main.inputCfg.

Parameters:
identsToAssignPkgIdents -
dirPkg - The directory in file tree for package.
dstParent - write packages and files into it.
sPkgPathParent - package path with / as separator and at end for the given level
javaSrcPath - The source path which is captured yet. Path before package tree.
bTranslatePkg -
Throws:
java.text.ParseException

reportAllJavaSrcFiles

private void reportAllJavaSrcFiles(JavaSrcTreePkg javaPkgParent)

stop

void stop()