public class RIFLTransformer extends Object
transform
reads a RIFL file
and Java sources and writes JML* information flow specifications to the
original Java files.Modifier and Type | Field and Description |
---|---|
private LinkedHashMap<CompilationUnit,String> |
javaCUs |
private static JavaProgramFactory |
JPF |
private SpecificationContainer |
sc |
private Exception |
threadExc |
private XMLReader |
xmlReader |
Modifier | Constructor and Description |
---|---|
private |
RIFLTransformer() |
Modifier and Type | Method and Description |
---|---|
private static String |
convertToFileURL(String filename) |
private void |
doTransform(String riflFilename,
String source,
String savePath) |
private void |
ensureTargetDirExists(String target) |
private static String |
getBaseDirPath(String origSourcePath) |
static String |
getDefaultSavePath(String origSourcePath)
Returns the default save path for transformed Java files.
|
static void |
main(String[] args)
Entry point for the stand-alone RIFL to JML* tool.
|
private void |
readJava(String source) |
private SpecificationContainer |
readRIFL(String fileName) |
static void |
transform(String riflFilename,
String javaSource) |
static void |
transform(String riflFilename,
String javaSource,
KeYRecoderExcHandler kexh) |
static void |
transform(String riflFilename,
String javaSource,
String savePath,
KeYRecoderExcHandler kexh)
Transforms plain Java files + RIFL specification to Java+JML* specifications.
|
private void |
writeJavaFile(String target,
String fileName,
CompilationUnit cu)
Writes a single Java file.
|
private static final JavaProgramFactory JPF
private final XMLReader xmlReader
private final LinkedHashMap<CompilationUnit,String> javaCUs
private SpecificationContainer sc
private Exception threadExc
private RIFLTransformer() throws ParserConfigurationException, SAXException
public static void main(String[] args)
public static void transform(String riflFilename, String javaSource, String savePath, KeYRecoderExcHandler kexh)
riflFilename
- path to a RIFL filejavaSource
- path to Java sources (should be a directory)savePath
- custom save pathkexh
- public static void transform(String riflFilename, String javaSource, KeYRecoderExcHandler kexh)
public static String getDefaultSavePath(String origSourcePath)
origSourcePath
- path to a directory or single Java fileprivate void readJava(String source) throws IOException, ParserException
IOException
ParserException
private SpecificationContainer readRIFL(String fileName) throws IOException, SAXException
IOException
SAXException
private void doTransform(String riflFilename, String source, String savePath) throws IOException, SAXException, ParserException
IOException
SAXException
ParserException
private void ensureTargetDirExists(String target) throws IOException
IOException
private void writeJavaFile(String target, String fileName, CompilationUnit cu) throws IOException
IOException