Package org.apache.ws.commons.om

Examples of org.apache.ws.commons.om.OMText


        char[] returnArray = null;
        if (parser != null) {
            returnArray = parser.getTextCharacters();
        } else {
            if (hasText()) {
                OMText textNode = (OMText) lastNode;
                String str = textNode.getText();
                returnArray = str.toCharArray();
            }
        }
        return returnArray;
    }
View Full Code Here


        parentElem.addChild(txt);
        return txt;
    }

    public OMText createText(OMElement parent, String text, int type) {
        OMText textNode = createText(parent, text);
        ((OMNodeEx) textNode).setType(type);
        return textNode;
    }
View Full Code Here

    String prefix = "axis2";
    String tempText = "The quick brown fox jumps over the lazy dog";
    String textToAppend = " followed by another";
   
    OMElement elem = factory.createOMElement(localName,namespace,prefix);
    OMText textNode = factory.createText(elem,tempText);
   
    ((Text)textNode).appendData(textToAppend);
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    try {
      elem.serialize(baos);
View Full Code Here

    String namespace = "http://ws.apache.org/axis2/ns";
    String prefix = "axis2";
    String tempText = "The quick brown fox jumps over the lazy dog";

    OMElement elem = factory.createOMElement(localName, namespace, prefix);
    OMText textNode = factory.createText(elem, tempText);

    assertEquals("Text value mismatch", tempText, textNode.getText());
  }
View Full Code Here

    String prefix = "axis2";
    String tempText = "The quick brown fox jumps over the lazy dog";
    String textToAppend = " followed by another fox";

    OMElement elem = factory.createOMElement(localName, namespace, prefix);
    OMText textNode = factory.createText(elem, tempText);

    ((Text) textNode).appendData(textToAppend);

    assertEquals("Text value mismatch", tempText + textToAppend, textNode
        .getText());
  }
View Full Code Here

    public void testCreateText() {
        OMElement omElement = omFactory.createOMElement("chinthaka",
                namespace);
        String text = "sampleText";
        OMText omText = omFactory.createText(omElement, text);
        assertTrue("Programatically created OMText should have done = true ",
                omText.isComplete());
        assertTrue(
                "Programatically created OMText should have correct text value ",
                text.equals(omText.getText()));

    }
View Full Code Here

TOP

Related Classes of org.apache.ws.commons.om.OMText

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.