initialize values.

@param factory constraint validator factory to set
@param messageInterpolator message interpolator to set
@param traversableResolver traversable resolver to set
@param pparameterNameProvider parameter resolver to set
7646
public void init(final ConstraintValidatorFactory factory,
      final MessageInterpolator messageInterpolator, final TraversableResolver traversableResolver,
      final ParameterNameProvider pparameterNameProvider) {
    contraintValidatorFactory = factory;
    this.messageInterpolator = messageInterpolator;
    this.traversableResolver = traversableResolver;
    parameterNameProvider = pparameterNameProvider;
  }
1298585
public String format(final MessageResolver messageResolver, final MessageInterpolator messageInterpolator) {
        
        for(String code : getCodes()) {
            Optional<String> message = messageResolver.getMessage(code);
            if(message.isPresent()) {
                return messageInterpolator.interpolate(message.get(), getVariables(), true, messageResolver);
            }
            
        }
        
        // デフォルトメッセージはBeanValidationのとき変数を追加している場合があるため、再度フォーマットする。
        return messageInterpolator.interpolate(getDefaultMessage(), getVariables(), true, messageResolver);
    }
1028589
public void setIdentifierResolver(final Object identifierResolver) {
        if (identifierResolver instanceof IdentifierResolver) {
            this.identifierResolver = (IdentifierResolver) identifierResolver;
        } else if (identifierResolver instanceof String) {
            this.identifierResolver = new IdentifierResolver() {
                public String getIdentifierFor(String nodeName) {
                    return (String) identifierResolver;
                }
            };
        } else if (identifierResolver instanceof Closure) {
            final ObjectGraphBuilder self = this;
            this.identifierResolver = new IdentifierResolver() {
                public String getIdentifierFor(String nodeName) {
                    Closure cls = (Closure) identifierResolver;
                    cls.setDelegate(self);
                    return (String) cls.call(new Object[]{nodeName});
                }
            };
        } else {
            this.identifierResolver = new DefaultIdentifierResolver();
        }
    }
1263984
@Override
    public boolean setInitParameter(String name, String value) throws IllegalStateException, IllegalArgumentException {
        if (name == null) {
            logger.logp(Level.SEVERE, CLASS_NAME, "setInitParameter", servlet40NLS.getString("name.is.null"));
            throw new java.lang.NullPointerException(servlet40NLS.getString("name.is.null"));
        }

        return super.setInitParameter(name, value);
    }
413441
protected void initializeArguments() {

    Map<String, BasicDoubleLinkedNode<CliArgumentContainer>> argumentMap = new HashMap<>();
    BasicDoubleLinkedNode<CliArgumentContainer> startHead = null;
    BasicDoubleLinkedNode<CliArgumentContainer> startTail = null;
    BasicDoubleLinkedNode<CliArgumentContainer> endHead = null;
    BasicDoubleLinkedNode<CliArgumentContainer> endTail = null;
    for (CliArgumentContainer argumentContainer : this.arguments) {
      String id = argumentContainer.getId();
      if ((CliArgument.ID_FIRST.equals(id)) || (CliArgument.ID_LAST.equals(id))) {
        throw new NlsIllegalArgumentException(id, argumentContainer.toString());
      }
      if (argumentMap.containsKey(id)) {
        throw new DuplicateObjectException(argumentContainer, id);
      }
      BasicDoubleLinkedNode<CliArgumentContainer> node = new BasicDoubleLinkedNode<>();
      node.setValue(argumentContainer);
      argumentMap.put(id, node);
      CliArgument cliArgument = argumentContainer.getArgument();
      boolean addAfter = cliArgument.addAfter();
      String nextTo = cliArgument.addCloseTo();
      if (CliArgument.ID_FIRST.equals(nextTo)) {
        if ((startHead == null) || (startTail == null)) {
          startHead = node;
          startTail = node;
        } else {
          if (addAfter) {
            startTail.insertAsNext(node);
            startTail = node;
          } else {
            startHead.insertAsPrevious(node);
            startHead = node;
          }
        }
        argumentContainer.init();
      } else if (CliArgument.ID_LAST.equals(nextTo)) {
        if ((endTail == null) || (endHead == null)) {
          endTail = node;
          endHead = node;
        } else {
          if (addAfter) {
            endTail.insertAsNext(node);
            endTail = node;
          } else {
            endHead.insertAsPrevious(node);
            endHead = node;
          }
        }
        argumentContainer.init();
      }
    }
    if ((startTail != null) && (endHead != null)) {
      // connect start and end of list...
      startTail.insertAsNext(endHead);
    }
    for (BasicDoubleLinkedNode<CliArgumentContainer> node : argumentMap.values()) {
      List<String> cycle = initializeArgumentRecursive(node, argumentMap);
      if (cycle != null) {
        StringBuilder sb = new StringBuilder();
        for (int i = cycle.size() - 1; i >= 0; i--) {
          sb.append(cycle.get(i));
          if (i > 0) {
            sb.append("-->");
          }
        }
        throw new IllegalStateException("Cyclic dependency of CLI modes: " + sb.toString());
      }
    }
    // order arguments
    if (startHead != null) {
      this.arguments.clear();
      startHead.addToList(this.arguments);
    } else if (endHead != null) {
      this.arguments.clear();
      BasicDoubleLinkedNode<CliArgumentContainer> node = endHead;
      BasicDoubleLinkedNode<CliArgumentContainer> previous = node.getPrevious();
      while (previous != null) {
        node = previous;
        previous = node.getPrevious();
      }
      node.addToList(this.arguments);
    }
  }
1127011
public void setTargetResolver( ITargetHandlerResolver targetHandlerResolver ) {

		if( targetHandlerResolver == null ) {
			this.targetConfigurator.setTargetHandlerResolver( this.defaultTargetHandlerResolver );
			this.instancesMngr.setTargetHandlerResolver( this.defaultTargetHandlerResolver );
		} else {
			this.targetConfigurator.setTargetHandlerResolver( targetHandlerResolver );
			this.instancesMngr.setTargetHandlerResolver( targetHandlerResolver );
		}
	}
846576
private synchronized void initialize() {
        Iterator types = EntityTypesLocator.getEntityTypes().getAllEntityTypes();
        String factoryName = null;

        while (types.hasNext()) {
            Class type = (Class) types.next();
            if (type != Object.class) {
                String factoryKey =
                        "org.apereo.portal.services.EntityNameFinderService.NameFinderFactory.implementation_"
                                + type.getName();
                try {
                    factoryName = PropertiesManager.getProperty(factoryKey);
                } catch (Exception runtime) {
                    String dMsg =
                            "EntityNameFinderService.initialize(): "
                                    + "could not find property for "
                                    + type.getName()
                                    + " factory.";
                    log.debug(dMsg);
                }
                if (factoryName != null) {
                    try {
                        IEntityNameFinderFactory factory =
                                (IEntityNameFinderFactory) Class.forName(factoryName).newInstance();
                        getNameFinders().put(type, factory.newFinder());
                    } catch (Exception e) {
                        String eMsg =
                                "EntityNameFinderService.initialize(): "
                                        + "Could not instantiate finder for "
                                        + type.getName()
                                        + ": ";
                        log.error(eMsg, e);
                    }
                }
            }
        }
        setInitialized(true);
    }
498812
protected void initialize(ClassTraversal traversal) {
    Listener 	listener;

    listener = new Listener();
    traversal.traverse(listener);

    m_NameCache = listener.getNameCache();
  }
1330098
public void setInitParameters(Map<String, String> initParameters) {
		Assert.notNull(initParameters, "InitParameters must not be null");
		this.initParameters = new LinkedHashMap<>(initParameters);
	}
1025177
public void setTypeResolver(RelationshipResolver resolver, Class<?> type) {
		if (resolver != null) {
			String typeName = ReflectionUtils.getTypeName(type);

			if (typeName != null) {
				typedResolvers.put(type, resolver);
			}
		}
	}
812572
public void tryResolve(boolean constraintsAreSignificant) {
		if (internalIsResolved())
			return;
		List<LightweightBoundTypeArgument> hints = getAllHints();
		if (!hints.isEmpty() && hasSignificantHints(hints, constraintsAreSignificant)) {
			resolveWithHints(hints);
		}
	}
1180451
protected void setConfigurations(String commonPrefix, PropertySourcesPropertyResolver resolver){
		setConfigurationsCommonPrefix(commonPrefix);
		setConfigurations(resolver);
		
		setDefaultCoreSize(resolver.getProperty(commonPrefix + "defaultCoreSize", Integer.class, defaultCoreSize));
		setDefaultMaxSize(resolver.getProperty(commonPrefix + "defaultMaxSize", Integer.class, defaultMaxSize));
		setDefaultKeepAliveSeconds(resolver.getProperty(commonPrefix + "defaultKeepAliveSeconds", Long.class, defaultKeepAliveSeconds));
		setDefaultQueueSize(resolver.getProperty(commonPrefix + "defaultQueueSize", Integer.class, defaultQueueSize));
		setDefaultAllowCoreThreadTimeout(resolver.getProperty(commonPrefix + "defaultAllowCoreThreadTimeout", Boolean.class, defaultAllowCoreThreadTimeout));
		setShutdownWaitSeconds(resolver.getProperty(commonPrefix + "shutdownWaitSeconds", Long.class, shutdownWaitSeconds));
	}
1333254
public void setXPathVariableResolver(XPathVariableResolver resolver) {
        if ( resolver == null ) {
            String fmsg = XSLMessages.createXPATHMessage( 
                    XPATHErrorResources.ER_ARG_CANNOT_BE_NULL,
                    new Object[] {"XPathVariableResolver"} );
            throw new NullPointerException( fmsg );
        }
        this.variableResolver = resolver;
    }
505710
public void validateInjectionPointForDeploymentProblems(InjectionPoint ij, Bean<?> bean, BeanManagerImpl beanManager) {
        if (ij.isDelegate()) {
            return; // do not validate delegate injection points as these are special
        }
        Set<Bean<?>> resolvedBeans = beanManager.getBeanResolver().resolve(beanManager.getBeans(ij));
        if (!isInjectionPointSatisfied(ij, resolvedBeans, beanManager)) {
            throw ValidatorLogger.LOG.injectionPointHasUnsatisfiedDependencies(
                    ij,
                    Formats.formatAnnotations(ij.getQualifiers()),
                    Formats.formatInjectionPointType(ij.getType()),
                    Formats.formatAsStackTraceElement(ij),
                    InjectionPoints.getUnsatisfiedDependenciesAdditionalInfo(ij, beanManager));
        }
        if (resolvedBeans.size() > 1) {
            throw ValidatorLogger.LOG.injectionPointHasAmbiguousDependencies(
                ij,
                Formats.formatAnnotations(ij.getQualifiers()),
                Formats.formatInjectionPointType(ij.getType()),
                Formats.formatAsStackTraceElement(ij),
                WeldCollections.toMultiRowString(resolvedBeans));
        }
        // Account for the case this is disabled decorator
        if (!resolvedBeans.isEmpty()) {
            Bean<?> resolvedBean = (Bean<?>) resolvedBeans.iterator().next();
            if (beanManager.isNormalScope(resolvedBean.getScope())) {
                UnproxyableResolutionException ue = Proxies.getUnproxyableTypeException(ij.getType(), resolvedBean, beanManager.getServices(), false);
                if (ue != null) {
                    throw ValidatorLogger.LOG.injectionPointHasNonProxyableDependencies(ij, Formats.formatAsStackTraceElement(ij), ue);
                }
            }
            if (bean != null && Beans.isPassivatingScope(bean, beanManager)) {
                validateInjectionPointPassivationCapable(ij, resolvedBean, beanManager);
            }
        }

        for (PlugableValidator validator : plugableValidators) {
            validator.validateInjectionPointForDeploymentProblems(ij, bean, beanManager);
        }

        if (resolvedInjectionPoints != null) {
            // Store result to identify unused beans
            resolvedInjectionPoints.put(resolvedBeans.iterator().next(), Boolean.TRUE);
        }
    }
353858
private static MessageInterpolator getMessageInterpolatorFromValidator(Validator validator) {
        
        if(!(validator instanceof ValidatorImpl)) {
            return null;
        }
        
        try {
            Field field = ValidatorImpl.class.getDeclaredField("messageInterpolator");
            field.setAccessible(true);
            
            MessageInterpolator interpolator = (MessageInterpolator)field.get(validator);
            return interpolator;
            
        } catch (IllegalAccessException | NoSuchFieldException | SecurityException e) {
            throw new IllegalStateException("fail reflect MessageInterpolrator from ValidatorImpl.", e);
        }
        
    }
708817
@Override
  public final void initialize(final PhoneNumberValueRest pconstraintAnnotation) {
    message = pconstraintAnnotation.message();
    fieldPhoneNumber = pconstraintAnnotation.fieldPhoneNumber();
    fieldCountryCode = pconstraintAnnotation.fieldCountryCode();
    allowDin5008 = pconstraintAnnotation.allowDin5008();
    allowE123 = pconstraintAnnotation.allowE123();
    allowUri = pconstraintAnnotation.allowUri();
    allowMs = pconstraintAnnotation.allowMs();
    allowCommon = pconstraintAnnotation.allowCommon();
  }
967103
private void validateParameterResolvers(MethodTarget methodTarget) {
		Utils.createMethodParameters(methodTarget.getMethod())
				.forEach(parameter -> {
					parameterResolvers.stream()
							.filter(resolver -> resolver.supports(parameter))
							.findFirst()
							.orElseThrow(() -> new ParameterResolverMissingException(parameter));
				});
	}