getInstanceFromSystemProperty

public static T getInstanceFromSystemProperty<T>(String propertyName, Class<T> type)

Attempts to get an instance of the given type that is specified by the given propertyName, returning null if that is not possible for any reason.

The property's value, if present, is expected to be one of:

  1. A fully-qualified class name, in which case the instance is obtained by invoking the class's no-arg static getInstance method, if present, or public no-arg constructor.
  2. A fully-qualified class name followed by # and a method name, in which case the instance is obtained by invoking a no-arg static method of that name, if present, or a public no-arg constructor if not present.

@Nullable()
public static @Nullable() T getInstanceFromSystemProperty<T>(String propertyName, @Nullable() @Nullable() String defaultValue, Class<T> type)

Attempts to get an instance of the given type that is specified by the given propertyName, returning null if that is not possible for any reason.

The property's value, if present, or the given defaultValue, is expected to be one of:

  1. A fully-qualified class name, in which case the instance is obtained by invoking the class's no-arg static getInstance method, if present, or public no-arg constructor.
  2. A fully-qualified class name followed by # and a method name, in which case the instance is obtained by invoking a no-arg static method of that name, if present, or a public no-arg constructor if not present.