@Beta public final class S4HanaNamingStrategy extends AbstractNamingStrategy
NamingStrategy
, which removes pre- and suffixes from the generated Java identifiers that are
typically used in S4Hana service definitions.Constructor and Description |
---|
S4HanaNamingStrategy() |
S4HanaNamingStrategy(NameSource nameSource)
Constructs a new
S4HanaNamingStrategy instance. |
Modifier and Type | Method and Description |
---|---|
String |
generateJavaBuilderMethodName(String name)
Called by the VDM generator to convert the name and the label of an OData navigation property into a Lombok
builder method name.
|
String |
generateJavaClassName(String name,
String label)
Called by the VDM generator to convert the name and the label of an OData entity type into a suitable Java class
name.
|
String |
generateJavaConstantName(String name,
String label)
Called by the VDM generator to convert the property name and the label of an OData entity type into a suitable
Java constant (
public static final ) name. |
String |
generateJavaFieldName(String name,
String label)
Called by the VDM generator to convert the name and the label of a property within an OData entity type into a
suitable Java member variable name.
|
String |
generateJavaFluentHelperClassName(String name,
String label)
Called by the VDM generator to convert the name and the label of an OData operation (e.g.
|
String |
generateJavaMethodName(String name)
Called by the VDM generator to convert the name and the label of an OData navigation property into a partial Java
method name.
|
String |
generateJavaMethodParameterName(String name,
String label)
Called by the VDM generator to convert the name and the label of an OData operation (e.g.
|
String |
generateJavaNavigationPropertyConstantName(String name)
Called by the VDM generator to convert the name and the label of an OData navigation property into a suitable
Java constant (
public static final ) name. |
String |
generateJavaNavigationPropertyFieldName(String name)
Called by the VDM generator to convert the name and the label of an OData navigation property into a suitable
Java member variable name.
|
String |
generateJavaOperationMethodName(String name,
String label)
Called by the VDM generator to convert the name and the label of an OData operation (e.g.
|
appendSuffixIfNameIsReservedKeyword, chooseBetweenNameAndLabel, convertToJavaClassName, convertToJavaConstantName, convertToJavaFieldName, convertToJavaMethodName, finishJavaBuilderMethodNameGeneration, finishJavaClassNameGeneration, finishJavaConstantNameGeneration, finishJavaFieldNameGeneration, finishJavaFluentHelperClassNameGeneration, finishJavaMethodNameGeneration, finishJavaMethodParameterNameGeneration, finishJavaNavigationPropertyConstantNameGeneration, finishJavaNavigationPropertyFieldNameGeneration, finishJavaOperationMethodNameGeneration, fixAcronymsInConstantNames, getNameSource, isReservedKeyword, removeInvalidJavaCharacters, removeRepeatedUnderscores, removeWhiteSpaces, setNameSource, throwIfConversionResultIsNullOrEmpty, throwIfConversionResultIsReservedKeyword, uncapitalizeLeadingAcronym
public S4HanaNamingStrategy(@Nonnull NameSource nameSource)
S4HanaNamingStrategy
instance.nameSource
- The NameSource
that should be used by the newly created instance.public S4HanaNamingStrategy()
@Nonnull public String generateJavaClassName(@Nonnull String name, @Nullable String label)
NamingStrategy
...FluentHelper
and ...ByKeyFluentHelper
)...CreateFluentHelper
, ...UpdateFluentHelper
,
...DeleteFluentHelper
)generateJavaClassName
in interface NamingStrategy
generateJavaClassName
in class AbstractNamingStrategy
name
- Provided by the VDM generator. It reads the Name attribute value of an EntityType tag in
the metadata file.label
- Provided by the VDM generator. I reads the sap:label attribute of an EntityType tag in
the metadata file.@Nonnull public String generateJavaFieldName(@Nonnull String name, @Nullable String label)
NamingStrategy
generateJavaFieldName
in interface NamingStrategy
generateJavaFieldName
in class AbstractNamingStrategy
name
- Provided by the VDM generator. In the metadata file, it reads the Name attribute value of a
Property tag, which is within an EntityType tag.label
- Provided by the VDM generator. In the metadata file, it reads the sap:label attribute value of
a Property tag, which is within an EntityType tag.@Nonnull public String generateJavaConstantName(@Nonnull String name, @Nullable String label)
NamingStrategy
public static final
) name. These constants are the fluent helper fields and they end up in
the newly generated VDM entity classes.generateJavaConstantName
in interface NamingStrategy
generateJavaConstantName
in class AbstractNamingStrategy
name
- Provided by the VDM generator. In the metadata file, it reads the Name attribute value of a
Property tag, which is within an EntityType tag.label
- Provided by the VDM generator. In the metadata file, it reads the sap:label attribute value of
a Property tag, which is within an EntityType tag.@Nonnull public String generateJavaNavigationPropertyFieldName(@Nonnull String name)
NamingStrategy
generateJavaNavigationPropertyFieldName
in interface NamingStrategy
generateJavaNavigationPropertyFieldName
in class AbstractNamingStrategy
name
- Provided by the VDM generator. In the metadata file, it reads the Name attribute value of a
NavigationProperty tag, which is within an EntityType tag.@Nonnull public String generateJavaNavigationPropertyConstantName(@Nonnull String name)
NamingStrategy
public static final
) name. These constants are the fluent helper fields and they end up in
the newly generated VDM entity classes.generateJavaNavigationPropertyConstantName
in interface NamingStrategy
generateJavaNavigationPropertyConstantName
in class AbstractNamingStrategy
name
- Provided by the VDM generator. In the metadata file, it reads the Name attribute value of a
NavigationProperty tag, which is within an EntityType tag.@Nonnull public String generateJavaMethodName(@Nonnull String name)
NamingStrategy
fetch...()
, get...OrNull()
, get...OrFetch()
set...()
, add...()
generateJavaMethodName
in interface NamingStrategy
generateJavaMethodName
in class AbstractNamingStrategy
name
- Provided by the VDM generator. In the metadata file, it reads the Name attribute value of a
NavigationProperty tag, which is within an EntityType tag.@Nonnull public String generateJavaBuilderMethodName(@Nonnull String name)
NamingStrategy
generateJavaBuilderMethodName
in interface NamingStrategy
generateJavaBuilderMethodName
in class AbstractNamingStrategy
name
- Provided by the VDM generator. In the metadata file, it reads the Name attribute value of a
NavigationProperty tag, which is within an EntityType tag.@Nonnull public String generateJavaOperationMethodName(@Nonnull String name, @Nullable String label)
NamingStrategy
generateJavaOperationMethodName
in interface NamingStrategy
generateJavaOperationMethodName
in class AbstractNamingStrategy
name
- Provided by the VDM generator. In the metadata file, it reads the Name attribute value of an
operation (e.g. FunctionImport inside the EntityContainer tag).label
- Provided by the VDM generator. In the metadata file, it reads the sap:label attribute value of
an operation (e.g. FunctionImport inside the EntityContainer tag).@Nonnull public String generateJavaMethodParameterName(@Nonnull String name, @Nullable String label)
NamingStrategy
generateJavaMethodParameterName
in interface NamingStrategy
generateJavaMethodParameterName
in class AbstractNamingStrategy
name
- Provided by the VDM generator. In the metadata file, it reads the Name attribute value of a
Parameter tag, which is within the operation tag (e.g. FunctionImport inside the
EntityContainer tag).label
- Provided by the VDM generator. In the metadata file, it reads the sap:label attribute value of
a Parameter tag, which is within the operation tag (e.g. FunctionImport inside the
EntityContainer tag).@Nonnull public String generateJavaFluentHelperClassName(@Nonnull String name, @Nullable String label)
NamingStrategy
generateJavaFluentHelperClassName
in interface NamingStrategy
generateJavaFluentHelperClassName
in class AbstractNamingStrategy
name
- Provided by the VDM generator. In the metadata file, it reads the Name attribute value of an
operation (e.g. FunctionImport inside the EntityContainer tag).label
- Provided by the VDM generator. In the metadata file, it reads the sap:label attribute value of
an operation (e.g. FunctionImport inside the EntityContainer tag).Copyright © 2021 SAP SE. All rights reserved.