public class InsertAjavaAnnotations extends Object
main(java.lang.String[])
.Constructor and Description |
---|
InsertAjavaAnnotations(Elements elements)
Constructs an
InsertAjavaAnnotations using the given Elements instance. |
Modifier and Type | Method and Description |
---|---|
String |
insertAnnotations(InputStream annotationFile,
String javaFileContents,
String lineSeparator)
Inserts all annotations from the ajava file read from
annotationFile into a Java file
with contents javaFileContents that uses the given line separator and returns the
resulting String. |
void |
insertAnnotations(String annotationFilePath,
String javaFilePath)
Inserts all annotations from the ajava file at
annotationFilePath into javaFilePath . |
static void |
main(String[] args)
Inserts annotations from ajava files into Java files in place.
|
public InsertAjavaAnnotations(Elements elements)
InsertAjavaAnnotations
using the given Elements
instance.elements
- an instance of Elements
public String insertAnnotations(InputStream annotationFile, String javaFileContents, String lineSeparator)
annotationFile
into a Java file
with contents javaFileContents
that uses the given line separator and returns the
resulting String.annotationFile
- input stream for an ajava file for javaFileContents
javaFileContents
- contents of a Java file to insert annotations intolineSeparator
- the line separator javaFileContents
usesjavaFileContents
with annotations from annotationFile
insertedpublic void insertAnnotations(String annotationFilePath, String javaFilePath)
annotationFilePath
into javaFilePath
.annotationFilePath
- path to an ajava filejavaFilePath
- path to a Java file to insert annotation intopublic static void main(String[] args)
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.
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