/** * Parses the given text to create the tag contents. * * @param text A string of the form <TAGNAME xx="yy">. */ public void setText(String text) { Lexer lexer; TagNode output; lexer = new Lexer(text); try { output = (TagNode) lexer.nextNode(); mPage = output.getPage(); nodeBegin = output.getStartPosition(); nodeEnd = output.getEndPosition(); mAttributes = output.getAttributesEx(); } catch (ParserException pe) { throw new IllegalArgumentException(pe.getMessage()); } }
/** * Create a tag like the one provided. * * @param tag The tag to emulate. * @param scanner The scanner for this tag. */ public TagNode(TagNode tag, TagScanner scanner) { this(tag.getPage(), tag.getTagBegin(), tag.getTagEnd(), tag.getAttributesEx()); setThisScanner(scanner); }