public class DataModelGenerator extends Object
ODataToVdmGenerator, gathering all relevant parameter or providing default values for
unspecified ones.| Modifier and Type | Field and Description |
|---|---|
static Boolean |
DEFAULT_DELETE_OUTPUT_DIRECTORY
The default flag indicating whether the output directory should be deleted prior to the generation.
|
static String |
DEFAULT_INPUT_DIRECTORY_NAME
The default directory name to search and save configuration data in.
|
static String |
DEFAULT_OUTPUT_DIRECTORY_NAME
The default directory name to store the generated sources in.
|
static Boolean |
DEFAULT_OVERWRITE_FILES
The default flag indicating whether already existing files should be overwritten.
|
static String |
DEFAULT_PACKAGE_NAME
The default package prefix of the generated sources.
|
static String |
DEFAULT_SERVICE_NAME_MAPPING_FILE_NAME
The default file name to the name mapping properties file.
|
static String |
DEFAULT_SERVICE_PATH_PREFIX
The default service url prefix, after which the technical service name follows.
|
| Constructor and Description |
|---|
DataModelGenerator() |
| Modifier and Type | Method and Description |
|---|---|
DataModelGenerator |
deleteOutputDirectory()
Deletes the output directory specified by
withPackageName(String) prior to generating the sources. |
DataModelGenerator |
deleteOutputDirectory(boolean deleteOutputDirectory)
Defines whether to delete the output directory specified by
withPackageName(String) prior to generating
the sources. |
void |
execute()
Executes the actual generator based on the given parameter or, in case of absence, their default values.
|
DataModelGenerator |
overwriteFiles()
Defines that already existing files will get overwritten.
|
DataModelGenerator |
overwriteFiles(boolean overwriteFiles)
Defines whether already existing files will get overwritten.
|
DataModelGenerator |
withInputDirectory(File inputDirectory)
The directory to search the service data in.
|
DataModelGenerator |
withInputDirectory(String inputDirectory)
The directory to search the service data in.
|
DataModelGenerator |
withOutputDirectory(File outputDirectory)
The root directory to store the generated sources in.
|
DataModelGenerator |
withOutputDirectory(String outputDirectory)
Path to the root directory to store the generated sources in.
|
DataModelGenerator |
withPackageName(String packageName)
Specifies the package prefix to be used in the generated sources.
|
DataModelGenerator |
withServiceNameMapping(File serviceNameMappingFile)
The properties file containing the service name mapping.
|
DataModelGenerator |
withServiceNameMapping(String serviceNameMappingFile)
The path to the properties file containing the service name mapping.
|
DataModelGenerator |
withServicePathPrefix(String servicePathPrefix)
Specifies the prefix of the service url.
|
public static final String DEFAULT_INPUT_DIRECTORY_NAME
public static final String DEFAULT_OUTPUT_DIRECTORY_NAME
public static final Boolean DEFAULT_DELETE_OUTPUT_DIRECTORY
public static final Boolean DEFAULT_OVERWRITE_FILES
false, an exception
is thrown if a file already exists.public static final String DEFAULT_PACKAGE_NAME
public static final String DEFAULT_SERVICE_PATH_PREFIX
public static final String DEFAULT_SERVICE_NAME_MAPPING_FILE_NAME
@NonNull public DataModelGenerator withInputDirectory(@NonNull String inputDirectory)
inputDirectory - The directory to read the service data from.DataModelGenerator for chained method calls.@NonNull public DataModelGenerator withInputDirectory(@NonNull File inputDirectory)
inputDirectory - The directory to read the service data from.DataModelGenerator for chained method calls.@NonNull public DataModelGenerator withOutputDirectory(@NonNull String outputDirectory)
The generated sources will be stored under this directory according to the packages specified.
outputDirectory - The path to the root directory to store the generated sources in.DataModelGenerator for chained method calls.@NonNull public DataModelGenerator withOutputDirectory(@NonNull File outputDirectory)
The generated sources will be stored under this directory according to the packages specified.
outputDirectory - The root directory to store the generated sources in.DataModelGenerator for chained method calls.@NonNull public DataModelGenerator deleteOutputDirectory()
withPackageName(String) prior to generating the sources.
This option should be used to determine the whole change set, including deleted files.
DataModelGenerator for chained method calls.@NonNull public DataModelGenerator deleteOutputDirectory(boolean deleteOutputDirectory)
withPackageName(String) prior to generating
the sources.
This option should be used to determine the whole change set, including deleted files.
deleteOutputDirectory - Flag indicating whether the output directory should be cleaned.DataModelGenerator for chained method calls.@NonNull public DataModelGenerator overwriteFiles()
DataModelGenerator for chained method calls.@NonNull public DataModelGenerator overwriteFiles(boolean overwriteFiles)
false, an exception is thrown if a file
already exists.overwriteFiles - Flag indicating whether already existing files can be overwritten.DataModelGenerator for chained method calls.@NonNull public DataModelGenerator withPackageName(@NonNull String packageName)
packageName - The package prefix for the generated sources.DataModelGenerator for chained method calls.@NonNull public DataModelGenerator withServicePathPrefix(@NonNull String servicePathPrefix)
The generator uses this prefix to determine the OData endpoint.
servicePathPrefix - The prefix of the service url.DataModelGenerator for chained method calls.@NonNull public DataModelGenerator withServiceNameMapping(@NonNull File serviceNameMappingFile)
Any service not mapped in this file will get created/updated.
serviceNameMappingFile - The file to read/set the service name mappings in.DataModelGenerator for chained method calls.@NonNull public DataModelGenerator withServiceNameMapping(@NonNull String serviceNameMappingFile)
Any service not mapped in this file will get created/updated.
serviceNameMappingFile - The file to read/set the service name mappings in.DataModelGenerator for chained method calls.public void execute()
Copyright © 2018 SAP SE. All rights reserved.