Examples of PlatformResourceBundleLocator


Examples of org.hibernate.validator.resourceloading.PlatformResourceBundleLocator

  public AbstractMessageInterpolator(ResourceBundleLocator userResourceBundleLocator, boolean cacheMessages) {
    defaultLocale = Locale.getDefault();

    if ( userResourceBundleLocator == null ) {
      this.userResourceBundleLocator = new PlatformResourceBundleLocator( USER_VALIDATION_MESSAGES );
    }
    else {
      this.userResourceBundleLocator = userResourceBundleLocator;
    }

    this.defaultResourceBundleLocator = new PlatformResourceBundleLocator( DEFAULT_VALIDATION_MESSAGES );
    this.cachingEnabled = cacheMessages;

    if ( cachingEnabled ) {
      this.resolvedMessages = new ConcurrentReferenceHashMap<LocalizedMessage, String>(
          DEFAULT_INITIAL_CAPACITY,
View Full Code Here

Examples of org.hibernate.validator.resourceloading.PlatformResourceBundleLocator

  public void valuesAreRetrievedFromDelegate() {

    ResourceBundleLocator locator =
        new AggregateResourceBundleLocator(
            Arrays.asList( BUNDLE_NAME_1 ),
            new PlatformResourceBundleLocator( BUNDLE_NAME_2 )
        );

    ResourceBundle resourceBundle = locator.getResourceBundle( Locale.ENGLISH );

    assertNotNull( resourceBundle );
View Full Code Here

Examples of org.hibernate.validator.resourceloading.PlatformResourceBundleLocator

    validationBootstrapParameters.setProvider( provider );
  }

  private ConfigurationImpl() {
    this.validationBootstrapParameters = new ValidationBootstrapParameters();
    this.defaultResourceBundleLocator = new PlatformResourceBundleLocator( ResourceBundleMessageInterpolator.USER_VALIDATION_MESSAGES );
    this.defaultMessageInterpolator = new ResourceBundleMessageInterpolator( defaultResourceBundleLocator );
    this.defaultTraversableResolver = new DefaultTraversableResolver();
    this.defaultConstraintValidatorFactory = new ConstraintValidatorFactoryImpl();
    this.defaultParameterNameProvider = new DefaultParameterNameProvider();
  }
View Full Code Here

Examples of org.hibernate.validator.resourceloading.PlatformResourceBundleLocator

  public void messagesRetrievedFromSpecificBundle() {
    Validator validator = Validation.byDefaultProvider()
        .configure()
        .messageInterpolator(
            new ResourceBundleMessageInterpolator(
                new PlatformResourceBundleLocator( "MyMessages" )
            )
        )
        .buildValidatorFactory()
        .getValidator();
View Full Code Here

Examples of org.hibernate.validator.resourceloading.PlatformResourceBundleLocator

  public ResourceBundleMessageInterpolator(ResourceBundleLocator userResourceBundleLocator, boolean cacheMessages) {
    defaultLocale = Locale.getDefault();

    if ( userResourceBundleLocator == null ) {
      this.userResourceBundleLocator = new PlatformResourceBundleLocator( USER_VALIDATION_MESSAGES );
    }
    else {
      this.userResourceBundleLocator = userResourceBundleLocator;
    }

    this.defaultResourceBundleLocator = new PlatformResourceBundleLocator( DEFAULT_VALIDATION_MESSAGES );
    this.cachingEnabled = cacheMessages;

    if ( cachingEnabled ) {
      this.resolvedMessages = new ConcurrentReferenceHashMap<LocalizedMessage, String>(
          DEFAULT_INITIAL_CAPACITY,
View Full Code Here

Examples of org.hibernate.validator.resourceloading.PlatformResourceBundleLocator

    validationBootstrapParameters.setProvider( provider );
  }

  private ConfigurationImpl() {
    this.validationBootstrapParameters = new ValidationBootstrapParameters();
    this.defaultResourceBundleLocator = new PlatformResourceBundleLocator( ResourceBundleMessageInterpolator.USER_VALIDATION_MESSAGES );
    this.defaultTraversableResolver = new DefaultTraversableResolver();
    this.defaultConstraintValidatorFactory = new ConstraintValidatorFactoryImpl();
    this.defaultParameterNameProvider = new DefaultParameterNameProvider();
    this.defaultMessageInterpolator = new ResourceBundleMessageInterpolator( defaultResourceBundleLocator );
  }
View Full Code Here

Examples of org.hibernate.validator.resourceloading.PlatformResourceBundleLocator

    validationBootstrapParameters.setProvider( provider );
  }

  private ConfigurationImpl() {
    this.validationBootstrapParameters = new ValidationBootstrapParameters();
    this.defaultResourceBundleLocator = new PlatformResourceBundleLocator( ResourceBundleMessageInterpolator.USER_VALIDATION_MESSAGES );
    this.defaultTraversableResolver = new DefaultTraversableResolver();
    this.defaultConstraintValidatorFactory = new ConstraintValidatorFactoryImpl();
    this.defaultParameterNameProvider = new DefaultParameterNameProvider();
    this.defaultMessageInterpolator = new ResourceBundleMessageInterpolator( defaultResourceBundleLocator );
  }
View Full Code Here

Examples of org.hibernate.validator.resourceloading.PlatformResourceBundleLocator

  public ResourceBundleMessageInterpolator(ResourceBundleLocator userResourceBundleLocator, boolean cacheMessages) {
    defaultLocale = Locale.getDefault();

    if ( userResourceBundleLocator == null ) {
      this.userResourceBundleLocator = new PlatformResourceBundleLocator( USER_VALIDATION_MESSAGES );
    }
    else {
      this.userResourceBundleLocator = userResourceBundleLocator;
    }

    this.defaultResourceBundleLocator = new PlatformResourceBundleLocator( DEFAULT_VALIDATION_MESSAGES );
    this.cacheMessages = cacheMessages;
  }
View Full Code Here

Examples of org.hibernate.validator.resourceloading.PlatformResourceBundleLocator

  public ResourceBundleMessageInterpolator(ResourceBundleLocator userResourceBundleLocator, boolean cacheMessages) {
    defaultLocale = Locale.getDefault();

    if ( userResourceBundleLocator == null ) {
      this.userResourceBundleLocator = new PlatformResourceBundleLocator( USER_VALIDATION_MESSAGES );
    }
    else {
      this.userResourceBundleLocator = userResourceBundleLocator;
    }

    this.defaultResourceBundleLocator = new PlatformResourceBundleLocator( DEFAULT_VALIDATION_MESSAGES );
    this.cacheMessages = cacheMessages;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.