94.3. Bean の定義
Camel Main によって提供される Bean 作成の一般的なサポートに加えて、YAML DSL はそれらを定義および設定するための便利な構文を提供します。
- beans:
- name: beanFromMap
type: com.acme.MyBean
properties:
foo: bar
詳細は以下のようになります。
Bean のプロパティーは、次の例に示すように、マップまたはプロパティースタイルを使用して定義できます。
- beans:
# map style
- name: beanFromMap
type: com.acme.MyBean
properties:
field1: 'f1'
field2: 'f2'
nested:
field1: 'nf1'
field2: 'nf2'
# properties style
- name: beanFromProps
type: com.acme.MyBean
properties:
field1: 'f1_p'
field2: 'f2_p'
nested.field1: 'nf1_p'
nested.field2: 'nf2_p'
注記
beans 要素はルート要素としてのみ使用されます。