
mel.camel-api-component-maven-plugin.2.18.0.source-code.api-document.vm Maven / Gradle / Ivy
## ------------------------------------------------------------------------
## Licensed to the Apache Software Foundation (ASF) under one or more
## contributor license agreements. See the NOTICE file distributed with
## this work for additional information regarding copyright ownership.
## The ASF licenses this file to You under the Apache License, Version 2.0
## (the "License"); you may not use this file except in compliance with
## the License. You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
## ------------------------------------------------------------------------
## api-document.vm
${componentName} Component
${componentName} Component
Component Description
Maven users will need to add the following dependency to their pom.xml for this component:
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${version}</version>
</dependency>
URI Format
The ${componentName} Component uses the following URI format:
${uriFormat}
#set( $hasApiPrefix = $uriFormat.contains("-prefix") )
#if( $hasApiPrefix )
Endpoint prefix can be one of:
#foreach( $name in $apiNames )
- $name
#end
#end
${componentName}Component
The ${componentName} Component can be configured with the options below.
These options can be provided using the component's bean property configuration
of type $componentConfig.Name
.
Option
Type
#foreach( $field in $componentConfigFields.entrySet() )
$field.Key
$field.Value
#end
Producer Endpoints
#if( !$hasApiPrefix )
Producer endpoints can use endpoint names and options listed next.
A shorthand alias can be used for some endpoints.
#else
Producer endpoints can use endpoint prefixes followed by endpoint names and associated options described next.
A shorthand alias can be used for some endpoints. The endpoint URI MUST contain a prefix.
#end
Endpoint options that are not mandatory are denoted by [].
When there are no mandatory options for an endpoint, one of the set of [] options MUST be provided.
Producer endpoints can also use a special option inBody
that in turn should contain
the name of the endpoint option whose value will be contained in the Camel Exchange In message.
Any of the endpoint options can be provided in either the endpoint URI, or dynamically in a message header.
The message header name must be of the format Camel${componentName}.<option>
.
Note that the inBody
option overrides message header,
i.e. the endpoint option inBody=option
would override a Camel${componentName}.option
header.
## single API use case, only list methods and options
#if( !$hasApiPrefix )
#set( $endpointConfig = $apiConfigs.get("") )
#set( $endpoints = $helper.getEndpoints($apiMethods.get(""), $apiHelpers.get(""), $endpointConfig) )
Endpoint
Shorthand Alias
Options
Result Body Type
#foreach( $endpoint in $endpoints )
$endpoint.endpoint
$endpoint.aliases
$endpoint.options
$endpoint.resultTypes
#end
URI Options
#set ( $nullableArguments = $apiHelpers.get("").NullableArguments )
#if( !$nullableArguments.isEmpty )
If a value is not provided for one of the option(s) ${nullableArguments.toString()}
either in the endpoint URI or in a message header, it will be assumed to be null
.
Note that the null
value(s) will only be used if other options do not satisfy matching endpoints.
#end
Name
Type
#foreach( $field in $endpointConfig.DeclaredFields )
$field.Name
$helper.getCanonicalName($field.Type)
#end
#else
## multiple API use case, list API names and their methods and options
#foreach( $apiMethod in $apiMethods.entrySet() )
#set( $apiName = $apiMethod.Key )
${foreach.count}. Endpoint Prefix $apiName
The following endpoints can be invoked with the prefix $apiName
as follows:
${scheme}://${apiName}/endpoint?[options]
Endpoint
Shorthand Alias
Options
Result Body Type
#set( $endpointConfig = $apiConfigs.get($apiName) )
#set( $anApiHelper = $apiHelpers.get($apiName) )
#set( $endpoints = $helper.getEndpoints($apiMethod.Value, $anApiHelper, $endpointConfig) )
#foreach( $endpoint in $endpoints )
$endpoint.Endpoint
$endpoint.Aliases
$endpoint.Options
$endpoint.ResultTypes
#end
URI Options for $apiName
#set ( $nullableArguments = $anApiHelper.NullableArguments )
#if( !$nullableArguments.Empty )
If a value is not provided for one of the option(s) ${nullableArguments.toString()}
either in the endpoint URI or in a message header, it will be assumed to be null
.
Note that the null
value(s) will only be used if other options do not satisfy matching endpoints.
#end
Name
Type
#foreach( $field in $endpointConfig.DeclaredFields )
$field.Name
$helper.getCanonicalName($field)
#end
#end
#end
Consumer Endpoints
Any of the producer endpoints can be used as a consumer endpoint.
Consumer endpoints can use Scheduled Poll Consumer Options with a consumer.
prefix to schedule endpoint invocation.
Consumer endpoints that return an array or collection will generate one exchange per element, and their routes will be executed once for each exchange.
Message Headers
Any URI option can be provided in a message header for producer endpoints with a Camel${componentName}.
prefix.
Message Body
All result message bodies utilize objects provided by the underlying APIs used by the ${componentName}Component. Producer endpoints can specify the option name for incoming message body in the inBody
endpoint URI parameter.
For endpoints that return an array or collection, a consumer endpoint will map every element to distinct messages.