Exemplo n.º 1
0
 private Tag newTag(Class<? extends Tag> klass) {
   Tag tag = null;
   try {
     tag = klass.newInstance();
     tag.setTagName(tag.getTagName().toLowerCase());
     Tag endTag = klass.newInstance();
     endTag.setTagName("/" + tag.getTagName().toLowerCase());
     endTag.setParent(tag);
     tag.setEndTag(endTag);
   } catch (Exception e) {
     e.printStackTrace();
   }
   return tag;
 }