Esempio n. 1
0
 /**
  * Tests if a Element <code>element</code> is valid for the <code>FtLegal</code>.
  *
  * @param element
  * @return boolean
  */
 public static boolean isMatch(Element element) {
   if (!URelaxer.isTargetElement(element, "legal")) {
     return (false);
   }
   RStack target = new RStack(element);
   boolean $match$ = false;
   Element child;
   if (RString.isMatch(target)) {
     $match$ = true;
   }
   while (true) {
     if (FtImg.isMatchHungry(target)) {
       $match$ = true;
     } else if (FtLink.isMatchHungry(target)) {
       $match$ = true;
     } else if (FtJump.isMatchHungry(target)) {
       $match$ = true;
     } else if (FtAcronym.isMatchHungry(target)) {
       $match$ = true;
     } else if (FtStrong.isMatchHungry(target)) {
       $match$ = true;
     } else if (FtCode.isMatchHungry(target)) {
       $match$ = true;
     } else if (FtSub.isMatchHungry(target)) {
       $match$ = true;
     } else if (FtSup.isMatchHungry(target)) {
       $match$ = true;
     } else if (FtEm.isMatchHungry(target)) {
       $match$ = true;
     } else if (FtBr.isMatchHungry(target)) {
       $match$ = true;
     } else if (FtIcon.isMatchHungry(target)) {
       $match$ = true;
     } else if (FtFork.isMatchHungry(target)) {
       $match$ = true;
     } else {
       break;
     }
   }
   if (!target.isEmptyElement()) {
     return (false);
   }
   return (true);
 }
Esempio n. 2
0
 /** @param element */
 private void init(Element element) {
   RStack stack = new RStack(element);
   id_ = URelaxer.getAttributePropertyAsString(element, "id");
   xmlLang_ = URelaxer.getAttributePropertyAsString(element, "xml:lang");
   this.content_.clear();
   while (true) {
     if (RString.isMatch(stack)) {
       addContent(new RString(stack));
     } else if (FtImg.isMatch(stack)) {
       addContent(new FtImg(stack));
     } else if (FtLink.isMatch(stack)) {
       addContent(new FtLink(stack));
     } else if (FtJump.isMatch(stack)) {
       addContent(new FtJump(stack));
     } else if (FtAcronym.isMatch(stack)) {
       addContent(new FtAcronym(stack));
     } else if (FtStrong.isMatch(stack)) {
       addContent(new FtStrong(stack));
     } else if (FtCode.isMatch(stack)) {
       addContent(new FtCode(stack));
     } else if (FtSub.isMatch(stack)) {
       addContent(new FtSub(stack));
     } else if (FtSup.isMatch(stack)) {
       addContent(new FtSup(stack));
     } else if (FtEm.isMatch(stack)) {
       addContent(new FtEm(stack));
     } else if (FtBr.isMatch(stack)) {
       addContent(new FtBr(stack));
     } else if (FtIcon.isMatch(stack)) {
       addContent(new FtIcon(stack));
     } else if (FtFork.isMatch(stack)) {
       addContent(new FtFork(stack));
     } else {
       break;
     }
   }
 }