支持数字字段的设置,例如字节、短整型、整型、长整型、浮点型和双精度字段。这包括未装箱和装箱的版本(例如 int 与 Integer)。如果存在这样的问题设定参数以匹配所需类型,
嵌套类 |
---|
class | OptionSetter.OptionFieldsForName 具有给定名称的选项字段列表的容器。 |
公共构造函数 |
---|
OptionSetter (Object... optionSources) 构造一个新的 OptionParser 以设置 'optionSources' 的 @Option 字段。 |
OptionSetter ( optionSources) OptionSetter ( optionSources) 构造一个新的 OptionParser 以设置 'optionSources' 的 @Option 字段。 |
常数
NAMESPACE_SEPARATOR
public static final char NAMESPACE_SEPARATOR
常数值:58 (0x0000003a)
公共构造函数
选项设置器
public OptionSetter (Object... optionSources)
构造一个新的 OptionParser 以设置 'optionSources' 的 @Option 字段。
选项设置器
public OptionSetter ( optionSources)
构造一个新的 OptionParser 以设置 'optionSources' 的 @Option 字段。
公共方法
获取字段值
public static Object getFieldValue (Field field,
Object optionObject)
返回给定ERROR(/Field)
的价值,处理任何异常。
获取密钥库
public IKeyStoreClient getKeyStore ()
getOptionFieldsForClass
public static getOptionFieldsForClass (Class<?> optionClass)
获取所有的列表Option
对于给定的类领域(包括申报和继承)。
参数 |
---|
optionClass | Class :该Class 来搜索 |
获取类型为选项
public String getTypeForOption (String name)
返回描述具有给定名称的字段类型的字符串。
投掷 |
---|
ConfigurationException | 如果找不到字段 |
是布尔选项
public boolean isBooleanOption (String name)
isMapOption
public boolean isMapOption (String name)
设置密钥库
public void setKeyStore (IKeyStoreClient keyStore)
参数 |
---|
keyStore | IKeyStoreClient |
设置选项值
public setOptionValue (String optionName,
String valueText)
设置非地图选项的值。
参数 |
---|
optionName | String :选项设置的名称 |
valueText | String :值 |
投掷 |
---|
ConfigurationException | 如果找不到选项或 valueText 类型错误 |
设置选项值
public setOptionValue (String optionName,
String keyText,
String valueText)
设置选项的值。
参数 |
---|
optionName | String :选项设置的名称 |
keyText | String :对地图选项,或者为null键。 |
valueText | String :值 |
投掷 |
---|
ConfigurationException | 如果找不到选项或 valueText 类型错误 |
受保护的方法
getUnsetMandatoryOptions
protected getUnsetMandatoryOptions ()
返回所有的名称Option
被标记为S mandatory
,但仍然未设置。
投掷 |
---|
ConfigurationException | 如果要检查的字段不可访问 |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2021-10-04 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"没有我需要的信息"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"太复杂/步骤太多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"内容需要更新"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻译问题"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/代码问题"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"易于理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"解决了我的问题"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]