public class JavaSrcTreePkg extends java.lang.Object implements org.vishia.util.SortedTree<JavaSrcTreePkg>, JavaSources.ClassDataOrJavaSrcFile
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
sVersion
Version, history and license.
|
Constructor and Description |
---|
JavaSrcTreePkg(JavaSrcTreePkg parent,
java.lang.String pkgPath,
java.lang.String pkgName,
ConfigSrcPathPkg_ifc.Set replaceCinfo) |
Modifier and Type | Method and Description |
---|---|
JavaSrcTreePkg |
getChild(java.lang.String key)
Searches the first child with given key from the given node this.
|
org.vishia.java2C.ClassData |
getClassData()
Returns the ClassData of the instance, or
null . |
JavaSrcTreePkg |
getJavaPkg()
|
JavaSrcTreeFile |
getJavaSrc()
|
LocalIdents |
getLocalIdents(java.lang.String sPkgName)
Returns the identifier of classes or packages, which are available in this package.
|
JavaSrcTreePkg |
getOrAddPkg(java.lang.String pkgPath,
java.lang.String pkgName,
ConfigSrcPathPkg_ifc.Set replaceCinfo)
returns the Instance, which represents the given package name.
|
JavaSrcTreePkg |
getParent() |
LocalIdents |
getPkgLevelIdents()
gets the pkg-level-idents.
|
java.lang.String |
getPkgPath() |
java.util.List<JavaSources.ClassDataOrJavaSrcFile> |
getPublicClasses() |
ConfigSrcPathPkg_ifc.Set |
getReplaceCinfo()
Returns the informations to find out where the C-file is found and which pre/suffix are valid.
|
java.lang.String |
getTypeName()
|
boolean |
isToTranslate()
returns false because a package isn't to translate.
|
java.util.Iterator<JavaSrcTreePkg> |
iterChildren()
Returns an iterator through the list of all children of the node.
|
java.util.Iterator<JavaSrcTreePkg> |
iterChildren(java.lang.String key)
Returns an iterator through the list of all children with the given key.
|
java.util.List<JavaSrcTreePkg> |
listChildren()
Returns a List of all children of the node.
|
java.util.List<JavaSrcTreePkg> |
listChildren(java.lang.String key)
Returns a List of all children with the given key.
|
void |
putClassType(org.vishia.java2C.ClassData data)
Adds the given type info to the pkgIdents.
|
void |
reportClasses(org.vishia.mainCmd.Report report) |
void |
setClassData(org.vishia.java2C.ClassData data) |
org.vishia.java2C.ClassData |
setFileAndReadStcFile(java.lang.String sClassname,
ConfigSrcPathPkg_ifc.Set info,
java.lang.String stcPath)
Registers a Java class inside the given package and reads the associated stc file.
|
JavaSources.ClassDataOrJavaSrcFile |
setFileJava(java.lang.String javaSrcPath,
java.io.File fileJava,
java.lang.String sFileNameJava,
ConfigSrcPathPkg_ifc.Set info,
java.lang.String stcPath,
boolean translateToC)
Registers the occurrence of a found Java file or set the
ConfigSrcPathPkg_ifc.Set
for an existing file without replaceCinfo |
java.lang.String |
toString() |
void |
xxxaddStdTypes(LocalIdents types)
Adds all standard types to the package.
|
java.util.TreeMap<java.lang.String,JavaSrcTreeFile> |
XXXgetJavaFiles() |
public static final java.lang.String sVersion
setFileJava(String, File, String, org.vishia.java2C.ConfigSrcPathPkg_ifc.Set, String, boolean)
not used arguments removed.
The arguments String prefixCFile, String suffixCFile, String prefixNames, String suffixNames
are contained
in the ConfigSrcPathPkg_ifc.Set info
already.
setFileAndReadStcFile(String, org.vishia.java2C.ConfigSrcPathPkg_ifc.Set, String)
. This is one method which reads
all information about a Java class from a existing stc file, especially used for C-written parts read in CRuntimeJavalikeClassData
.
public JavaSrcTreePkg(JavaSrcTreePkg parent, java.lang.String pkgPath, java.lang.String pkgName, ConfigSrcPathPkg_ifc.Set replaceCinfo)
pkgIdent
- javaSrcPath
- public JavaSrcTreePkg getOrAddPkg(java.lang.String pkgPath, java.lang.String pkgName, ConfigSrcPathPkg_ifc.Set replaceCinfo)
replaceCinfo
is null,
then the given parameter replaceCinfo is used to set it.
If the replaceCinfo
was given before, and the parameter replaceCinfo is given here too,
it is tested whether it contains the same. Elsewhere a IllegalArgumentException is thrown.pkgPath
- The full path from rootpkgName
- The name of the new packagereplaceCinfo
- if not null, then it is the info to build the C-files /search the stc-file
for all non-existing, but needed Java-files of the package.public void putClassType(org.vishia.java2C.ClassData data)
data
- The type info.public java.lang.String getPkgPath()
public final java.util.TreeMap<java.lang.String,JavaSrcTreeFile> XXXgetJavaFiles()
public final java.util.List<JavaSources.ClassDataOrJavaSrcFile> getPublicClasses()
public void xxxaddStdTypes(LocalIdents types)
types
- public JavaSources.ClassDataOrJavaSrcFile setFileJava(java.lang.String javaSrcPath, java.io.File fileJava, java.lang.String sFileNameJava, ConfigSrcPathPkg_ifc.Set info, java.lang.String stcPath, boolean translateToC)
ConfigSrcPathPkg_ifc.Set
for an existing file without replaceCinfojavaSrcPath
- The source path where the file is found. It may be null for Classes, which are presented by its stc file only.fileJava
- The File instance ready to the open source file. null if javaSrcPath ==null.sFileNameJava
- The file name without path but with extension .java
without directories. The class Name if a stc file will be registered.info
- informations to find out where the C-file is found and which pre/suffix are valid.stcPath
- null or a special path where the stc-file is located.translateToC
- false than the file should not be translate to C,
instead the stc-file should be used any time. This is if it is a standard class
or a users class, which is located in a library.public org.vishia.java2C.ClassData setFileAndReadStcFile(java.lang.String sClassname, ConfigSrcPathPkg_ifc.Set info, java.lang.String stcPath) throws java.text.ParseException
sClassname
- The class nameinfo
- info about the path to C filesstcPath
- Path to stc-File, maybe null if the stc file has the same path then the associated C file with extension .stc.pkgIdents
too, using LocalIdents.getType(String, LocalIdents)
to get it.
The return value is used inside CRuntimeJavalikeClassData
if the ClassData are used there.java.text.ParseException
- on faulty stc file.public void reportClasses(org.vishia.mainCmd.Report report)
public JavaSrcTreePkg getChild(java.lang.String key)
org.vishia.util.SortedTree
getChild
in interface org.vishia.util.SortedTree<JavaSrcTreePkg>
key
- The key of the demanded child. The implementation may have extra possibilities in addressing children
with strings. The sKey can be representing more as a simple string as a attribute in children.
It may be comparable with the ability of XPATH in XML.
But it will be a feature of Implementation and is not defined as a basic feature of this interface.
public LocalIdents getPkgLevelIdents()
public java.util.Iterator<JavaSrcTreePkg> iterChildren()
org.vishia.util.SortedTree
iterChildren
in interface org.vishia.util.SortedTree<JavaSrcTreePkg>
public java.util.Iterator<JavaSrcTreePkg> iterChildren(java.lang.String key)
org.vishia.util.SortedTree
iterChildren
in interface org.vishia.util.SortedTree<JavaSrcTreePkg>
key
- The key of the demanded child. The implementation may have extra possibilities, see getChild(String).public java.util.List<JavaSrcTreePkg> listChildren()
org.vishia.util.SortedTree
listChildren
in interface org.vishia.util.SortedTree<JavaSrcTreePkg>
public java.util.List<JavaSrcTreePkg> listChildren(java.lang.String key)
org.vishia.util.SortedTree
listChildren
in interface org.vishia.util.SortedTree<JavaSrcTreePkg>
key
- The key of the demanded child. The implementation may have extra possibilities, see getChild(String).public org.vishia.java2C.ClassData getClassData()
JavaSources.ClassDataOrJavaSrcFile
null
. If the instance is of type ClassData,
it returns the instance itself. If the instance is of type JavaSrcTreeFile
, it returns
the associated ClassData, if the file is translated yet or the stc-file is read already.
If the file isn't translated, it returns null.getClassData
in interface JavaSources.ClassDataOrJavaSrcFile
public JavaSrcTreeFile getJavaSrc()
getJavaSrc
in interface JavaSources.ClassDataOrJavaSrcFile
public JavaSrcTreePkg getJavaPkg()
getJavaPkg
in interface JavaSources.ClassDataOrJavaSrcFile
public LocalIdents getLocalIdents(java.lang.String sPkgName)
JavaSources.ClassDataOrJavaSrcFile.getLocalIdents(java.lang.String)
getLocalIdents
in interface JavaSources.ClassDataOrJavaSrcFile
sPkgName:
- It is ignored.public java.lang.String getTypeName()
getTypeName
in interface JavaSources.ClassDataOrJavaSrcFile
public java.lang.String toString()
toString
in class java.lang.Object
public ConfigSrcPathPkg_ifc.Set getReplaceCinfo()
JavaSources.ClassDataOrJavaSrcFile
getReplaceCinfo
in interface JavaSources.ClassDataOrJavaSrcFile
public boolean isToTranslate()
isToTranslate
in interface JavaSources.ClassDataOrJavaSrcFile
JavaSources.ClassDataOrJavaSrcFile.isToTranslate()
public void setClassData(org.vishia.java2C.ClassData data)
setClassData
in interface JavaSources.ClassDataOrJavaSrcFile
public JavaSrcTreePkg getParent()
getParent
in interface org.vishia.util.SortedTree<JavaSrcTreePkg>