public class NameMappingWorker.Library
extends java.lang.Object
Constructor and Description |
---|
Library() |
Modifier and Type | Method and Description |
---|---|
void |
addMapping(java.lang.String progname,
java.lang.String javaname)
Add a Progress to Java source file name entry to the mapping
database.
|
void |
addSignature(java.lang.String progname,
java.util.ArrayList list)
Add the external procedure's parameter signature to the signature
database.
|
boolean |
classNameExists(java.lang.String pkg,
java.lang.String name)
Utility function which checks if a class name is registered in the given package location
as a converted class.
|
java.lang.String |
getParameterType(java.lang.String progname,
int index)
Determine the type of the given Progress external procedure's
parameter at a given index.
|
java.util.ArrayList |
getSignature(java.lang.String progname)
Obtain the parameter list for the given Progress external procedure.
|
void |
initSourceNameMapper()
Force the external initialization of the
SourceNameMapper class such that it can be used
during conversion for resolving a Java class name from the
Progress source file name. |
boolean |
isMapped(java.lang.String progname)
Determine if a Progress to Java source file name mapping exists in
the database.
|
boolean |
isVoid(java.lang.String progname)
Determine if a Progress external procedure has a
void
signature (has no parameters). |
void |
restoreMappings(java.lang.String filename)
Restore the name mapping data from the given file using
serialization.
|
void |
saveMappings(java.lang.String filename)
Save the name mapping data into the given file using serialization.
|
int |
size()
Returns the number of mappings in the database.
|
public void addMapping(java.lang.String progname, java.lang.String javaname)
progname
- Progress source file name in relative path form.javaname
- Java class name.public void addSignature(java.lang.String progname, java.util.ArrayList list)
progname
- Progress source file name in relative path form.list
- List of parameter class names (each entry is a wrapper
type) in proper parameter order.public boolean isMapped(java.lang.String progname)
progname
- Progress source file name in relative path form.true
if the mapping exists.public boolean isVoid(java.lang.String progname)
void
signature (has no parameters).progname
- Progress source file name in relative path form.true
if the signature mapping DOES NOT exist
or if the mapping exists but the length is 0.public java.lang.String getParameterType(java.lang.String progname, int index)
progname
- Progress source file name in relative path form.null
if the signature mapping DOES NOT exist
or if the mapping exists but there is no parameter at the
given index.public java.util.ArrayList getSignature(java.lang.String progname)
progname
- Progress source file name in relative path form.null
if the
signature mapping DOES NOT exist.public int size()
public void saveMappings(java.lang.String filename) throws java.io.FileNotFoundException, java.io.IOException
filename
- The file in which to write the name mappings.java.io.FileNotFoundException
java.io.IOException
public void restoreMappings(java.lang.String filename) throws java.io.FileNotFoundException, java.io.IOException, java.lang.ClassNotFoundException
filename
- The file from which to read the name mappings.java.io.FileNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public void initSourceNameMapper()
SourceNameMapper
class such that it can be used
during conversion for resolving a Java class name from the
Progress source file name. Note that only the method
convertName
can work properly as only a subset of the
mapping data is being loaded into the SourceNameMapper
class.public boolean classNameExists(java.lang.String pkg, java.lang.String name)
pkg
- The package in which we want to check if there is any class by the given name.name
- The class name we want to check for existence.true
if a class with that name exists in the given
package or false
otherwise.