/** * {@inheritDoc} */ @Override public String getText() { return text.getData(); }
/** * {@inheritDoc} */ @Override public String getText() { return text.getData(); } }
/** * {@inheritDoc} */ @Override public String getText() { return text.getData(); } }
/** * {@inheritDoc} */ @Override public String getText() { return text.getData(); }
@Override public String getText() { return baseNode != null ? baseNode.getData() : null; }
/** * The character data of the node that implements this interface. The DOM * implementation may not put arbitrary limits on the amount of data * that may be stored in a <code>CharacterData</code> node. However, * implementation limits may mean that the entirety of a node's data may * not fit into a single <code>DOMString</code>. In such cases, the user * may call <code>substringData</code> to retrieve the data in * appropriately sized pieces. * @exception DOMException * DOMSTRING_SIZE_ERR: Raised when it would return more characters than * fit in a <code>DOMString</code> variable on the implementation * platform. */ public final String getData() throws JavaScriptException { return ((Text)ot.cast()).getData(); };
/** * The character data of the node that implements this interface. The DOM * implementation may not put arbitrary limits on the amount of data * that may be stored in a <code>CharacterData</code> node. However, * implementation limits may mean that the entirety of a node's data may * not fit into a single <code>DOMString</code>. In such cases, the user * may call <code>substringData</code> to retrieve the data in * appropriately sized pieces. * @exception DOMException * DOMSTRING_SIZE_ERR: Raised when it would return more characters than * fit in a <code>DOMString</code> variable on the implementation * platform. */ public final String getData() throws JavaScriptException { return ((Text)ot.cast()).getData(); };
@PatchMethod static String getData(JavaScriptObject o) { Text text = o.cast(); return text.getData(); }
@PatchMethod static String getData(JavaScriptObject o) { Text text = o.cast(); return text.getData(); }
@PatchMethod static String getInnerHTML(Object domImpl, Element elem) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < elem.getChildNodes().getLength(); i++) { Node current = elem.getChildNodes().getItem(i); if (current.getNodeType() == Node.TEXT_NODE) { Text text = current.cast(); sb.append(text.getData()); } else { sb.append(current.toString()); } } return sb.toString(); }
@PatchMethod static String getInnerHTML(Object domImpl, Element elem) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < elem.getChildNodes().getLength(); i++) { Node current = elem.getChildNodes().getItem(i); if (current.getNodeType() == Node.TEXT_NODE) { Text text = current.cast(); sb.append(text.getData()); } else { sb.append(current.toString()); } } return sb.toString(); }
private static void appendInnerTextRecursive(Element elem, StringBuilder sb) { NodeList<Node> list = elem.getChildNodes(); for (int i = 0; i < elem.getChildNodes().getLength(); i++) { Node node = list.getItem(i); switch (node.getNodeType()) { case Node.TEXT_NODE: Text text = node.cast(); String data = text.getData(); data = " ".equals(data) ? " " : data; sb.append(data); break; case Node.ELEMENT_NODE: Element childNode = node.cast(); appendInnerTextRecursive(childNode, sb); break; } } }
private static void appendInnerTextRecursive(Element elem, StringBuilder sb) { NodeList<Node> list = elem.getChildNodes(); for (int i = 0; i < elem.getChildNodes().getLength(); i++) { Node node = list.getItem(i); switch (node.getNodeType()) { case Node.TEXT_NODE: Text text = node.cast(); String data = text.getData(); data = " ".equals(data) ? " " : data; sb.append(data); break; case Node.ELEMENT_NODE: Element childNode = node.cast(); appendInnerTextRecursive(childNode, sb); break; } } }
@PatchMethod static String getNodeValue(Node node) { switch (node.getNodeType()) { case Node.DOCUMENT_NODE: return null; case Node.ELEMENT_NODE: return null; case Node.TEXT_NODE: Text text = node.cast(); return text.getData(); default: throw new GwtTestDomException("Invalid Node type (not a Document / Element / Text : " + node.getNodeType()); } }
@PatchMethod static String getNodeValue(Node node) { switch (node.getNodeType()) { case Node.DOCUMENT_NODE: return null; case Node.ELEMENT_NODE: return null; case Node.TEXT_NODE: Text text = node.cast(); return text.getData(); default: throw new GwtTestDomException("Invalid Node type (not a Document / Element / Text : " + node.getNodeType()); } }
@PatchMethod static String toString(JavaScriptObject jso) { short nodeType = jso.<Node>cast().getNodeType(); switch (nodeType) { case Node.DOCUMENT_NODE: return documentToString(jso.<Document>cast()); case Node.TEXT_NODE: Text text = jso.cast(); return "'" + text.getData() + "'"; case Node.ELEMENT_NODE: return elementToString(jso.<Element>cast()); default: if (JsoUtils.isNodeList(jso)) { NodeList<?> nodeList = jso.cast(); return JsoUtils.getChildNodeInnerList(nodeList).toString(); } else if (GwtStyleUtils.isStyle(jso)) { Style style = jso.cast(); return GwtStyleUtils.toString(style); } else { return jso.getClass().getSimpleName(); } } }
@PatchMethod static String toString(JavaScriptObject jso) { short nodeType = jso.<Node>cast().getNodeType(); switch (nodeType) { case Node.DOCUMENT_NODE: return documentToString(jso.<Document>cast()); case Node.TEXT_NODE: Text text = jso.cast(); return "'" + text.getData() + "'"; case Node.ELEMENT_NODE: return elementToString(jso.<Element>cast()); default: if (JsoUtils.isNodeList(jso)) { NodeList<?> nodeList = jso.cast(); return JsoUtils.getChildNodeInnerList(nodeList).toString(); } else if (GwtStyleUtils.isStyle(jso)) { Style style = jso.cast(); return GwtStyleUtils.toString(style); } else { return jso.getClass().getSimpleName(); } } }
/** * Parses the supplied SVG text into a document * @param rawSvg * raw xml to be parsed * @param enableScripts * true to enable embedded scripts, false otherwise * @return * the document resulting from the parse */ public SVGSVGElement parse(String rawSvg, boolean enableScripts) throws ParserException { if (isIE()) { return parseIE(rawSvg, enableScripts); } SVGDocument doc = parseFromString(rawSvg, "text/xml").cast(); Element elt = doc.getDocumentElement(); if ("parsererror".equals(DOMHelper.getLocalName(elt))) { String message = "Parsing error"; if (elt.getFirstChild() != null) { message = elt.getFirstChild().<Text>cast().getData(); } throw new ParserException(ParserException.Type.NotWellFormed, message); } SVGSVGElement svg = DOMHelper.importNode(DOMHelper.getCurrentDocument(), elt, true).<SVGSVGElement>cast(); return enableScripts ? enableScriptElements(svg) : svg; }
/** * Parses the supplied SVG text into a document * @param rawSvg * raw xml to be parsed * @param enableScripts * true to enable embedded scripts, false otherwise * @return * the document resulting from the parse */ public SVGSVGElement parse(String rawSvg, boolean enableScripts) throws ParserException { if (isIE()) { return parseIE(rawSvg, enableScripts); } SVGDocument doc = parseFromString(rawSvg, "text/xml").cast(); Element elt = doc.getDocumentElement(); if ("parsererror".equals(DOMHelper.getLocalName(elt))) { String message = "Parsing error"; if (elt.getFirstChild() != null) { message = elt.getFirstChild().<Text>cast().getData(); } throw new ParserException(ParserException.Type.NotWellFormed, message); } SVGSVGElement svg = DOMHelper.importNode(DOMHelper.getCurrentDocument(), elt, true).<SVGSVGElement>cast(); return enableScripts ? enableScriptElements(svg) : svg; }
String message = "Parsing error"; if (elt.getFirstChild() != null) { message = elt.getFirstChild().<Text>cast().getData();