Template method for creating a Validator instance

@param ctx
FaceletContext to use
@return a new Validator instance
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);
    }
1292694
protected final String getFacetName(FaceletContext ctx, UIComponent parent)
    {
        // TODO: REFACTOR - "facelets.FACET_NAME" should be a constant somewhere, used to be in FacetHandler
        //                  from real Facelets
        return (String) parent.getAttributes().get("facelets.FACET_NAME");
    }
834859
function(ctx) {
    assert(this.args.length >= 1);
    var c = this.args[0].evaluate(ctx).numberValue();
    var ret = [];
    for (var i = 0; i < c; ++i) {
      ret.push(ctx.node);
    }
    return new NodeSetValue(ret);
  }
110692
@Override
    public void validate(final FacesContext context) {
        if (context == null) {
            throw new NullPointerException();
        }

        final Validator[] validators = getValidators();
        final Object value = getValue();

        if (!validateRequired(context, value)) {
            return;
        }

        if (validators == null) {
            return;
        }

        for (final Validator validator : validators) {
            try {
                validator.validate(context, this, value);
            }
            catch (final ValidatorException ve) {
                // If the validator throws an exception, we're
                // invalid, and we need to add a message
                setValid(false);
                FacesMessage message;
                final String validatorMessageString = getValidatorMessage();

                if (null != validatorMessageString) {
                    message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
                                validatorMessageString,
                                validatorMessageString);
                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                }
                else {
                    final Collection<FacesMessage> messages = ve.getFacesMessages();
                    if (null != messages) {
                        message = null;
                        final String cid = getClientId(context);
                        for (final FacesMessage m : messages) {
                            context.addMessage(cid, m);
                        }
                    }
                    else {
                        message = ve.getFacesMessage();
                    }
                }
                if (message != null) {
                    final Sheet sheet = getSheet();
                    if (sheet == null) {
                        return;
                    }
                    context.addMessage(getClientId(context), message);
                    sheet.getInvalidUpdates().add(
                                new SheetInvalidUpdate(sheet.getRowKeyValue(context), sheet.getColumns().indexOf(this), this, value,
                                            message.getDetail()));

                }
            }
        }

    }
190113
public Document createDocument(GraphqlParser.DocumentContext ctx) {
        Document.Builder document = Document.newDocument();
        addCommonData(document, ctx);
        document.definitions(ctx.definition().stream().map(this::createDefinition)
                .collect(toList()));
        return document.build();
    }
1181093
@Override
	public Validator newValidator(String identifier) {
		if (identifier==null) {
			return null;
		}
		ValidatorFactory template;
		synchronized (map) {
			verifyMapIntegrity();
			template = map.get(identifier);
		}
		if (template!=null) {
			try {
				return template.newValidator(identifier);
			} catch (ValidatorFactoryException e) {
				logger.log(Level.WARNING, "Failed to create validator.", e);
				return null;
			}
		} else {
			return null;
		}
	}
654582
@Nonnull
  public static <T> UBL22ValidatorBuilder <T> create (@Nonnull final Class <T> aClass)
  {
    return new UBL22ValidatorBuilder<> (aClass);
  }
134957
@Nonnull
  public static <T> EbInterfaceValidator <T> create (@Nonnull final Class <T> aClass)
  {
    return new EbInterfaceValidator <> (aClass);
  }
315729
protected String getId(FaceletContext ctx)
    {
        if (this.id != null)
        {
            return this.id.getValue(ctx);
        }
        return ctx.generateUniqueId(this.tagId);
    }
54503
public static <T extends TypeDescription> ElementMatcher.Junction<T> isAnnotation() {
        return new ModifierMatcher<T>(ModifierMatcher.Mode.ANNOTATION);
    }
516458
public static WsLocationAdminImpl createLocations(final BundleContext ctx) {
        if (instance.get() == null) {
            SymbolRegistry.getRegistry().clear();
            Callable<WsLocationAdminImpl> initializer = new Callable<WsLocationAdminImpl>() {
                @Override
                public WsLocationAdminImpl call() throws Exception {
                    return new WsLocationAdminImpl(new BundleContextMap(ctx));
                }
            };
            instance = StaticValue.mutateStaticValue(instance,initializer);
        }

        return instance.get();
    }
1317471
protected Converter createConverter(FaceletContext ctx) throws FacesException, ELException, FaceletException
    {
        return ctx.getFacesContext().getApplication().createConverter(NumberConverter.CONVERTER_ID);
    }
963335
protected void setAttributes(FaceletContext ctx, Object instance)
    {
        if (instance != null)
        {
            Class<?> type = instance.getClass();
            if (_mapper == null || !_lastType.equals(type))
            {
                _lastType = type;
                _mapper = createMetaRuleset(type).finish();
            }
            
            _mapper.applyMetadata(ctx, instance);
        }
    }
411637
protected GenericApplicationContext createApplicationContext(ApplicationContext parentCtx) {
        if (parentCtx != null && beanFactory != null) {
            Assert.isInstanceOf(DefaultListableBeanFactory.class, beanFactory,
                    "ListableBeanFactory set must be a subclass of DefaultListableBeanFactory");

            return new GrailsApplicationContext((DefaultListableBeanFactory) beanFactory,parentCtx);
        }

        if (beanFactory != null) {
            Assert.isInstanceOf(DefaultListableBeanFactory.class, beanFactory,
                    "ListableBeanFactory set must be a subclass of DefaultListableBeanFactory");

            return new GrailsApplicationContext((DefaultListableBeanFactory) beanFactory);
        }

        if (parentCtx != null) {
            return new GrailsApplicationContext(parentCtx);
        }

        return new GrailsApplicationContext();
    }
317003
public <T> FluentValidator on(T t, Validator<T> v) {
        Preconditions.checkNotNull(v, "Validator should not be NULL");
        composeIfPossible(v, t);
        doAdd(new ValidatorElement(t, v));
        lastAddCount = 1;
        return this;
    }
845027
public void addValidator(Schema schema, ModeUsage modeUsage) {
      // adds the schema to this section schemas
      schemas.addElement(schema);
      // creates the validator
      Validator validator = createValidator(schema);
      // adds the validator to this section validators
      validators.addElement(validator);
      // add the validator handler to the list of active handlers
      activeHandlers.addElement(validator.getContentHandler());
      // add the mode usage to the active handlers attribute mode usage list
      activeHandlersAttributeModeUsage.addElement(modeUsage);
      // compute the attribute processing
      attributeProcessing = Math.max(attributeProcessing,
                                     modeUsage.getAttributeProcessing());
      // add a child mode with this mode usage and the validator content handler
      childPrograms.addElement(new Program(modeUsage, validator.getContentHandler()));
      if (modeUsage.isContextDependent())
        contextDependent = true;
    }
208037
@Nonnull
    private static RuleEvaluator makeRuleEvaluator(final ExpressionFactory expressionFactory, final FunctionMapper functionMapper) {
        // Make the expression evaluation context.
        final Map<String, Object> testConstants = Collections.emptyMap();

        return new RuleEvaluator(expressionFactory, functionMapper, testConstants);
    }