Package org.apache.jasper.compiler

Examples of org.apache.jasper.compiler.Node$Comment


    }
    public static void evaluateNodes(Node.Nodes nodes, SmapStratum s) {
        if( nodes != null && nodes.size()>0) {
            int numChildNodes = nodes.size();
            for( int i = 0; i < numChildNodes; i++ ) {
                Node n = nodes.getNode( i );
    if (!n.isDummy()) {
        Mark mark = n.getStart();

        if (verbose) {
      System.out.println("Mark(start): line=" +
             mark.getLineNumber() +
             " col="+mark.getColumnNumber() +
             "Node: begLine=" +
             n.getBeginJavaLine() +
             " endLine="+n.getEndJavaLine());
        }
        String unqualifiedName = unqualify(mark.getFile());
        s.addFile(unqualifiedName);
        s.addLineData(mark.getLineNumber(),
          unqualifiedName,
          1,
          n.getBeginJavaLine(),
          n.getEndJavaLine() - n.getBeginJavaLine());
    }
    evaluateNodes(nodes.getNode(i).getBody(), s);
            }
        }
    }
View Full Code Here


    }
    public static void evaluateNodes(Node.Nodes nodes, SmapStratum s) {
        if( nodes != null && nodes.size()>0) {
            int numChildNodes = nodes.size();
            for( int i = 0; i < numChildNodes; i++ ) {
                Node n = nodes.getNode( i );
    if (!(n instanceof Node.JspRoot)
            || !((Node.JspRoot) n).isDummy()) {
        Mark mark = n.getStart();

        if (verbose) {
      System.out.println("Mark(start): line=" +
             mark.getLineNumber() +
             " col="+mark.getColumnNumber() +
             "Node: begLine=" +
             n.getBeginJavaLine() +
             " endLine="+n.getEndJavaLine());
        }
        String unqualifiedName = unqualify(mark.getFile());
        s.addFile(unqualifiedName);
        s.addLineData(mark.getLineNumber(),
          unqualifiedName,
          1,
          n.getBeginJavaLine(),
          n.getEndJavaLine() - n.getBeginJavaLine());
    }
    evaluateNodes(nodes.getNode(i).getBody(), s);
            }
        }
    }
View Full Code Here

        String commentString = "";
        EList comments = element.getOwnedComments();

        for (Iterator iterator = comments.iterator(); iterator.hasNext();)
        {
            final Comment comment = (Comment)iterator.next();
            if (!commentString.equalsIgnoreCase(""))
            {
                commentString = commentString + "\n\n";
            }
            commentString = commentString.concat(comment.getBody());
        }
        return cleanText(commentString);
    }
View Full Code Here

        final Collection comments = this.metaObject.getOwnedComments();
        if (comments != null && !comments.isEmpty())
        {
            for (final Iterator commentIterator = comments.iterator(); commentIterator.hasNext();)
            {
                final Comment comment = (Comment)commentIterator.next();
                String commentString = StringUtils.trimToEmpty(comment.getBody());

                if (StringUtils.isEmpty(commentString))
                {
                    commentString = StringUtils.trimToEmpty(comment.toString());
                }
                documentation.append(StringUtils.trimToEmpty(commentString));
                documentation.append(SystemUtils.LINE_SEPARATOR);
            }
        }
View Full Code Here

    public void testRTOutputDocumentFull() {
      Document doc = new Document();
      DocType dt = new DocType("root");
      dt.setInternalSubset(" ");
      doc.addContent(dt);
      doc.addContent(new Comment("This is a document"));
      doc.addContent(new ProcessingInstruction("jdomtest", ""));
      Element e = new Element("root");
      e.addContent(new EntityRef("ref"));
      doc.addContent(e);
      roundTripDocument(doc);
View Full Code Here

   
  @Test
  public void testRTOutputList() {
    List<Content> list = new ArrayList<Content>();
    list.add(new ProcessingInstruction("jdomtest", ""));
    list.add(new Comment("comment"));
    list.add(new Element("root"));
    roundTripFragment(list);
  }
View Full Code Here

  @Ignore
  // TODO
  public void testOutputFragmentList() {
    List<Content> list = new ArrayList<Content>();
    list.add(new ProcessingInstruction("jdomtest", ""));
    list.add(new Comment("comment"));
    list.add(new CDATA("foo"));
    list.add(new Element("root"));
    list.add(new Text("bar"));
    roundTripFragment(list);
  }
View Full Code Here

  @Test
  @Ignore
  // TODO
  public void testOutputFragmentContent() {
    roundTripFragment(new ProcessingInstruction("jdomtest", ""));
    roundTripFragment(new Comment("comment"));
    roundTripFragment(new CDATA("foo"));
    roundTripFragment(new Element("root"));
    roundTripFragment(new Text("bar"));
  }
View Full Code Here

    // this is to test issue #72
    // Compact format only prints first child.
    // and, it has a multi-text-type at the end.
    Element root = new Element("root");
    root.addContent(new Text(" "));
    root.addContent(new Comment("Boo"));
    root.addContent(new Text(" "));
    root.addContent(new Element("child"));
    root.addContent(new Text(" "));
    root.addContent(new ProcessingInstruction("pitarget"));
    root.addContent(new Text(" "));
View Full Code Here

  }

  @Test
  public void testOutputDocumentFull() {
    DocType dt = new DocType("root");
    Comment comment = new Comment("comment");
    ProcessingInstruction pi = new ProcessingInstruction("jdomtest", "");
    Element root = new Element("root");
    Document doc = new Document();
    doc.addContent(dt);
    doc.addContent(comment);
View Full Code Here

TOP

Related Classes of org.apache.jasper.compiler.Node$Comment

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.