Examples of StringNode


Examples of com.google.template.soy.exprtree.StringNode

   * @return The resulting primitive expression node.
   */
  public static PrimitiveNode convertPrimitiveDataToExpr(PrimitiveData primitiveData) {

    if (primitiveData instanceof StringData) {
      return new StringNode(primitiveData.stringValue());
    } else if (primitiveData instanceof BooleanData) {
      return new BooleanNode(primitiveData.booleanValue());
    } else if (primitiveData instanceof IntegerData) {
      return new IntegerNode(primitiveData.integerValue());
    } else if (primitiveData instanceof FloatData) {
View Full Code Here

Examples of info.bliki.wiki.template.expr.ast.StringNode

  public FractionNode createFraction(final IntegerNode numerator, final IntegerNode denominator) {
    return new FractionNode(numerator, denominator);
  }

  public StringNode createString(final StringBuffer buffer) {
    return new StringNode(buffer.toString());
  }
View Full Code Here

Examples of nz.govt.natlib.adapter.pdf.dom.StringNode

    int objId = obj.getId();
    int objVer = obj.getVersion();

    // take all the strings and decrypt them...
    if (value instanceof StringNode) {
      StringNode strNode = (StringNode) value;
      strNode.setValue(decryptString(strNode.getStringValue(), objId,
          objVer));
    }

    if (value instanceof ObjectNode) {
      ObjectNode o = (ObjectNode) value;
View Full Code Here

Examples of org.htmlparser.StringNode

        assertTrue("First node should be a Tag", node[0] instanceof Tag);
        // The second node should be a HTMLStringNode
        assertTrue(
            "Second node should be a HTMLStringNode",
            node[1] instanceof StringNode);
        StringNode stringNode = (StringNode) node[1];
        assertEquals(
            "Text of the StringNode",
            "Site Comments?",
            stringNode.getText());
        assertTrue("Third node should be a tag", node[2] instanceof Tag);

    }
View Full Code Here

Examples of org.htmlparser.StringNode

            " Journalism 3.0",
            linkTag.getLinkText());
        assertTrue(
            "Eight node should be a string node",
            node[7] instanceof StringNode);
        StringNode stringNode = (StringNode) node[7];
        assertEquals(
            "String node contents",
            " by Rajesh Jain",
            stringNode.getText());
    }
View Full Code Here

Examples of org.htmlparser.StringNode

        ImageTag imageTag = (ImageTag) dataNode[0];
        assertEquals(
            "Image URL",
            "http://www.yahoo.com/abcd.jpg",
            imageTag.getImageURL());
        StringNode stringNode = (StringNode) dataNode[1];
        assertEquals("String Contents", "Hello World", stringNode.getText());
    }
View Full Code Here

Examples of org.htmlparser.StringNode

        Tag tag = (Tag) node[0];
        assertEquals("Tag Contents", "a", tag.getText());
        assertTrue(
            "Node 1 should be a string node",
            node[1] instanceof StringNode);
        StringNode stringNode = (StringNode) node[1];
        assertEquals("StringNode Contents", "Revision", stringNode.getText());
        assertTrue("Node 2 should be a string node", node[2] instanceof EndTag);
        EndTag endTag = (EndTag) node[2];
        assertEquals("End Tag Contents", "a", endTag.getText());
    }
View Full Code Here

Examples of org.htmlparser.StringNode

        scriptScanner = new ScriptScanner();
    }

    public void testCreation()
    {
        StringNode stringNode =
            new StringNode(new StringBuffer("Script Code"), 0, 0);
        NodeList childVector = new NodeList();
        childVector.add(stringNode);
        ScriptTag scriptTag =
            new ScriptTag(
                new TagData(0, 10, "Tag Contents", "tagline"),
View Full Code Here

Examples of org.htmlparser.StringNode

     */
    public void testParseParameter3() throws ParserException
    {
        Tag tag;
        EndTag etag;
        StringNode snode;
        Node node = null;
        String lin1 =
            "<DIV class=\"userData\" id=\"oLayout\" name=\"oLayout\"></DIV>";
        createParser(lin1);
        NodeIterator en = parser.elements();
View Full Code Here

Examples of org.htmlparser.StringNode

     */
    public void testParseParameterA() throws ParserException
    {
        Tag tag;
        EndTag etag;
        StringNode snode;
        Node node = null;
        String lin1 =
            "<A href=\"http://www.iki.fi/kaila\" myParameter yourParameter=\"Kaarle Kaaila\">Kaarle's homepage</A><p>Paragraph</p>";
        createParser(lin1);
        NodeIterator en = parser.elements();
        Hashtable h;
        boolean testEnd = true; // test end of first part
        String a, href, myPara, myValue, nice;

        try
        {

            if (en.hasMoreNodes())
            {
                node = en.nextNode();

                tag = (Tag) node;
                h = tag.getAttributes();
                a = (String) h.get(Tag.TAGNAME);
                href = (String) h.get("HREF");
                myValue = (String) h.get("MYPARAMETER");
                nice = (String) h.get("YOURPARAMETER");
                assertEquals("Link tag (A)", "A", a);
                assertEquals("href value", "http://www.iki.fi/kaila", href);
                assertEquals("myparameter value", "", myValue);
                assertEquals("yourparameter value", "Kaarle Kaaila", nice);
            }
            if (!(node instanceof LinkTag))
            {
                // linkscanner has eaten up this piece
                if (en.hasMoreNodes())
                {
                    node = en.nextNode();
                    snode = (StringNode) node;
                    assertEquals(
                        "Value of element",
                        snode.getText(),
                        "Kaarle's homepage");
                }

                if (en.hasMoreNodes())
                {
                    node = en.nextNode();
                    etag = (EndTag) node;
                    assertEquals("endtag of link", etag.getText(), "A");
                }
            }
            // testing rest
            if (en.hasMoreNodes())
            {
                node = en.nextNode();

                tag = (Tag) node;
                assertEquals("following paragraph begins", tag.getText(), "p");
            }
            if (en.hasMoreNodes())
            {
                node = en.nextNode();
                snode = (StringNode) node;
                assertEquals(
                    "paragraph contents",
                    snode.getText(),
                    "Paragraph");
            }
            if (en.hasMoreNodes())
            {
                node = en.nextNode();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.