Package cambridge.model

Examples of cambridge.model.TextNode


               matchedNodes.removeAll(sub);
               tag.setCloseText(token.getActualValue());
               tag.setEndLine(peek(1).getLineNo());
               tag.setEndColumn(peek(1).getColumn());
            } else {
               node = new TextNode();
               TextNode text = (TextNode) node;
               text.setContents(currentToken.getValue());
               text.setBeginLine(currentToken.getLineNo());
               text.setBeginColumn(currentToken.getColumn());
               text.setEndLine(peek(1).getLineNo());
               text.setEndColumn(peek(1).getColumn());
               matchedNodes.add(node);
            }

            break;
         default:
View Full Code Here


    * @return TextNode
    * @throws java.io.IOException .
    */
   private TextNode textNode() throws IOException {
      StringBuilder builder = new StringBuilder();
      TextNode node = new TextNode();
      node.setBeginLine(currentToken.getLineNo());
      node.setBeginColumn(currentToken.getColumn());
      while (true) {
         builder.append(currentToken.getValue());

         TokenType type = peek(1).getType();
         if (type == TokenType.CDATA
            || type == TokenType.DOC_TYPE || type == TokenType.EOL
            || type == TokenType.STRING || type == TokenType.WS) {
            nextToken();
         } else {
            node.setEndLine(peek(1).getLineNo());
            node.setEndColumn(peek(1).getColumn());
            break;
         }
      }

      node.setContents(builder.toString());
      return node;
   }
View Full Code Here

                    matchedNodes.removeAll(sub);
                    tag.setCloseText(token.getActualValue());
                    tag.setEndLine(peek(1).getLineNo());
                    tag.setEndColumn(peek(1).getColumn());
                } else {
                    node = new TextNode();
                    TextNode text = (TextNode) node;
                    text.setContents(currentToken.getValue());
                    text.setBeginLine(currentToken.getLineNo());
                    text.setBeginColumn(currentToken.getColumn());
                    text.setEndLine(peek(1).getLineNo());
                    text.setEndColumn(peek(1).getColumn());
                    matchedNodes.add(node);
                }

                break;
            default:
View Full Code Here

     * @return TextNode
     * @throws java.io.IOException .
     */
    private TextNode textNode() throws IOException {
        StringBuilder builder = new StringBuilder();
        TextNode node = new TextNode();
        node.setBeginLine(currentToken.getLineNo());
        node.setBeginColumn(currentToken.getColumn());
        while (true) {
            builder.append(currentToken.getValue());

            TokenType type = peek(1).getType();
            if (type == TokenType.CDATA
                || type == TokenType.DOC_TYPE || type == TokenType.EOL
                || type == TokenType.STRING || type == TokenType.WS) {
                nextToken();
            } else {
                node.setEndLine(peek(1).getLineNo());
                node.setEndColumn(peek(1).getColumn());
                break;
            }
        }

        node.setContents(builder.toString());
        return node;
    }
View Full Code Here

TOP

Related Classes of cambridge.model.TextNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.