@@ -0,0 +1,1445 @@
+package com.mgmtp.jfunk.data.generator.constraint;%0A%0Aimport javax.inject.Inject;%0Aimport javax.inject.Provider;%0A%0Aimport org.jdom.Element;%0A%0Aimport com.mgmtp.jfunk.common.random.MathRandom;%0Aimport com.mgmtp.jfunk.common.util.Configuration;%0Aimport com.mgmtp.jfunk.data.generator.Generator;%0Aimport com.mgmtp.jfunk.data.generator.constraint.base.BaseConstraint;%0Aimport com.mgmtp.jfunk.data.generator.control.FieldCase;%0Aimport com.mgmtp.jfunk.data.generator.util.XMLTags;%0A%0A/**%0A * A constraint that returns a value from the current %7B@link Configuration%7D.%0A * %0A * %3Cpre%3E%0A * %7B@code %0A * %3Cconstraint id=%22c1%22 class=%22ConfigValue%22%3E%0A *   %3Cconstant%3EmyConfigKey%3C/constant%3E%0A * %3C/constraint%3E%0A * %7D%0A * %3C/pre%3E%0A * %0A * @version $Id$%0A */%0Apublic class ConfigValue extends BaseConstraint %7B%0A%0A%09@Inject%0A%09Provider%3CConfiguration%3E configProvider;%0A%0A%09private final String configKey;%0A%0A%09public ConfigValue(final MathRandom random, final Element element, final Generator generator) %7B%0A%09%09super(random, element, generator);%0A%09%09configKey = element.getChildText(XMLTags.CONSTANT);%0A%09%7D%0A%0A%09@Override%0A%09public int getMaxLength() %7B%0A%09%09return -1;%0A%09%7D%0A%0A%09@Override%0A%09public void resetValues() %7B%0A%09%09//%0A%09%7D%0A%0A%09@Override%0A%09public int countCases() %7B%0A%09%09return 1;%0A%09%7D%0A%0A%09@Override%0A%09public boolean hasNextCase() %7B%0A%09%09return false;%0A%09%7D%0A%0A%09@Override%0A%09public void resetCase() %7B%0A%09%09// no-op%0A%09%7D%0A%0A%09@Override%0A%09protected String initValuesImpl(final FieldCase c) throws Exception %7B%0A%09%09return configProvider.get().get(configKey);%0A%09%7D%0A%7D

Create constraint that retrieves a value from the configuration