Class InsertAjavaAnnotations
java.lang.Object
org.checkerframework.framework.ajava.InsertAjavaAnnotations
This program inserts annotations from an ajava file into a Java file. See
main(java.lang.String[])
.-
Constructor Summary
ConstructorDescriptionInsertAjavaAnnotations
(Elements elements) Constructs anInsertAjavaAnnotations
using the givenElements
instance. -
Method Summary
Modifier and TypeMethodDescriptioninsertAnnotations
(InputStream annotationFile, String javaFileContents, String lineSeparator) Inserts all annotations from the ajava file read fromannotationFile
into a Java file with contentsjavaFileContents
that uses the given line separator and returns the resulting String.void
insertAnnotations
(String annotationFilePath, String javaFilePath) Inserts all annotations from the ajava file atannotationFilePath
intojavaFilePath
.static void
Inserts annotations from ajava files into Java files in place.
-
Constructor Details
-
InsertAjavaAnnotations
Constructs anInsertAjavaAnnotations
using the givenElements
instance.- Parameters:
elements
- an instance ofElements
-
-
Method Details
-
insertAnnotations
public String insertAnnotations(InputStream annotationFile, String javaFileContents, String lineSeparator) Inserts all annotations from the ajava file read fromannotationFile
into a Java file with contentsjavaFileContents
that uses the given line separator and returns the resulting String.- Parameters:
annotationFile
- input stream for an ajava file forjavaFileContents
javaFileContents
- contents of a Java file to insert annotations intolineSeparator
- the line separatorjavaFileContents
uses- Returns:
- a modified
javaFileContents
with annotations fromannotationFile
inserted
-
insertAnnotations
Inserts all annotations from the ajava file atannotationFilePath
intojavaFilePath
.- Parameters:
annotationFilePath
- path to an ajava filejavaFilePath
- path to a Java file to insert annotation into
-
main
Inserts annotations from ajava files into Java files in place.The first argument is an ajava file or a directory containing ajava files.
The second argument is a Java file or a directory containing Java files to insert annotations into.
For each Java file, checks if any ajava files from the first argument match it. For each such ajava file, inserts all its annotations into the Java file.
- Parameters:
args
- command line arguments: the first element should be a path to ajava files and the second should be the directory containing Java files to insert into
-