Lazy loads generators, to avoid the need for undesired dependencies.

@param generatorKey
the generator key

@return the resource generator
974746
private ResourceGenerator loadCommonGenerator(String resourcePath) {

		ResourceGenerator generator = null;

		for (Entry<ResourceGeneratorResolver, Class<?>> entry : commonGenerators.entrySet()) {
			ResourceGeneratorResolver resolver = entry.getKey();
			if (resolver.matchPath(resourcePath)) {
				generator = (ResourceGenerator) ClassLoaderResourceUtils.buildObjectInstance(entry.getValue());
				if (!generator.getResolver().isSameAs(resolver)) {
					throw new BundlingProcessException("The resolver defined for " + generator.getClass().getName()
							+ " is different from the one expected by Jawr.");
				}

				if (resolver.getType().equals(ResolverType.PREFIXED)) {
					loadGeneratorIfNeeded(resolver.getResourcePath(resourcePath));
				}
			}
		}

		if (generator != null) {
			initGenerator(generator);
		}

		return generator;
	}
247048
@Override
  public Deque<MutablePair<DeltaType, Object>> getByKey(String key) {
    lock.readLock().lock();
    try {
      Deque<MutablePair<DeltaType, Object>> deltas = this.items.get(key);
      if (deltas != null) {
        // returning a shallow copy
        return new LinkedList<>(deltas);
      }
    } finally {
      lock.readLock().unlock();
    }
    return null;
  }
849533
@Nullable
    public final Folder findTargetFolder(@NotEmpty final String generatorName, @NotEmpty final String artifactName) {
        Contract.requireArgNotEmpty("generatorName", generatorName);
        Contract.requireArgNotEmpty("artifactName", artifactName);
        if (parent == null) {
            throw new IllegalStateException("Parent for generators is not set");
        }
        try {
            return parent.findTargetFolder(generatorName, artifactName);
        } catch (final ProjectNameNotDefinedException ex) {
            throw new RuntimeException(
                    "Couldn't determine target folder for generator '" + generatorName + "' and artifact '" + artifactName + "'", ex);
        } catch (final ArtifactNotFoundException ex) {
            throw new RuntimeException(
                    "Couldn't determine target folder for generator '" + generatorName + "' and artifact '" + artifactName + "'", ex);
        } catch (final FolderNameNotDefinedException ex) {
            throw new RuntimeException(
                    "Couldn't determine target folder for generator '" + generatorName + "' and artifact '" + artifactName + "'", ex);
        } catch (final GeneratorNotFoundException ex) {
            throw new RuntimeException(
                    "Couldn't determine target folder for generator '" + generatorName + "' and artifact '" + artifactName + "'", ex);
        } catch (final ProjectNotFoundException ex) {
            throw new RuntimeException(
                    "Couldn't determine target folder for generator '" + generatorName + "' and artifact '" + artifactName + "'", ex);
        } catch (final FolderNotFoundException ex) {
            throw new RuntimeException(
                    "Couldn't determine target folder for generator '" + generatorName + "' and artifact '" + artifactName + "'", ex);
        }
    }
947706
protected GeneratorConfig createDefaultGeneratorConfig() {
		final GeneratorConfig config = new GeneratorConfig();
		if (this.defaultVersion == null) {
			this.defaultVersion = JavaVersion.fromQualifier(System.getProperty("java.specification.version")); //$NON-NLS-1$
			if (this.defaultVersion != null) {
				config.setJavaSourceVersion(this.defaultVersion);
			}
		} else {
			config.setJavaSourceVersion(this.defaultVersion);
		}
		return config;
	}
81598
private Object onAutoGenerator(EntityMetadata m, Client<?> client, Object e)
    {
        Object autogenerator = getAutoGenClazz(client);
        
        if (autogenerator instanceof AutoGenerator)
        {
            
            Object generatedId = ((AutoGenerator)autogenerator).generate(client, m.getIdAttribute().getJavaType().getSimpleName());
            try
            {
                generatedId = PropertyAccessorHelper.fromSourceToTargetClass(m.getIdAttribute().getJavaType(),
                        generatedId.getClass(), generatedId);
                PropertyAccessorHelper.setId(e, m, generatedId);
                return generatedId;
            }
            catch (IllegalArgumentException iae)
            {
                log.error("Unknown data type for ids : " + m.getIdAttribute().getJavaType());
                throw new KunderaException("Unknown data type for ids : " + m.getIdAttribute().getJavaType(), iae);
            }
        }
        throw new IllegalArgumentException(GenerationType.class.getSimpleName() + "." + GenerationType.AUTO
                + " Strategy not supported by this client :" + client.getClass().getName());
    }
1093563
public GeneratorConfig getGeneratorConfig() {
		if (this.generatorConfig == null) {
			this.generatorConfig = this.generatorConfigProvider.get(
					EcoreUtil.getRootContainer(this.contextObject));
		}
		return this.generatorConfig;
	}
1352538
public void setGeneratorRegistry(GeneratorRegistry generatorRegistry) {
		this.generatorRegistry = generatorRegistry;
		this.generatorRegistry.setConfig(this);
		localeResolver = null;
		if (configProperties.getProperty(JAWR_LOCALE_RESOLVER) == null) {
			localeResolver = new DefaultLocaleResolver();
		} else {
			localeResolver = (LocaleResolver) ClassLoaderResourceUtils
					.buildObjectInstance(configProperties.getProperty(JAWR_LOCALE_RESOLVER));
		}

		this.generatorRegistry.registerVariantResolver(new LocaleVariantResolverWrapper(localeResolver));

		registerResolver(new BrowserResolver(), JAWR_BROWSER_RESOLVER);
		registerResolver(new ConnectionTypeResolver(), JAWR_CONNECTION_TYPE_SCHEME_RESOLVER);
		registerResolver(new CssSkinVariantResolver(), JAWR_CSS_SKIN_RESOLVER);
	}
201696
@Override
    public List<String> getList(final String key) {
        return retrieve(new Callable<List<String>>() {
            @Override
            public List<String> call() throws Exception {
                try {
                    return configuration.getStringList(key);
                } catch (ConfigException.WrongType e) {
                    // Not a list.
                    String s = get(key);
                    if (s != null) {
                        return ImmutableList.of(s);
                    } else {
                        throw new IllegalArgumentException("Cannot create a list for the key '" + key + "'", e);
                    }
                }
            }
        }, Collections.<String>emptyList());
    }
1324315
public <T> T get(ConfigKey key, T def) {
        Object o = data.get(key);
        if (null == o) {
            o = key.val(raw);
            if (null == o) {
                o = null == def ? NULL : def;
            }
            data.put(key, o);
        }
        if (isDebugEnabled()) {
            debug("config[%s] loaded: %s", key, o);
        }
        if (o == NULL) {
            return null;
        } else {
            return (T) o;
        }
    }
255474
@Override
    @SuppressWarnings("unchecked")
    public RARArchiveImpl resourceAdapter(final String key, final ResourceAdapterConsumer consumer) {
        final ResourceAdapter<?> ra = new ResourceAdapter(key);
        consumer.accept(ra);
        resourceAdapter(ra);
        return this;
    }
468113
static List<Dependency> rootCycleAt(List<Dependency> cycle, Key<?> key) {
    for (int i = 0; i < cycle.size(); ++i) {
      if (key.equals(cycle.get(i).getSource())) {
        List<Dependency> returnValue = new ArrayList<Dependency>();
        returnValue.addAll(cycle.subList(i, cycle.size()));
        returnValue.addAll(cycle.subList(0, i));
        return returnValue;
      }
    }

    return cycle;
  }
860048
def get_generator(self):
        
        s = self.slice
        gen = drange(s.start, s.stop, s.step) # intialises the generator
        return gen
1074075
public final void addGenerator(@NotNull final GeneratorConfig generator) {
        Contract.requireArgNotNull("generator", generator);
        if (list == null) {
            list = new ArrayList<>();
        }
        list.add(generator);
    }
729405
public Content getResource(String key, Object o) {
        return getResource(key, o, null, null);
    }
59050
public TableGenerator<EntityMappings<T>> getOrCreateTableGenerator()
   {
      List<Node> nodeList = childNode.get("table-generator");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new TableGeneratorImpl<EntityMappings<T>>(this, "table-generator", childNode, nodeList.get(0));
      }
      return createTableGenerator();
   }
1137325
private void initializeGeneratorProperties(ResourceGenerator generator) {
		// Initialize the generator
		if (generator instanceof InitializingResourceGenerator) {
			if (generator instanceof ConfigurationAwareResourceGenerator) {
				((ConfigurationAwareResourceGenerator) generator).setConfig(config);
			}
			if (generator instanceof TypeAwareResourceGenerator) {
				((TypeAwareResourceGenerator) generator).setResourceType(resourceType);
			}
			if (generator instanceof ResourceReaderHandlerAwareResourceGenerator) {
				((ResourceReaderHandlerAwareResourceGenerator) generator).setResourceReaderHandler(rsHandler);
			}
			if (generator instanceof WorkingDirectoryLocationAware) {
				((WorkingDirectoryLocationAware) generator).setWorkingDirectory(rsHandler.getWorkingDirectory());
			}
			if (generator instanceof PostInitializationAwareResourceGenerator) {
				((PostInitializationAwareResourceGenerator) generator).afterPropertiesSet();
			}
		}
	}
1025889
protected Object load(final IndexScopedKey key) {
      try {
         return key.accept(loadVisitor);
      }
      catch (Exception e) {
         throw log.exceptionInCacheLoader(e);
      }
   }