@Test public void testNestedTagInValue() { String fragment = "<td label=\"Hello <c:if test='${param == true}'>World</c:if>\">Type</td>"; StringReader reader = new StringReader(fragment); PageLexer lexer = new PageLexer(); List<Node> nodeList = lexer.parse(reader); assertEquals(3, nodeList.size()); assertTrue(nodeList.get(0) instanceof TagNode); assertTrue(nodeList.get(1) instanceof TextNode); assertTrue(nodeList.get(2) instanceof TagNode); TagNode tagNode = (TagNode) nodeList.get(0); assertEquals(1, tagNode.getAttributes().size()); }
public List<Node> parse(Reader reader) { CodeReader codeReader = new CodeReader(reader); List<Node> nodeList = new ArrayList<>(); ChannelDispatcher<List<Node>> channelDispatcher = ChannelDispatcher.builder().addChannels((Channel[]) tokenizers.toArray(new Channel[tokenizers.size()])).build(); channelDispatcher.consume(codeReader, nodeList); createNodeHierarchy(nodeList); return nodeList; }
PageLexer { public List<Node> parse(Reader reader) { CodeReader codeReader = new CodeReader(reader); List<Node> nodeList = new ArrayList<>(); ChannelDispatcher<List<Node>> channelDispatcher = ChannelDispatcher.builder().addChannels((Channel[]) tokenizers.toArray(new Channel[tokenizers.size()])).build(); channelDispatcher.consume(codeReader, nodeList); createNodeHierarchy(nodeList); return nodeList; } }
PageLexer { public List<Node> parse(Reader reader) { CodeReader codeReader = new CodeReader(reader); List<Node> nodeList = new ArrayList<>(); ChannelDispatcher<List<Node>> channelDispatcher = ChannelDispatcher.builder().addChannels((Channel[]) tokenizers.toArray(new Channel[tokenizers.size()])).build(); channelDispatcher.consume(codeReader, nodeList); createNodeHierarchy(nodeList); return nodeList; }  }
PageLexer { public List<Node> parse(Reader reader) { CodeReader codeReader = new CodeReader(reader); List<Node> nodeList = new ArrayList<>(); ChannelDispatcher<List<Node>> channelDispatcher = ChannelDispatcher.builder().addChannels((Channel[]) tokenizers.toArray(new Channel[tokenizers.size()])).build(); channelDispatcher.consume(codeReader, nodeList); createNodeHierarchy(nodeList); return nodeList; }  @SuppressWarnings("rawtypes") List<Node> nestedParse(CodeReader reader); List<Node> parse(Reader reader); }
PageLexer { public List<Node> parse(Reader reader) { CodeReader codeReader = new CodeReader(reader); List<Node> nodeList = new ArrayList<>(); ChannelDispatcher<List<Node>> channelDispatcher = ChannelDispatcher.builder().addChannels((Channel[]) tokenizers.toArray(new Channel[tokenizers.size()])).build(); channelDispatcher.consume(codeReader, nodeList); createNodeHierarchy(nodeList); return nodeList; }  @SuppressWarnings("rawtypes") List<Node> nestedParse(CodeReader reader); List<Node> parse(Reader reader);  }