@Beta public final class GeneratorJavaFile extends Object
Constructor and Description |
---|
GeneratorJavaFile(org.sonatype.plexus.build.incremental.BuildContext buildContext,
Collection<? extends Type> types)
Creates instance of this class with the set of
types for
which the JAVA code is generated. |
Modifier and Type | Method and Description |
---|---|
List<File> |
generateToFile(File generatedSourcesDirectory,
File persistentSourcesDirectory)
Generates
List of files for collection of types. |
static File |
packageToDirectory(File parentDirectory,
String packageName)
Creates the package directory path as concatenation of
parentDirectory and parsed packageName . |
public GeneratorJavaFile(org.sonatype.plexus.build.incremental.BuildContext buildContext, Collection<? extends Type> types)
types
for
which the JAVA code is generated.
The instances of concrete JAVA code generator are created.
buildContext
- build context to use for accessing filestypes
- set of types for which JAVA code should be generatedpublic List<File> generateToFile(File generatedSourcesDirectory, File persistentSourcesDirectory) throws IOException
List
of files for collection of types. All files are stored
to sub-folders of base directory persistentSourcesDirectory
. Subdirectories
are generated according to packages to which the type belongs (e. g. if
type belongs to the package org.pcg then in persistentSourcesDirectory
is created directory org which contains pcg).generatedSourcesDirectory
- expected output directory for generated sources configured by
userpersistentSourcesDirectory
- base directoryIOException
- thrown in case of I/O errorpublic static File packageToDirectory(File parentDirectory, String packageName)
parentDirectory
and parsed packageName
. The
parsing of packageName
is realized as replacement of the
package name dots with the file system separator.parentDirectory
- File
object with reference to parent directorypackageName
- string with the name of the packageFile
object which refers to the new directory for
package packageName
Copyright © 2019 OpenDaylight. All rights reserved.