Create a validator factory
@return The factory
545014
static ValidatorFactory createValidatorFactory()
   {
      Configuration configuration = Validation.byDefaultProvider().configure();
      Configuration<?> conf = configuration.traversableResolver(new IronJacamarTraversableResolver());

      return conf.buildValidatorFactory();
   }
743076
@SuppressWarnings("unchecked")
   private static LogAdapterFactory createAdapterFactory()
   {
      List<LogAdapterFactory> factories = Iterators.asList(ServiceLoader.load(LogAdapterFactory.class));
      if (factories.isEmpty())
      {
         /*
          * Always fall back to the JDK, even if our service loading mechanism is hosed for some reason.
          */
         factories = Arrays.asList((LogAdapterFactory) new JDKLogAdapterFactory());
      }

      /*
       * Sort factories by priority.
       */
      Collections.sort(factories, new WeightedComparator());

      /*
       * Use the factory with the highest priority.
       */
      return factories.get(0);

   }
765795
public function getValidator(): Validator
    {
        if ($this->validator === null) {
            $this->validator = new Validator(new ValidatorCollection(), $this->getPlaceholder());
        }

        return $this->validator;
    }
232026
private ReferenceFactory<?> createFactory(final Constructor<?> constructor) {
    return manager -> {
      try {
        return (ReferenceCounted<?>) constructor.newInstance(manager);
      } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
        throw new SerializationException("failed to instantiate reference", e);
      }
    };
  }
503971
private GeneralValidator<DPO, RI, RO, RHI> build() {
        // Create validator
        GeneralValidator<DPO, RI, RO, RHI> validator = new GeneralValidator<DPO, RI, RO, RHI>();

        // Add triggers
        for (Trigger trigger : addedTriggers) {
            validator.addTrigger(trigger);
        }

        // Add data providers
        for (DataProvider<DPO> dataProvider : addedDataProviders) {
            validator.addDataProvider(dataProvider);
        }

        // Map data providers output to rules input
        validator.setDataProviderToRuleMappingStrategy(dataProviderToRuleMapping);
        validator.setRuleInputTransformers(addedRuleInputTransformers);

        // Add rules
        for (Rule<RI, RO> rule : addedRules) {
            validator.addRule(rule);
        }

        // Map rules output to result handlers input
        validator.setRuleToResultHandlerMappingStrategy(ruleToResultHandlerMapping);
        validator.setResultHandlerInputTransformers(addedResultHandlerInputTransformers);

        // Add result handlers
        for (ResultHandler<RHI> resultHandler : addedResultHandlers) {
            validator.addResultHandler(resultHandler);
        }

        return validator;
    }
918868
@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;
    }
176218
protected function getValidatorInstance(): Validator
    {
        $factory = $this->container->make(ValidationFactory::class);

        if (method_exists($this, 'validator')) {
            $validator = $this->container->call([$this, 'validator'], compact('factory'));
        } else {
            $validator = $this->createDefaultValidator($factory);
        }

        if (method_exists($this, 'withValidator')) {
            $this->withValidator($validator);
        }

        return $validator;
    }
296061
public static ValidatorConfiguration createExperimental() {
        Map<Check, Level> checks = getStandardChecks();

        checks.put(GdlArityCheck.INSTANCE, Level.ERROR);
        checks.put(GdlNotInRuleHeadCheck.INSTANCE, Level.ERROR);
        checks.put(UnrecognizedGdlArgumentCheck.INSTANCE, Level.WARNING);

        // (gdl random)
        checks.put(GdlRandomGoalCheck.INSTANCE, Level.ERROR);

        return new ValidatorConfiguration(checks);
    }
750465
function createFactory(type) {
    const ret = createElement.bind(null, type);
    ret.type = type;

    return ret;
}
400006
protected function getValidatorInstance()
    {
        $factory = $this->container->make(ValidationFactory::class);

        if (method_exists($this, 'validator')) {
            return $this->container->call(array($this, 'validator'), compact('factory'));
        }

        $rules = $this->container->call(array($this, 'rules'));

        return $factory->make($this->all(), $rules, $this->messages(), $this->attributes());
    }
848714
public Validator[] getValidators()
    {
        return _validatorList == null ? EMPTY_VALIDATOR_ARRAY
                : _validatorList.toArray(new Validator[_validatorList.size()]);
    }
668689
public function getValidator()
    {
        if (!($this->validator instanceof ValidatorInterface)) {
            $this->validator = ValidatorHelper::create($this->validator);
        }

        return $this->validator;
    }
238773
public function getValidator(): ?Factory
    {
        if (!$this->hasValidator()) {
            $this->setValidator($this->getDefaultValidator());
        }
        return $this->validator;
    }
140581
private XMLInputFactory factory() {
        XMLInputFactory factory = XMLInputFactory.newInstance();
        factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);
        factory.setProperty(XMLInputFactory.SUPPORT_DTD, false);
        return factory;
    }
1001033
public function getValidator()
    {
        if (!$this->validator) {
            $this->validator = static::$validatorFactory->make(
                [],
                static::getCreateRules(),
                static::getValidationMessages(),
                static::getValidationAttributes()
            );
        }

        return $this->validator;
    }
1102885
@Override
    protected Validator createValidator() throws JspException
    {
        if (null == _minimum && null == _maximum)
        {
            throw new JspException("a minimum and / or a maximum have to be specified");
        }
        ELContext elContext = FacesContext.getCurrentInstance().getELContext();
        if (null != _minimum)
        {
            _min = getValue(_minimum.getValue(elContext));
        }
        if (null != _maximum)
        {
            _max = getValue(_maximum.getValue(elContext));
        }
        if (null != _minimum && null != _maximum)
        {
            if (!isMinLTMax())
            {
                throw new JspException("maximum limit must be greater than the minimum limit");
            }
        }
        return super.createValidator();
    }
352527
private static void createFactoryInstance() 
  {

    try {
      Class cls = Class.forName(MP_SELECTOR_EVALUATOR_FACTORY_CLASS);
      instance = (MPSelectorEvaluatorFactory) cls.newInstance();
    }
    catch (Exception e) {
      FFDCFilter.processException(e, "com.ibm.ws.sib.processor.MPSelectorEvaluatorFactory.createFactoryInstance", "100");
      throw new SIErrorException(e);
    }
  }