此内容没有您所选择的语言版本。

6.2. Configuration Properties


If the translator requires configurable properties then:
  1. define a variable for every property as an attribute in the extended ExecutionFactory class,
  2. define "get" and "set" methods for each attribute,
  3. and annotate each "get" method with @TranslatorProperty annotation and provide the metadata about the property.
For example, if you need a property called foo, by providing the annotation on these properties, JBoss Data Virtualization will automatically interrogate and provide a graphical way to configure your Translator while designing your VDB.
private String foo = "blah";
@TranslatorProperty(display="Foo property", description="description about Foo") 
public String getFoo() 
{
   return foo;
}

public void setFoo(String value) 
{
   return this.foo = value;
}
Copy to Clipboard Toggle word wrap
Only java primitive (int, boolean), primitive object wrapper (java.lang.Integer), or Enum types are supported as Translator properties. The default value will be derived from calling the getter, if available, on a newly constructed instance. All properties should have a default value. If there is no applicable default, then the property should be marked in the annotation as required. Initialization will fail if a required property value is not provided.
The @TranslatorProperty defines the following metadata that you can define about your property.
  • display - the display name of the property.
  • description - a description about the property.
  • required - specifies that the property is required.
  • advanced - an advanced property (a default value must be provided).
  • masked - tools need to mask the property, that is, do not show it in plain text. Used for passwords.

Note

A property can not be "advanced" and "required" at the same time.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat