code: public static AppendRule newInstance(String file, String resource, String url, String format, String profile)
              throws IllegalRuleException {
          AppendRule appendRule = new AppendRule();
  
          if (StringUtils.hasText(file)) {
              appendRule.setFile(file);
          } else if (StringUtils.hasText(resource)) {
              appendRule.setResource(resource);
          } else if (StringUtils.hasText(url)) {
              appendRule.setUrl(url);
          } else {
              throw new IllegalRuleException("The 'append' element requires either a 'file' or a 'resource' or a 'url' attribute");
          }
  
          AppendedFileFormatType appendedFileFormatType = AppendedFileFormatType.resolve(format);
          if (format != null && appendedFileFormatType == null) {
              throw new IllegalRuleException("No appended file format type for '" + format + "'");
          }
          appendRule.setFormat(appendedFileFormatType);
  
          if (profile != null && !profile.isEmpty()) {
              appendRule.setProfile(profile);
          }
  
          return appendRule;
      }
docs: Create a new AppendRule.
  
  @param file the rule file to append
  @param resource the rule resource to append
  @param url the rule url to append
  @param format the rule file type ('xml' or 'apon')
  @param profile the environment profile name
  @return an {@code AppendRule} object
  @throws IllegalRuleException if an illegal rule is found