code: private void addFieldRules( AnnotationInstance rulesContainerAnnotation, RuleInfo ruleInfo,
                                  boolean applyToAllLocales )
      {
          //
          // First parse the locale from the wrapper annotation.  This will apply to all rules inside.
          //
          Locale locale = null;
  
          if ( ! applyToAllLocales )
          {
              String language = CompilerUtils.getString( rulesContainerAnnotation, LANGUAGE_ATTR, true );
  
              //
              // If there's no language specified, then this rule will only apply for the default ruleset
              // (i.e., if there are explicit rules for the requested locale, this rule will not be run).
              //
              if ( language != null )
              {
                  String country = CompilerUtils.getString( rulesContainerAnnotation, COUNTRY_ATTR, true );
                  String variant = CompilerUtils.getString( rulesContainerAnnotation, VARIANT_ATTR, true );
  
                  language = language.trim();
                  if ( country != null ) country = country.trim();
                  if ( variant != null ) variant = variant.trim();
  
                  if ( country != null && variant != null ) locale = new Locale( language, country, variant );
                  else if ( country != null ) locale = new Locale( language, country );
                  else locale = new Locale( language );
              }
          }
  
          Map valuesPresent = rulesContainerAnnotation.getElementValues();
  
          for ( Iterator ii = valuesPresent.entrySet().iterator(); ii.hasNext(); )
          {
              Map.Entry entry = ( Map.Entry ) ii.next();
              AnnotationValue value = ( AnnotationValue ) entry.getValue();
              Object val = value.getValue();
  
              if ( val instanceof AnnotationInstance )
              {
                  addFieldRuleFromAnnotation( ruleInfo, ( AnnotationInstance ) val, locale, applyToAllLocales );
              }
              else if ( val instanceof List )
              {
                  List annotations = CompilerUtils.getAnnotationArray( value );
  
                  for ( Iterator i3 = annotations.iterator(); i3.hasNext(); )
                  {
                      AnnotationInstance i = ( AnnotationInstance ) i3.next();
                      addFieldRuleFromAnnotation( ruleInfo, i, locale, applyToAllLocales );
                  }
              }
          }
  
          setEmpty( false );  // this ValidationModel is only "empty" if there are no rules.
      }
docs: Add field rules from either a Jpf.ValidationField or a Jpf.ValidationLocaleRules annotation.