public void endElement(String uri, String localName, String qName) throws SAXException {
   if ("tag".equals(qName)) {
     if (tagInfo != null) {
       tagInfoMap.put(tagInfo.getName(), tagInfo);
       if (generateCode) {
         System.out.println("this.put(\"" + tagInfo.getName() + "\", tagInfo);\n");
       }
     }
     tagInfo = null;
   } else if (!"tags".equals(qName)) {
     dependencyName = null;
   }
 }
Exemple #2
0
  boolean isMustCloseTag(TagInfo tagInfo) {
    if (tagInfo != null) {
      return mustCloseTags.contains(tagInfo.getName()) || tagInfo.contentType == CONTENT_TEXT;
    }

    return false;
  }
 public void characters(char[] ch, int start, int length) throws SAXException {
   if (tagInfo != null) {
     String value = new String(ch, start, length).trim();
     if ("fatal-tags".equals(dependencyName)) {
       tagInfo.defineFatalTags(value);
       if (generateCode) {
         System.out.println("tagInfo.defineFatalTags(\"" + value + "\");");
       }
     } else if ("req-enclosing-tags".equals(dependencyName)) {
       tagInfo.defineRequiredEnclosingTags(value);
       if (generateCode) {
         System.out.println("tagInfo.defineRequiredEnclosingTags(\"" + value + "\");");
       }
     } else if ("forbidden-tags".equals(dependencyName)) {
       tagInfo.defineForbiddenTags(value);
       if (generateCode) {
         System.out.println("tagInfo.defineForbiddenTags(\"" + value + "\");");
       }
     } else if ("allowed-children-tags".equals(dependencyName)) {
       tagInfo.defineAllowedChildrenTags(value);
       if (generateCode) {
         System.out.println("tagInfo.defineAllowedChildrenTags(\"" + value + "\");");
       }
     } else if ("higher-level-tags".equals(dependencyName)) {
       tagInfo.defineHigherLevelTags(value);
       if (generateCode) {
         System.out.println("tagInfo.defineHigherLevelTags(\"" + value + "\");");
       }
     } else if ("close-before-copy-inside-tags".equals(dependencyName)) {
       tagInfo.defineCloseBeforeCopyInsideTags(value);
       if (generateCode) {
         System.out.println("tagInfo.defineCloseBeforeCopyInsideTags(\"" + value + "\");");
       }
     } else if ("close-inside-copy-after-tags".equals(dependencyName)) {
       tagInfo.defineCloseInsideCopyAfterTags(value);
       if (generateCode) {
         System.out.println("tagInfo.defineCloseInsideCopyAfterTags(\"" + value + "\");");
       }
     } else if ("close-before-tags".equals(dependencyName)) {
       tagInfo.defineCloseBeforeTags(value);
       if (generateCode) {
         System.out.println("tagInfo.defineCloseBeforeTags(\"" + value + "\");");
       }
     }
   }
 }