Architecture

Endpoint Annotations

qianmoQqianmoQ· 更新于 2026-09-23· 阅读 5 分钟· 0 次阅读

登录后可跨设备保存划线和私人笔记登录

Component Endpoint Annotations

You can annotate Endpoint and Component classes, so that their configuration documentation can be automatically generated by Maven tooling via the Camel Component Maven Plugin into the src/main/generated folder.

The documentation is then included into the jar as JSON schema files.

The Camel project uses this to automatic keep the website documentation up-to-date with all the latest options on the Camel Components.

Supported Annotations

AnnotationDescription
@UriEndpointSpecifies that an endpoint is annotated with @UriParam and/or @UriParams annotations. Also specifies the default scheme to use in the generated documentation, and other information.
@UriParamUsed to annotate a parameter value; usually specified via ?foo=bar syntax in the URI strings in Camel. Used currently only on field declarations but in the future could be used on setter methods too. If no name is specified then the name of the field/setter property is used.
@UriParamsSpecifies that a field is a nested object of one or more configuration parameters; then the class of this field should be annotated with one or more @UriParam or @UriParams annotations
@MetadataUsed for special situations to provide additional information.

For example see the TimerEndpoint from the camel-timer component and notice how it is using these annotations.

The annotations are not only useful for automatically generating the documentation; we can use them to refine the validation of the code during configuration and can be useful for tooling providers, so they can more easily introspect the configuration options.

评论

登录后参与评论

正在加载评论…