このコンテンツは選択した言語では利用できません。

56.7. Extra Options


Overview

The extraOptions options are usually used to either compute or hide complex API parameters by providing simpler options instead. For example, the API method might take a POJO option, that could be provided more easily as parts of the POJO in the URI. The component could do this by adding the parts as extra options, and creating the POJO parameter internally. To complete the implementation of these extra options, you also need to override the interceptProperties method in the EndpointConsumer and/or EndpointProducer classes (see Section 55.4, “Programming Model”).

Syntax

The extraOptions element can be defined with one or more extraOption child elements, as follows:
<extraOptions>
  <extraOption>
    <type>TypeName</type>
    <name>OptionName</name>
  </extraOption>
</extraOptions>
Where TypeName is the fully-qualified type name of the extra option and OptionName is the name of the extra URI option.

Scope

As shown in the following extract, the extraOptions element can optionally appear as a child of the apis element and/or as a child of api elements:
<configuration>
  <apis>
    <api>
      <apiName>...</apiName>
      ...
 <extraOptions>...</extraOptions>
    </api>
 <extraOptions>...</extraOptions>
    ...
  </apis>
</configuration>
You can define the extraOptions element at the following scopes:
  • As a child of an api element—the extraOptions apply only to the API class specified by the api element.
  • As a child of the apis element—the extraOptions apply to all API classes by default, but can be overridden at the api level.

Child elements

Each extraOptions element can be defined with the following child elements:
type
Specifies the fully-qualified type name of the extra option.
name
Specifies the option name, as it would appear in an endpoint URI.

Example

The following example defines an extra URI option, customOption, which is of java.util.list<String> type:
<extraOptions>
  <extraOption>
    <type>java.util.List&lt;String&gt;</type>
    <name>customOption</name>
  </extraOption>
</extraOptions>
Red Hat logoGithubRedditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

© 2024 Red Hat, Inc.