public class ClassConverter extends AbstractBaseConverter<Class>
String
into a Class
.
For a description of the format, see Class.forName(String)
.
Example:
@Parameter(names = { "--class" }, converter = ClassConverter.class)
private Class class;
Class
,
Class.forName(String)
failOnNull, targetClass
Constructor and Description |
---|
ClassConverter(String optionName)
Constructs a converter.
|
Modifier and Type | Method and Description |
---|---|
protected Class<?> |
convertImpl(String value)
Converts a value.
|
convert, getErrorString, isSingle, newParameterException, newParameterException, split, toInt, toURI
public ClassConverter(String optionName)
optionName
- The option name, may be null.protected Class<?> convertImpl(String value) throws ClassNotFoundException
AbstractBaseConverter
convertImpl
in class AbstractBaseConverter<Class>
value
- the value to convertClassNotFoundException
Copyright © 2016-2016 Gary Gregory. All Rights Reserved.
Use is subject to The Apache Software License, Version 2.0