code: public void addRuleInstances (String prefix, Digester dig)
      {
          // this creates the appropriate instance when we encounter our
          // prefix tag
          dig.addRule(prefix, new Rule() {
              @Override
              public void begin (String namespace, String name,
                                 Attributes attributes) throws Exception {
                  digester.push(createMisoSceneModel());
              }
              @Override
              public void end (String namespace, String name) throws Exception {
                  digester.pop();
              }
          });
  
          // set up rules to parse and set our fields
          dig.addRule(prefix + "/width", new SetFieldRule("width"));
          dig.addRule(prefix + "/height", new SetFieldRule("height"));
          dig.addRule(prefix + "/viewwidth", new SetFieldRule("vwidth"));
          dig.addRule(prefix + "/viewheight", new SetFieldRule("vheight"));
          dig.addRule(prefix + "/base", new SetFieldRule("baseTileIds"));
  
          dig.addObjectCreate(prefix + "/objects", ArrayList.class.getName());
          dig.addObjectCreate(prefix + "/objects/object",
                              ObjectInfo.class.getName());
          dig.addSetNext(prefix + "/objects/object", "add",
                         Object.class.getName());
  
          dig.addRule(prefix + "/objects/object", new SetPropertyFieldsRule());
  
          dig.addRule(prefix + "/objects", new CallMethodSpecialRule() {
              @Override
              public void parseAndSet (String bodyText, Object target)
                  throws Exception
              {
                  @SuppressWarnings("unchecked") ArrayList<ObjectInfo> ilist =
                      (ArrayList<ObjectInfo>)target;
                  ArrayList<ObjectInfo> ulist = Lists.newArrayList();
                  SimpleMisoSceneModel model = (SimpleMisoSceneModel)
                      digester.peek(1);
  
                  // filter interesting and uninteresting into two lists
                  for (int ii = 0; ii < ilist.size(); ii++) {
                      ObjectInfo info = ilist.get(ii);
                      if (!info.isInteresting()) {
                          ilist.remove(ii--);
                          ulist.add(info);
                      }
                  }
  
                  // now populate the model
                  SimpleMisoSceneModel.populateObjects(model, ilist, ulist);
              }
          });
      }
docs: documentation inherited from interface