Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.이 콘텐츠는 선택한 언어로 제공되지 않습니다.
56.4. Nullable Options
Overview 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
In some cases, it can make sense to let method arguments default to
null
. But this is not allowed by default. If you want to allow some of your method arguments from the Java API to take null
values, you must declare this explicitly using the nullableOptions
element.
Syntax 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
The
nullableOptions
element can be defined with one or more nullableOption
child elements, as follows:
<nullableOptions> <nullableOption>ArgumentName</nullableOption> ... </nullableOptions>
<nullableOptions>
<nullableOption>ArgumentName</nullableOption>
...
</nullableOptions>
Where
ArgumentName
is the name of a method argument from the Java API.
Scope 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
As shown in the following extract, the
nullableOptions
element can optionally appear as a child of the apis
element and/or as a child of api
elements:
You can define the
nullableOptions
element at the following scopes:
- As a child of an
api
element—thenullableOptions
mappings apply only to the API class specified by theapi
element. - As a child of the
apis
element—thenullableOptions
mappings apply to all API classes by default, but can be overridden at theapi
level.
Example 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
The following example shows the nullable options declared for the
CompaniesResource
proxy class from the Apache Camel LinkedIn component: