Package io.cucumber.core.plugin
Class PluginFactory
java.lang.Object
io.cucumber.core.plugin.PluginFactory
This class creates plugin instances from a String.
The String is of the form name[:output] where name is either a fully qualified class name or one of the built-in short names. The output is optional for some plugins (and mandatory for some).
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Class<?>[]private @Nullable PrintStreamprivate static final Loggerprivate @Nullable String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate Object(package private) Plugincreate(Options.Plugin plugin) private static FileOutputStreamcreateFileOutputStream(File file) private PrintStreamdefaultOutOrFailIfAlreadyUsed(String pluginString) private <T extends Plugin>
@Nullable Constructor<T> findEmptyConstructor(Class<T> pluginClass) private <T> Map<Class<?>, Constructor<T>> findSingleArgConstructors(Class<T> pluginClass) private <T extends Plugin>
Tinstantiate(String pluginString, Class<T> pluginClass, @Nullable String argument) private static URLprivate <T extends Plugin>
TnewInstance(Constructor<T> constructor, Object... ctorArgs) private static OutputStreamopenStream(String arg)
-
Field Details
-
log
-
CTOR_PARAMETERS
-
pluginUsingDefaultOut
-
defaultOut
-
-
Constructor Details
-
PluginFactory
public PluginFactory()
-
-
Method Details
-
create
-
instantiate
private <T extends Plugin> T instantiate(String pluginString, Class<T> pluginClass, @Nullable String argument) throws IOException, URISyntaxException - Throws:
IOExceptionURISyntaxException
-
findSingleArgConstructors
-
newInstance
-
defaultOutOrFailIfAlreadyUsed
-
findEmptyConstructor
-
convert
private Object convert(String arg, Class<?> ctorArgClass, String pluginString, Class<?> pluginClass) throws IOException, URISyntaxException - Throws:
IOExceptionURISyntaxException
-
makeURL
- Throws:
MalformedURLException
-
openStream
- Throws:
IOException
-
createFileOutputStream
-