code: @NotNull
      public final ArtifactFactory<?> getFactory() {
          if (factory == null) {
              if (factoryClassName == null) {
                  throw new IllegalStateException("Factory class name was not set: " + artifact);
              }
              if (context == null) {
                  throw new IllegalStateException("Context class loader was not set: " + artifact);
              }
              final Object obj = Utils4J.createInstance(factoryClassName, context.getClassLoader());
              if (!ArtifactFactory.class.isAssignableFrom(obj.getClass())) {
                  throw new IllegalStateException(
                          "Expected an object of type '" + ArtifactFactory.class.getName() + "', but was: " + obj.getClass());
              }
              factory = (ArtifactFactory<?>) obj;
              factory.init(this);
          }
          return factory;
      }
docs: Returns the factory instance. If it does not exist, it will be created. Requires that {@link #init(SrcGen4JContext, Map)} was called
  once before.
  
  @return Factory.