@Test public void handlesBaseUriBaseFails() { Tag tag = Tag.valueOf("a"); Attributes attribs = new Attributes(); attribs.put("relHref", "/foo"); attribs.put("absHref", "http: Element dodgyBase = new Element(tag, "wtf: assertEquals("", dodgyBase.absUrl("relHref")); }
public String absUrl(String attributeKey) { Validate.notEmpty(attributeKey); if (!hasAttr(attributeKey)) { return ""; } else { return StringUtil.resolve(baseUri, attr(attributeKey)); } }
Node implements Cloneable { public String absUrl(String attributeKey) { Validate.notEmpty(attributeKey); if (!hasAttr(attributeKey)) { return ""; } else { return StringUtil.resolve(baseUri, attr(attributeKey)); } } }
Node implements Cloneable { public String absUrl(String attributeKey) { Validate.notEmpty(attributeKey); if (!hasAttr(attributeKey)) { return ""; } else { return StringUtil.resolve(baseUri, attr(attributeKey)); } } protected  Node(String baseUri, Attributes attributes); protected  Node(String baseUri); protected  Node(); }
Node implements Cloneable { public String absUrl(String attributeKey) { Validate.notEmpty(attributeKey); if (!hasAttr(attributeKey)) { return ""; } else { return StringUtil.resolve(baseUri, attr(attributeKey)); } } protected  Node(String baseUri, Attributes attributes); protected  Node(String baseUri); protected  Node(); abstract String nodeName(); String attr(String attributeKey); Attributes attributes(); Node attr(String attributeKey, String attributeValue); boolean hasAttr(String attributeKey); Node removeAttr(String attributeKey); String baseUri(); void setBaseUri(final String baseUri); String absUrl(String attributeKey); Node childNode(int index); List<Node> childNodes(); List<Node> childNodesCopy(); final int childNodeSize(); Node parent(); final Node parentNode(); Document ownerDocument(); void remove(); Node before(String html); Node before(Node node); Node after(String html); Node after(Node node); Node wrap(String html); Node unwrap(); void replaceWith(Node in); List<Node> siblingNodes(); Node nextSibling(); Node previousSibling(); int siblingIndex(); Node traverse(NodeVisitor nodeVisitor); String outerHtml(); Appendable html(Appendable appendable); String toString(); @Override boolean equals(Object o); boolean hasSameValue(Object o); @Override Object clone(); }
Node implements Cloneable { public String absUrl(String attributeKey) { Validate.notEmpty(attributeKey); if (!hasAttr(attributeKey)) { return ""; } else { return StringUtil.resolve(baseUri, attr(attributeKey)); } } protected  Node(String baseUri, Attributes attributes); protected  Node(String baseUri); protected  Node(); abstract String nodeName(); String attr(String attributeKey); Attributes attributes(); Node attr(String attributeKey, String attributeValue); boolean hasAttr(String attributeKey); Node removeAttr(String attributeKey); String baseUri(); void setBaseUri(final String baseUri); String absUrl(String attributeKey); Node childNode(int index); List<Node> childNodes(); List<Node> childNodesCopy(); final int childNodeSize(); Node parent(); final Node parentNode(); Document ownerDocument(); void remove(); Node before(String html); Node before(Node node); Node after(String html); Node after(Node node); Node wrap(String html); Node unwrap(); void replaceWith(Node in); List<Node> siblingNodes(); Node nextSibling(); Node previousSibling(); int siblingIndex(); Node traverse(NodeVisitor nodeVisitor); String outerHtml(); Appendable html(Appendable appendable); String toString(); @Override boolean equals(Object o); boolean hasSameValue(Object o); @Override Object clone();  }