If not already created, a new <code>validator</code> element will be created and returned.
Otherwise, the first existing <code>validator</code> element will be returned.
@return the instance defined for the element <code>validator</code>
323017
public FacesConfigValidatorType<WebFacesConfigDescriptor> getOrCreateValidator()
   {
      List<Node> nodeList = model.get("validator");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FacesConfigValidatorTypeImpl<WebFacesConfigDescriptor>(this, "validator", model, nodeList.get(0));
      }
      return createValidator();
   }
965529
protected Validator createValidator(FaceletContext ctx)
    {
        if (this.validatorId == null)
        {
            throw new TagException(
                                   this.tag,
                                   "Default behavior invoked of requiring a validator-id passed in the "
                                   + "constructor, must override ValidateHandler(ValidatorConfig)");
        }
        return ctx.getFacesContext().getApplication().createValidator(this.validatorId);
    }
372121
@Override
    public StructValidator getSimpleValidator()
    {
        /* Can we create a simple validator? Yes, if the sub-specs are
         * all simple (leaves == element tokens with no arity modifier);
         * this is always true for mixed.
         */
        ContentSpec[] specs = mContentSpecs;
        int len = specs.length;
        int i;

        if (mHasMixed) {
            i = len;
        } else {
            i = 0;
            for (; i < len; ++i) {
                if (!specs[i].isLeaf()) {
                    break;
                }
            }
        }

        if (i == len) { // all leaves, kewl
            PrefixedNameSet keyset = namesetFromSpecs(mNsAware, specs);
            return new Validator(mArity, keyset);
        }

        // Nah, need a DFA...
        return null;
    }
669713
public T nextElement() {
        T rc = null;
        if (null == this.myIterator) {
            rc = this.singleton;
            this.singleton = null;
        } else {
            rc = this.myIterator.next();
        }
        return rc;
    }
601223
public List<FacesConfigDefaultValidatorsType<FacesConfigApplicationType<T>>> getAllDefaultValidators()
   {
      List<FacesConfigDefaultValidatorsType<FacesConfigApplicationType<T>>> list = new ArrayList<FacesConfigDefaultValidatorsType<FacesConfigApplicationType<T>>>();
      List<Node> nodeList = childNode.get("default-validators");
      for(Node node: nodeList)
      {
         FacesConfigDefaultValidatorsType<FacesConfigApplicationType<T>>  type = new FacesConfigDefaultValidatorsTypeImpl<FacesConfigApplicationType<T>>(this, "default-validators", childNode, node);
         list.add(type);
      }
      return list;
   }
308877
public List<FacesConfigValidatorType<WebFacesConfigDescriptor>> getAllValidator()
   {
      List<FacesConfigValidatorType<WebFacesConfigDescriptor>> list = new ArrayList<FacesConfigValidatorType<WebFacesConfigDescriptor>>();
      List<Node> nodeList = model.get("validator");
      for(Node node: nodeList)
      {
         FacesConfigValidatorType<WebFacesConfigDescriptor>  type = new FacesConfigValidatorTypeImpl<WebFacesConfigDescriptor>(this, "validator", model, node);
         list.add(type);
      }
      return list;
   }
405627
public Selector createSelector()
    {
        selectorSync.lock();
        try {
            Selector selector = Selector.open();
            assert (selector != null);
            selectors.add(selector);
            return selector;
        }
        catch (IOException e) {
            throw new ZError.IOException(e);
        }
        finally {
            selectorSync.unlock();
        }
    }
446101
public boolean validate() {
        _validationError = null;
        List<XmlError> errors = new ArrayList<XmlError>();

        boolean valid = _xmlBean.validate(new XmlOptions().setErrorListener(errors));
        if (!valid) {
            _validationError = "";
            for (int i = 0; i < errors.size(); i++) {
                _validationError += errors.get(i).toString();
                if (i < errors.size() - 1)
                    _validationError += '\n';
            }
        }

        return valid;
    }
1164156
public T next() {
        if (entry == null) return null;
        entry = entry.next;
        return entry.element;
    }
251161
public static WebElementFinder create() {
		return new WebElementFinder(null, null, 0L, 0L, null, null, null, null, false);
	}
816787
public CodeBlock getInstance() {
        return CodeBlock.builder()
                .add( "new $T() {\n", ClassName.get( getMainClass() ) )
                .indent()
                .add( buildCreateMethod( getKeyClass(), key.getInstance() ) )
                .add( "\n" )
                .add( buildCreateMethod( getJsonClass(), json.getInstance() ) )
                .unindent()
                .add( "}" )
                .build();

    }
149194
public Object previous() {
        Object element = null;
        if (previousElement != null) {
            element = previousElement;
            previousElement = null;
        } else {
            element = getPreviousElement();
            if (element == null) {
                throw new java.util.NoSuchElementException();
            }
        }
        return element;
    }
695395
protected T createInstance() {
        try {
            Constructor<T> ctor = clazz.getDeclaredConstructor();
            ctor.setAccessible(true);
            return ctor.newInstance();
        } catch (InstantiationException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        } catch (SecurityException e) {
            throw new RuntimeException(e);
        } catch (NoSuchMethodException e) {
            throw new RuntimeException(e);
        } catch (IllegalArgumentException e) {
            throw new RuntimeException(e);
        } catch (InvocationTargetException e) {
            throw new RuntimeException(e);
        }
    }
206808
public FacesConfigComponentType<WebFacesConfigDescriptor> getOrCreateComponent()
   {
      List<Node> nodeList = model.get("component");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FacesConfigComponentTypeImpl<WebFacesConfigDescriptor>(this, "component", model, nodeList.get(0));
      }
      return createComponent();
   }
414813
public function getValidator()
    {
        $validatorGenerator = new ValidatorGenerator([
            'name' => $this->name,
        ]);

        $validator = $validatorGenerator->getRootNamespace() . '\\' . $validatorGenerator->getName();

        return 'use ' . str_replace([
            "\\",
            '/'
        ], '\\', $validator) . 'Validator;';
    }
1335647
public Object getNextElement() {
        Object element = null;
        while (currentIndex+1 < endIndex && element == null) {
            currentIndex++;
            element = getElement();
        }
        return element;      
    }
1032333
public static<E, T extends ParamValidator<E>> T getValidator(Class<T> clazz, Param<Boolean> param) {

        // get if such validator was already initialized
        List<ParamValidator> validators = validatorsMap.get(clazz);
        if (validators == null) {
            addValidators(validatorsMap, clazz, null, null);
        }

        // start searching from index 2 - from this index and on, the list preserves <ParamValidatorWrapper> specific instances
        for (int i=2; i<validators.size(); i++) {
            ParamValidator validator = validators.get(i);

            if (validator.getClass() == ParamValidatorWrapper.class &&
                ((ParamValidatorWrapper)validator).ifParam == param) {

                return (T)validator;
            }

        }

        T validator = (T)new ParamValidatorWrapper<E>(clazz, param);
        validators.add(validator);

        return validator;
    }