code: @Override
      public void addRuleInstances (Digester digester)
      {
          // this creates the appropriate instance when we encounter a
          // <class> tag
          digester.addObjectCreate(_prefix + CLASS_PATH,
                                   ComponentClass.class.getName());
  
          // grab the attributes from the <class> tag
          SetPropertyFieldsRule rule = new SetPropertyFieldsRule();
          rule.addFieldParser("shadowColor", new FieldParser() {
              public Object parse (String text) {
                  int[] values = StringUtil.parseIntArray(text);
                  return new Color(values[0], values[1], values[2], values[3]);
              }
          });
          digester.addRule(_prefix + CLASS_PATH, rule);
  
          // parse render priority overrides
          String opath = _prefix + CLASS_PATH + "/override";
          digester.addObjectCreate(opath, PriorityOverride.class.getName());
          rule = new SetPropertyFieldsRule();
          rule.addFieldParser("orients", new FieldParser() {
              public Object parse (String text) {
                  String[] orients = StringUtil.parseStringArray(text);
                  ArrayIntSet oset = new ArrayIntSet();
                  for (String orient : orients) {
                      oset.add(DirectionUtil.fromShortString(orient));
                  }
                  return oset;
              }
          });
          digester.addRule(opath, rule);
  
          digester.addSetNext(opath, "addPriorityOverride",
                              PriorityOverride.class.getName());
      }
docs: Adds the necessary rules to the digester to parse our classes.