/** @param element */ private void init(Element element) { RStack stack = new RStack(element); id_ = URelaxer.getAttributePropertyAsString(element, "id"); xmlLang_ = URelaxer.getAttributePropertyAsString(element, "xml:lang"); if (FcCaption.isMatch(stack)) { setCaption(new FcCaption(stack)); } tr_.clear(); while (true) { if (FcTr.isMatch(stack)) { addTr(new FcTr(stack)); } else { break; } } }
/** * Tests if a Element <code>element</code> is valid for the <code>FcTable</code>. * * @param element * @return boolean */ public static boolean isMatch(Element element) { if (!URelaxer.isTargetElement(element, "table")) { return (false); } RStack target = new RStack(element); boolean $match$ = false; Element child; if (FcCaption.isMatchHungry(target)) {} if (!FcTr.isMatchHungry(target)) { return (false); } $match$ = true; while (true) { if (!FcTr.isMatchHungry(target)) { break; } $match$ = true; } if (!target.isEmptyElement()) { return (false); } return (true); }
/** * Makes an XML text representation. * * @param buffer */ public void makeTextElement(PrintWriter buffer) { int size; buffer.print("<table"); if (id_ != null) { buffer.print(" id=\""); buffer.print(URelaxer.escapeAttrQuot(URelaxer.getString(getId()))); buffer.print("\""); } if (xmlLang_ != null) { buffer.print(" xml:lang=\""); buffer.print(URelaxer.escapeAttrQuot(URelaxer.getString(getXmlLang()))); buffer.print("\""); } buffer.print(">"); if (caption_ != null) { caption_.makeTextElement(buffer); } size = this.tr_.size(); for (int i = 0; i < size; i++) { FcTr value = (FcTr) this.tr_.get(i); value.makeTextElement(buffer); } buffer.print("</table>"); }