public abstract class AbstractSdkValueProvider extends JavaTemplateEntity
| Modifier and Type | Field and Description |
|---|---|
protected com.mulesoft.connectivity.rest.sdk.internal.connectormodel.valueprovider.ValueProviderDefinition |
definition |
protected static String |
ITEM_NAME_EXPRESSION_FIELD |
protected static String |
ITEM_VALUE_EXPRESSION_FIELD |
protected static String |
ITEMS_EXPRESSION_FIELD |
protected com.mulesoft.connectivity.rest.sdk.internal.connectormodel.parameter.Parameter |
parameter |
protected static String |
PATH_TEMPLATE_FIELD |
protected SdkOperation |
sdkOperation |
connectorModel, NAME_MEMBER, outputDir, runConfiguration, VALUE_MEMBER| Constructor and Description |
|---|
AbstractSdkValueProvider(Path outputDir,
com.mulesoft.connectivity.rest.sdk.internal.connectormodel.ConnectorModel connectorModel,
com.mulesoft.connectivity.rest.sdk.internal.connectormodel.parameter.Parameter parameter,
SdkOperation operation,
RestSdkRunConfiguration runConfiguration) |
| Modifier and Type | Method and Description |
|---|---|
void |
applyTemplates() |
protected void |
buildValueProviderClass(com.squareup.javapoet.TypeSpec.Builder valueProviderClassBuilder)
Allows extending the default value provider class building
|
protected abstract com.squareup.javapoet.CodeBlock |
generateBuildMethodBody()
Generates the 'build' method of the value provider that overrides the abstract one from
RestValueProvider. |
protected String |
getBindingMethod(com.mulesoft.connectivity.rest.sdk.internal.connectormodel.parameter.ParameterType parameterType) |
String |
getJavaClassName() |
String |
getPackage() |
protected com.squareup.javapoet.TypeName |
getSuperClass()
Returns the super class the generated value provider will extend.
|
protected com.squareup.javapoet.CodeBlock.Builder |
getValueProviderExpressionBuilder() |
protected abstract boolean |
isBoundParameter(com.mulesoft.connectivity.rest.sdk.internal.connectormodel.parameter.ParameterType parameterType,
SdkParameter sdkParameter)
Indicates if a
Parameter from the parent operation of the
value provider is necessary for this value provider to resolve the available values. |
protected boolean |
needsClassConstants() |
protected boolean |
needsConfigureEvaluationContextMethod() |
generateGetter, generateOptionalGetter, getConstantStringField, getJavaFileBuilderForClass, getJavaType, getResourcesPath, getSourcesPath, writeClassToFile, writeJavaFilegetTemplateEngineprotected static final String ITEMS_EXPRESSION_FIELD
protected static final String ITEM_VALUE_EXPRESSION_FIELD
protected static final String ITEM_NAME_EXPRESSION_FIELD
protected static final String PATH_TEMPLATE_FIELD
protected final SdkOperation sdkOperation
protected final com.mulesoft.connectivity.rest.sdk.internal.connectormodel.parameter.Parameter parameter
protected final com.mulesoft.connectivity.rest.sdk.internal.connectormodel.valueprovider.ValueProviderDefinition definition
public AbstractSdkValueProvider(Path outputDir, com.mulesoft.connectivity.rest.sdk.internal.connectormodel.ConnectorModel connectorModel, com.mulesoft.connectivity.rest.sdk.internal.connectormodel.parameter.Parameter parameter, SdkOperation operation, RestSdkRunConfiguration runConfiguration)
public String getPackage()
public String getJavaClassName()
public void applyTemplates()
throws TemplatingException
applyTemplates in class TemplateEntityTemplatingExceptionprotected boolean needsClassConstants()
protected boolean needsConfigureEvaluationContextMethod()
protected com.squareup.javapoet.TypeName getSuperClass()
protected void buildValueProviderClass(com.squareup.javapoet.TypeSpec.Builder valueProviderClassBuilder)
protected abstract com.squareup.javapoet.CodeBlock generateBuildMethodBody()
RestValueProvider.
This method creates the actual provider expression, being it an inline definition
or a reference to a value provider expression defined in the global context depending on the case.
If the returned CodeBlock is null, no build method will be generated.protected abstract boolean isBoundParameter(com.mulesoft.connectivity.rest.sdk.internal.connectormodel.parameter.ParameterType parameterType,
SdkParameter sdkParameter)
Parameter from the parent operation of the
value provider is necessary for this value provider to resolve the available values.
If this method says is necessary, a @Parameter will be generated in the value provider class.
When that @Parameter is generated in the value provider, it is mandatory for it to have an assigned value in the
DSL for the resolver to be executed.parameterType - The kind of parameter that is being checkedsdkParameter - The parameter that is being checkedprotected String getBindingMethod(com.mulesoft.connectivity.rest.sdk.internal.connectormodel.parameter.ParameterType parameterType)
protected com.squareup.javapoet.CodeBlock.Builder getValueProviderExpressionBuilder()
Copyright © 2024. All rights reserved.