コード例 #1
0
        @Override
        public Collection call(Element element) {
          Collection collection = new Collection();

          for (Element child : XmlHelper.childElements(element)) {
            String tagName = child.getTagName();
            Tag t = tagLookup.get(tagName);
            if (t != null) {
              switch (t) {
                case id:
                  collection.setId(getLong(child));
                  break;
                case name:
                  collection.setName(getText(child));
                  break;
                case qname:
                  collection.setQname(getText(child));
                  break;
                case description:
                  collection.setDescription(getText(child));
                  break;
                case owner_id:
                  collection.setOwnerId(getLong(child));
                  break;
                case datasets:
                  collection.setDataSetQnames(getDatasets(child));
                  break;
                case deleted:
                  collection.setDeleted(getBoolean(child));
                  break;
                default:
                  break;
              }
            }
          }

          return collection;
        }