/** * {@inheritDoc} */ @Override public String getTextContent() { return getNodeValue(); }
/** * {@inheritDoc} */ @Override public String getTextContent() { return getNodeValue(); }
/** * {@inheritDoc} */ @Override public String toString() { return getClass().getSimpleName() + "[name=" + getNodeName() + " value=" + getNodeValue() + "]"; }
/** * {@inheritDoc} */ @Override public String toString() { return getClass().getSimpleName() + "[name=" + getNodeName() + " value=" + getNodeValue() + "]"; }
/** * {@inheritDoc} */ @Override public String toString() { return getClass().getSimpleName() + "[name=" + getNodeName() + " value=" + getNodeValue() + "]"; }
/** * {@inheritDoc} */ @Override public String toString() { return getClass().getSimpleName() + "[name=" + getNodeName() + " value=" + getNodeValue() + "]"; }
/** * {@inheritDoc} */ @Override public String toString() { return getClass().getSimpleName() + "[name=" + getNodeName() + " value=" + getNodeValue() + "]"; }
/** * <span style="color:red">INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.</span><br> * * @param attributeName the name of the attribute * @return the value of the attribute or {@link #ATTRIBUTE_NOT_DEFINED} or {@link #ATTRIBUTE_VALUE_EMPTY} */ public String getAttributeDirect(final String attributeName) { final DomAttr attr = attributes_.getDirect(attributeName); if (attr != null) { return attr.getNodeValue(); } return ATTRIBUTE_NOT_DEFINED; }
/** * <span style="color:red">INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.</span><br> * * @param attributeName the name of the attribute * @return the value of the attribute or {@link #ATTRIBUTE_NOT_DEFINED} or {@link #ATTRIBUTE_VALUE_EMPTY} */ public String getAttributeDirect(final String attributeName) { final DomAttr attr = attributes_.getDirect(attributeName); if (attr != null) { return attr.getNodeValue(); } return ATTRIBUTE_NOT_DEFINED; }
/** * Creates an instance. * * @param qualifiedName the qualified name of the element type to instantiate * @param page the page that contains this element * @param attributes the initial attributes */ HtmlFileInput(final String qualifiedName, final SgmlPage page, final Map<String, DomAttr> attributes) { super(qualifiedName, page, attributes); final DomAttr valueAttrib = attributes.get("value"); if (valueAttrib != null) { setDefaultValue(valueAttrib.getNodeValue(), false); } }
/** * Creates an instance. * * @param qualifiedName the qualified name of the element type to instantiate * @param page the page that contains this element * @param attributes the initial attributes */ HtmlFileInput(final String qualifiedName, final SgmlPage page, final Map<String, DomAttr> attributes) { super(qualifiedName, page, attributes); final DomAttr valueAttrib = attributes.get("value"); if (valueAttrib != null) { setDefaultValue(valueAttrib.getNodeValue(), false); } }
/** * Returns the value of the attribute specified by name or an empty string. If the * result is an empty string then it will be either {@link #ATTRIBUTE_NOT_DEFINED} * if the attribute wasn't specified or {@link #ATTRIBUTE_VALUE_EMPTY} if the * attribute was specified but it was empty. * * @param attributeName the name of the attribute * @return the value of the attribute or {@link #ATTRIBUTE_NOT_DEFINED} or {@link #ATTRIBUTE_VALUE_EMPTY} */ public String getAttribute(final String attributeName) { final DomAttr attr = attributes_.get(attributeName); if (attr != null) { return attr.getNodeValue(); } return ATTRIBUTE_NOT_DEFINED; }
/** * Returns the value of the attribute specified by name or an empty string. If the * result is an empty string then it will be either {@link #ATTRIBUTE_NOT_DEFINED} * if the attribute wasn't specified or {@link #ATTRIBUTE_VALUE_EMPTY} if the * attribute was specified but it was empty. * * @param attributeName the name of the attribute * @return the value of the attribute or {@link #ATTRIBUTE_NOT_DEFINED} or {@link #ATTRIBUTE_VALUE_EMPTY} */ @Override public String getAttribute(final String attributeName) { final DomAttr attr = attributes_.get(attributeName); if (attr != null) { return attr.getNodeValue(); } return ATTRIBUTE_NOT_DEFINED; }
/** * Returns the value of the attribute specified by name or an empty string. If the * result is an empty string then it will be either {@link #ATTRIBUTE_NOT_DEFINED} * if the attribute wasn't specified or {@link #ATTRIBUTE_VALUE_EMPTY} if the * attribute was specified but it was empty. * * @param attributeName the name of the attribute * @return the value of the attribute or {@link #ATTRIBUTE_NOT_DEFINED} or {@link #ATTRIBUTE_VALUE_EMPTY} */ public String getAttribute(final String attributeName) { final DomAttr attr = attributes_.get(attributeName); if (attr != null) { return attr.getNodeValue(); } return ATTRIBUTE_NOT_DEFINED; }
/** * Prints the content between "<" and ">" (or "/>") in the output of the tag name * and its attributes in XML format. * @param printWriter the writer to print in */ protected void printOpeningTagContentAsXml(final PrintWriter printWriter) { printWriter.print(getTagName()); for (final Map.Entry<String, DomAttr> entry : attributes_.entrySet()) { printWriter.print(" "); printWriter.print(entry.getKey()); printWriter.print("=\""); printWriter.print(StringUtils.escapeXmlAttributeValue(entry.getValue().getNodeValue())); printWriter.print("\""); } }
/** * Prints the content between "<" and ">" (or "/>") in the output of the tag name * and its attributes in XML format. * @param node the node whose opening tag is to be printed * @throws IOException in case of problem saving resources */ protected void printOpeningTag(final DomElement node) throws IOException { builder_.append(node.getTagName()); final Map<String, DomAttr> attributes = readAttributes(node); for (final Map.Entry<String, DomAttr> entry : attributes.entrySet()) { builder_.append(" "); builder_.append(entry.getKey()); builder_.append("=\""); final String value = entry.getValue().getNodeValue(); builder_.append(com.gargoylesoftware.htmlunit.util.StringUtils.escapeXmlAttributeValue(value)); builder_.append('"'); } }
/** * Prints the content between "<" and ">" (or "/>") in the output of the tag name * and its attributes in XML format. * @param printWriter the writer to print in */ protected void printOpeningTagContentAsXml(final PrintWriter printWriter) { printWriter.print(getTagName()); for (final Map.Entry<String, DomAttr> entry : attributes_.entrySet()) { printWriter.print(" "); printWriter.print(entry.getKey()); printWriter.print("=\""); printWriter.print(StringUtils.escapeXmlAttributeValue(entry.getValue().getNodeValue())); printWriter.print("\""); } }
/** * Prints the content between "<" and ">" (or "/>") in the output of the tag name * and its attributes in XML format. * @param printWriter the writer to print in */ protected void printOpeningTagContentAsXml(final PrintWriter printWriter) { printWriter.print(getTagName()); for (final String name : attributes_.keySet()) { printWriter.print(" "); printWriter.print(name); printWriter.print("=\""); printWriter.print(StringEscapeUtils.escapeXml(attributes_.get(name).getNodeValue())); printWriter.print("\""); } }
/** * Prints the content between "<" and ">" (or "/>") in the output of the tag name * and its attributes in XML format. * @param printWriter the writer to print in */ protected void printOpeningTagContentAsXml(final PrintWriter printWriter) { printWriter.print(getTagName()); for (final String name : attributes_.keySet()) { printWriter.print(" "); printWriter.print(name); printWriter.print("=\""); printWriter.print(StringEscapeUtils.escapeXml(attributes_.get(name).getNodeValue())); printWriter.print("\""); } }
/** * Prints the content between "<" and ">" (or "/>") in the output of the tag name * and its attributes in XML format. * @param printWriter the writer to print in */ protected void printOpeningTagContentAsXml(final PrintWriter printWriter) { printWriter.print(getTagName()); for (final String name : attributes_.keySet()) { printWriter.print(" "); printWriter.print(name); printWriter.print("=\""); printWriter.print(StringEscapeUtils.escapeXml(attributes_.get(name).getNodeValue())); printWriter.print("\""); } }