Class LegacyClassScanner
java.lang.Object
com.sap.cloud.sdk.datamodel.odata.utility.LegacyClassScanner
Helper class that enables finding the correct order of parameters for get-by-key and function/actions. Used only
INTERNALLY by the SDK and IS NOT intended for public usage.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final LegacyClassScanner
Enables a LegacyClassScanner where parameter reordering is skipped -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondetermineArgumentsForConstructor
(String className, Iterable<ParameterT> currentArguments, Function<ParameterT, String> argumentNameLookup, int numSkipArguments) Determine a list of argument-sets for a constructor.determineArgumentsForMethod
(String className, String methodName, Iterable<ParameterT> currentArguments, Function<ParameterT, String> argumentNameLookup) Determine a list of argument-sets for a named method.
-
Field Details
-
DISABLED
Enables a LegacyClassScanner where parameter reordering is skipped
-
-
Constructor Details
-
LegacyClassScanner
-
-
Method Details
-
determineArgumentsForMethod
@Nonnull public <ParameterT> List<List<ParameterT>> determineArgumentsForMethod(@Nonnull String className, @Nonnull String methodName, @Nonnull Iterable<ParameterT> currentArguments, @Nonnull Function<ParameterT, String> argumentNameLookup) Determine a list of argument-sets for a named method. It reads the existing argument sets for this method from the class file present in the output directory and combines the new, incoming argument set.
Example:
Let's assume legacy method "foo" exists in the old class. It is defined twice with arguments "a" and "a,b,c" respectively. Now the generator reads a service specification where a method "foo" is referenced with arguments "a,x,c,b". The result of this method will be: "a", "a,b,c", "a,b,c,x".- Type Parameters:
ParameterT
- Currently either EntityPropertyModel or FunctionImportParameterModel or UnboundOperationParameterModel- Parameters:
className
- The fully qualified class name (including package), used to parse the legacy class file from output directory.methodName
- The method name to determine multiple argument-sets for.currentArguments
- A single set of arguments coming from generator input.argumentNameLookup
- A function to get the parameter name.- Returns:
- The ordered combination of argument-sets for a specific method.
-
determineArgumentsForConstructor
@Nonnull public <ParameterT> List<List<ParameterT>> determineArgumentsForConstructor(@Nonnull String className, @Nonnull Iterable<ParameterT> currentArguments, @Nonnull Function<ParameterT, String> argumentNameLookup, int numSkipArguments) Determine a list of argument-sets for a constructor. It reads the existing argument sets for constructors of the class present in the output directory and combines the new, incoming argument set.
Example:
Let's assume there's a legacy class "Bar". It has two constructors with arguments "a" and "a,b,c" respectively. Now the generator reads a service specification where a resulting class "Bar" is required with constructor arguments "a,x,c,b". The result of this method will be: "a", "a,b,c", "a,b,c,x".- Type Parameters:
ParameterT
- Currently EntityPropertyModel- Parameters:
className
- The fully qualified class name (including package), used to parse the legacy class file from output directory.currentArguments
- A single set of arguments coming from generator input.argumentNameLookup
- A function to get the parameter name.numSkipArguments
- The number of arguments to skip in the parameters passed- Returns:
- The ordered combination of argument-sets for a specific constructor.
-