@Beta public class LegacyClassScanner extends Object
Modifier and Type | Field and Description |
---|---|
static LegacyClassScanner |
DISABLED
Enables a LegacyClassScanner where parameter reordering is skipped
|
Constructor and Description |
---|
LegacyClassScanner(File outputDir) |
Modifier and Type | Method and Description |
---|---|
<ParameterT> |
determineArgumentsForConstructor(String className,
Iterable<ParameterT> currentArguments,
Function<ParameterT,String> argumentNameLookup,
int numSkipArguments)
Determine a list of argument-sets for a constructor.
|
<ParameterT> |
determineArgumentsForMethod(String className,
String methodName,
Iterable<ParameterT> currentArguments,
Function<ParameterT,String> argumentNameLookup)
Determine a list of argument-sets for a named method.
|
public static final LegacyClassScanner DISABLED
@Nonnull public <ParameterT> List<List<ParameterT>> determineArgumentsForMethod(@Nonnull String className, @Nonnull String methodName, @Nonnull Iterable<ParameterT> currentArguments, @Nonnull Function<ParameterT,String> argumentNameLookup)
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".
ParameterT
- Currently either EntityPropertyModel or FunctionImportParameterModel or UnboundOperationParameterModelclassName
- 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.@Nonnull public <ParameterT> List<List<ParameterT>> determineArgumentsForConstructor(@Nonnull String className, @Nonnull Iterable<ParameterT> currentArguments, @Nonnull Function<ParameterT,String> argumentNameLookup, int numSkipArguments)
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".
ParameterT
- Currently EntityPropertyModelclassName
- 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 passedCopyright © 2021 SAP SE. All rights reserved.