mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
Refactored sto use CSV sink model. Also, added more sinks
This commit is contained in:
@@ -3,52 +3,7 @@
|
||||
import java
|
||||
import semmle.code.java.dataflow.FlowSources
|
||||
import semmle.code.java.dataflow.TaintTracking
|
||||
|
||||
/** The interface `javax.xml.xpath.XPath` */
|
||||
private class XPath extends Interface {
|
||||
XPath() { this.hasQualifiedName("javax.xml.xpath", "XPath") }
|
||||
}
|
||||
|
||||
/** A call to methods of any class implementing the interface `XPath` that evaluate XPath expressions */
|
||||
private class XPathEvaluation extends MethodAccess {
|
||||
XPathEvaluation() {
|
||||
exists(Method m |
|
||||
this.getMethod() = m and m.getDeclaringType().getASourceSupertype*() instanceof XPath
|
||||
|
|
||||
m.hasName(["evaluate", "evaluateExpression", "compile"])
|
||||
)
|
||||
}
|
||||
|
||||
Expr getSink() { result = this.getArgument(0) }
|
||||
}
|
||||
|
||||
/** The interface `org.dom4j.Node` */
|
||||
private class Dom4JNode extends Interface {
|
||||
Dom4JNode() { this.hasQualifiedName("org.dom4j", "Node") }
|
||||
}
|
||||
|
||||
/** A call to methods of any class implementing the interface `Node` that evaluate XPath expressions */
|
||||
private class NodeXPathEvaluation extends MethodAccess {
|
||||
Expr sink;
|
||||
|
||||
NodeXPathEvaluation() {
|
||||
exists(Method m, int index |
|
||||
this.getMethod() = m and
|
||||
m.getDeclaringType().getASourceSupertype*() instanceof Dom4JNode and
|
||||
sink = this.getArgument(index)
|
||||
|
|
||||
m.hasName([
|
||||
"selectObject", "selectNodes", "selectSingleNode", "numberValueOf", "valueOf", "matches",
|
||||
"createXPath"
|
||||
]) and
|
||||
index = 0
|
||||
or
|
||||
m.hasName("selectNodes") and index in [0, 1]
|
||||
)
|
||||
}
|
||||
|
||||
Expr getSink() { result = sink }
|
||||
}
|
||||
import semmle.code.java.dataflow.ExternalFlow
|
||||
|
||||
/**
|
||||
* A sink that represents a method that interprets XPath expressions.
|
||||
@@ -56,9 +11,47 @@ private class NodeXPathEvaluation extends MethodAccess {
|
||||
*/
|
||||
abstract class XPathInjectionSink extends DataFlow::Node { }
|
||||
|
||||
private class DefaultXPathInjectionSink extends XPathInjectionSink {
|
||||
DefaultXPathInjectionSink() {
|
||||
exists(NodeXPathEvaluation sink | sink.getSink() = this.asExpr()) or
|
||||
exists(XPathEvaluation sink | sink.getSink() = this.asExpr())
|
||||
/** CSV sink models representing methods susceptible to XPath Injection attacks. */
|
||||
private class DefaultXPathInjectionSinkModel extends SinkModelCsv {
|
||||
override predicate row(string row) {
|
||||
row =
|
||||
[
|
||||
"javax.xml.xpath;XPath;true;evaluate;;;Argument[0];xpath",
|
||||
"javax.xml.xpath;XPath;true;evaluateExpression;;;Argument[0];xpath",
|
||||
"javax.xml.xpath;XPath;true;compile;;;Argument[0];xpath",
|
||||
"org.dom4j;Node;true;selectObject;;;Argument[0];xpath",
|
||||
"org.dom4j;Node;true;selectNodes;;;Argument[0..1];xpath",
|
||||
"org.dom4j;Node;true;selectSingleNode;;;Argument[0];xpath",
|
||||
"org.dom4j;Node;true;numberValueOf;;;Argument[0];xpath",
|
||||
"org.dom4j;Node;true;valueOf;;;Argument[0];xpath",
|
||||
"org.dom4j;Node;true;matches;;;Argument[0];xpath",
|
||||
"org.dom4j;Node;true;createXPath;;;Argument[0];xpath",
|
||||
"org.dom4j;DocumentFactory;true;createPattern;;;Argument[0];xpath",
|
||||
"org.dom4j;DocumentFactory;true;createXPath;;;Argument[0];xpath",
|
||||
"org.dom4j;DocumentFactory;true;createXPathFilter;;;Argument[0];xpath",
|
||||
"org.dom4j;DocumentHelper;false;createPattern;;;Argument[0];xpath",
|
||||
"org.dom4j;DocumentHelper;false;createXPath;;;Argument[0];xpath",
|
||||
"org.dom4j;DocumentHelper;false;createXPathFilter;;;Argument[0];xpath",
|
||||
"org.dom4j.tree;AbstractNode;true;createXPathFilter;;;Argument[0];xpath",
|
||||
"org.dom4j.tree;AbstractNode;true;createPattern;;;Argument[0];xpath",
|
||||
"org.dom4j.util;ProxyDocumentFactory;true;createPattern;;;Argument[0];xpath",
|
||||
"org.dom4j.util;ProxyDocumentFactory;true;createXPath;;;Argument[0];xpath",
|
||||
"org.dom4j.util;ProxyDocumentFactory;true;createXPathFilter;;;Argument[0];xpath"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
/** A default sink representing methods susceptible to XPath Injection attacks. */
|
||||
private class DefaultXPathInjectionSink extends XPathInjectionSink {
|
||||
DefaultXPathInjectionSink() {
|
||||
sinkNode(this, "xpath")
|
||||
or
|
||||
exists(ClassInstanceExpr constructor |
|
||||
constructor.getConstructedType().getASourceSupertype*().hasQualifiedName("org.dom4j", "XPath")
|
||||
or
|
||||
constructor.getConstructedType().hasQualifiedName("org.dom4j.xpath", "XPathPattern")
|
||||
|
|
||||
this.asExpr() = constructor.getArgument(0)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,13 @@ import javax.xml.xpath.XPathExpression;
|
||||
import javax.xml.xpath.XPathExpressionException;
|
||||
import javax.xml.xpath.XPathFactory;
|
||||
|
||||
import org.dom4j.DocumentFactory;
|
||||
import org.dom4j.DocumentHelper;
|
||||
import org.dom4j.Namespace;
|
||||
import org.dom4j.io.SAXReader;
|
||||
import org.dom4j.util.ProxyDocumentFactory;
|
||||
import org.dom4j.xpath.DefaultXPath;
|
||||
import org.dom4j.xpath.XPathPattern;
|
||||
import org.w3c.dom.Document;
|
||||
import org.xml.sax.InputSource;
|
||||
|
||||
@@ -48,71 +55,86 @@ public class A {
|
||||
|
||||
}
|
||||
|
||||
private static class ProxyDocumentFactoryStub extends ProxyDocumentFactory {
|
||||
}
|
||||
|
||||
public void handle(HttpServletRequest request) throws Exception {
|
||||
String user = request.getParameter("user");
|
||||
String pass = request.getParameter("pass");
|
||||
String expression = "/users/user[@name='" + user + "' and @pass='" + pass + "']";
|
||||
|
||||
final String xmlStr = "<users>" + " <user name=\"aaa\" pass=\"pass1\"></user>"
|
||||
+ " <user name=\"bbb\" pass=\"pass2\"></user>" + "</users>";
|
||||
DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
|
||||
domFactory.setNamespaceAware(true);
|
||||
DocumentBuilder builder = domFactory.newDocumentBuilder();
|
||||
InputSource xmlSource = new InputSource(new StringReader(xmlStr));
|
||||
Document doc = builder.parse(xmlSource);
|
||||
|
||||
XPathFactory factory = XPathFactory.newInstance();
|
||||
XPath xpath = factory.newXPath();
|
||||
|
||||
xpath.evaluate(expression, doc, XPathConstants.BOOLEAN); // $hasXPathInjection
|
||||
xpath.evaluateExpression(expression, xmlSource); // $hasXPathInjection
|
||||
xpath.compile("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
|
||||
XPathImplStub xpathStub = XPathImplStub.getInstance();
|
||||
xpathStub.evaluate(expression, doc, XPathConstants.BOOLEAN); // $hasXPathInjection
|
||||
xpathStub.evaluateExpression(expression, xmlSource); // $hasXPathInjection
|
||||
xpathStub.compile("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
|
||||
// Injectable data
|
||||
String user = request.getParameter("user");
|
||||
String pass = request.getParameter("pass");
|
||||
if (user != null && pass != null) {
|
||||
// Bad expression
|
||||
String expression1 = "/users/user[@name='" + user + "' and @pass='" + pass + "']";
|
||||
xpath.evaluate(expression1, doc, XPathConstants.BOOLEAN); // $hasXPathInjection
|
||||
xpathStub.evaluate(expression1, doc, XPathConstants.BOOLEAN); // $hasXPathInjection
|
||||
xpath.evaluateExpression(expression1, xmlSource); // $hasXPathInjection
|
||||
xpathStub.evaluateExpression(expression1, xmlSource); // $hasXPathInjection
|
||||
StringBuffer sb = new StringBuffer("/users/user[@name=");
|
||||
sb.append(user);
|
||||
sb.append("' and @pass='");
|
||||
sb.append(pass);
|
||||
sb.append("']");
|
||||
String query = sb.toString();
|
||||
|
||||
// Bad expression
|
||||
XPathExpression expression2 = xpath.compile("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
xpathStub.compile("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
expression2.evaluate(doc, XPathConstants.BOOLEAN);
|
||||
xpath.compile(query); // $hasXPathInjection
|
||||
xpathStub.compile(query); // $hasXPathInjection
|
||||
|
||||
// Bad expression
|
||||
StringBuffer sb = new StringBuffer("/users/user[@name=");
|
||||
sb.append(user);
|
||||
sb.append("' and @pass='");
|
||||
sb.append(pass);
|
||||
sb.append("']");
|
||||
String query = sb.toString();
|
||||
XPathExpression expression3 = xpath.compile(query); // $hasXPathInjection
|
||||
xpathStub.compile(query); // $hasXPathInjection
|
||||
expression3.evaluate(doc, XPathConstants.BOOLEAN);
|
||||
String expression4 = "/users/user[@name=$user and @pass=$pass]";
|
||||
xpath.setXPathVariableResolver(v -> {
|
||||
switch (v.getLocalPart()) {
|
||||
case "user":
|
||||
return user;
|
||||
case "pass":
|
||||
return pass;
|
||||
default:
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
});
|
||||
xpath.evaluate(expression4, doc, XPathConstants.BOOLEAN); // Safe
|
||||
|
||||
// Good expression
|
||||
String expression4 = "/users/user[@name=$user and @pass=$pass]";
|
||||
xpath.setXPathVariableResolver(v -> {
|
||||
switch (v.getLocalPart()) {
|
||||
case "user":
|
||||
return user;
|
||||
case "pass":
|
||||
return pass;
|
||||
default:
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
});
|
||||
xpath.evaluate(expression4, doc, XPathConstants.BOOLEAN); // Safe
|
||||
SAXReader reader = new SAXReader();
|
||||
org.dom4j.Document document = reader.read(new ByteArrayInputStream(xmlStr.getBytes()));
|
||||
document.selectObject("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
document.selectNodes("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
document.selectNodes("/users/user[@name='test']", "/users/user[@pass='" + pass + "']"); // $hasXPathInjection
|
||||
document.selectSingleNode("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
document.valueOf("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
document.numberValueOf("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
document.matches("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
document.createXPath("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
|
||||
// Bad Dom4j
|
||||
org.dom4j.io.SAXReader reader = new org.dom4j.io.SAXReader();
|
||||
org.dom4j.Document document = reader.read(new ByteArrayInputStream(xmlStr.getBytes()));
|
||||
document.selectObject("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
document.selectNodes("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
document.selectNodes("/users/user[@name='test']", "/users/user[@pass='" + pass + "']"); // $hasXPathInjection
|
||||
document.selectSingleNode("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
document.valueOf("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
document.numberValueOf("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
document.matches("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
document.createXPath("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
}
|
||||
new DefaultXPath("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
new XPathPattern("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
|
||||
DocumentFactory docFactory = DocumentFactory.getInstance();
|
||||
docFactory.createPattern("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
docFactory.createXPath("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
docFactory.createXPathFilter("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
|
||||
DocumentHelper.createPattern("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
DocumentHelper.createXPath("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
DocumentHelper.createXPathFilter("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
|
||||
ProxyDocumentFactoryStub proxyDocFactory = new ProxyDocumentFactoryStub();
|
||||
proxyDocFactory.createPattern("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
proxyDocFactory.createXPath("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
proxyDocFactory.createXPathFilter("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
|
||||
Namespace namespace = new Namespace("prefix", "http://some.uri.io");
|
||||
namespace.createPattern("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
namespace.createXPathFilter("/users/user[@name='" + user + "' and @pass='" + pass + "']"); // $hasXPathInjection
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
//semmle-extractor-options: --javac-args -cp ${testdir}/../../../../stubs/dom4j-2.1.1:${testdir}/../../../../stubs/servlet-api-2.4
|
||||
//semmle-extractor-options: --javac-args -cp ${testdir}/../../../../stubs/dom4j-2.1.1:${testdir}/../../../../stubs/servlet-api-2.4:${testdir}/../../../../stubs/jaxen-1.2.0
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
|
||||
*
|
||||
* This software is open source.
|
||||
* See the bottom of this file for the licence.
|
||||
*/
|
||||
|
||||
package org.dom4j;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
import org.dom4j.rule.Pattern;
|
||||
import org.jaxen.VariableContext;
|
||||
|
||||
public class DocumentFactory implements Serializable {
|
||||
public DocumentFactory() {
|
||||
}
|
||||
|
||||
public static synchronized DocumentFactory getInstance() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Document createDocument() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Document createDocument(String encoding) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Document createDocument(Element rootElement) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Element createElement(String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Element createElement(String qualifiedName, String namespaceURI) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Namespace createNamespace(String prefix, String uri) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public XPath createXPath(String xpathExpression) throws InvalidXPathException {
|
||||
return null;
|
||||
}
|
||||
|
||||
public XPath createXPath(String xpathExpression, VariableContext variableContext) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public NodeFilter createXPathFilter(String xpathFilterExpression, VariableContext variableContext) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public NodeFilter createXPathFilter(String xpathFilterExpression) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Pattern createPattern(String xpathPattern) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Map<String, String> getXPathNamespaceURIs() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setXPathNamespaceURIs(Map<String, String> namespaceURIs) {
|
||||
}
|
||||
|
||||
}
|
||||
66
java/ql/test/stubs/dom4j-2.1.1/org/dom4j/DocumentHelper.java
Normal file
66
java/ql/test/stubs/dom4j-2.1.1/org/dom4j/DocumentHelper.java
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
|
||||
*
|
||||
* This software is open source.
|
||||
* See the bottom of this file for the licence.
|
||||
*/
|
||||
|
||||
package org.dom4j;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.dom4j.rule.Pattern;
|
||||
import org.jaxen.VariableContext;
|
||||
|
||||
public final class DocumentHelper {
|
||||
public static Document createDocument() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Document createDocument(Element rootElement) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Element createElement(String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Namespace createNamespace(String prefix, String uri) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static XPath createXPath(String xpathExpression) throws InvalidXPathException {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static XPath createXPath(String xpathExpression, VariableContext context) throws InvalidXPathException {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static NodeFilter createXPathFilter(String xpathFilterExpression) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Pattern createPattern(String xpathPattern) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<Node> selectNodes(String xpathFilterExpression, List<Node> nodes) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<Node> selectNodes(String xpathFilterExpression, Node node) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void sort(List<Node> list, String xpathExpression) {
|
||||
}
|
||||
|
||||
public static void sort(List<Node> list, String expression, boolean distinct) {
|
||||
}
|
||||
|
||||
public static Element makeElement(Branch source, String path) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
140
java/ql/test/stubs/dom4j-2.1.1/org/dom4j/Element.java
Normal file
140
java/ql/test/stubs/dom4j-2.1.1/org/dom4j/Element.java
Normal file
@@ -0,0 +1,140 @@
|
||||
/*
|
||||
* Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
|
||||
*
|
||||
* This software is open source.
|
||||
* See the bottom of this file for the licence.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Adapted from DOM4J version 2.1.1 as available at
|
||||
* https://search.maven.org/remotecontent?filepath=org/dom4j/dom4j/2.1.1/dom4j-2.1.1-sources.jar
|
||||
* Only relevant stubs of this file have been retained for test purposes.
|
||||
*/
|
||||
package org.dom4j;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface Element extends Branch {
|
||||
|
||||
Namespace getNamespace();
|
||||
|
||||
Namespace getNamespaceForPrefix(String prefix);
|
||||
|
||||
Namespace getNamespaceForURI(String uri);
|
||||
|
||||
List<Namespace> getNamespacesForURI(String uri);
|
||||
|
||||
String getNamespacePrefix();
|
||||
|
||||
String getNamespaceURI();
|
||||
|
||||
String getQualifiedName();
|
||||
|
||||
List<Namespace> additionalNamespaces();
|
||||
|
||||
List<Namespace> declaredNamespaces();
|
||||
|
||||
Element addAttribute(String name, String value);
|
||||
|
||||
Element addComment(String comment);
|
||||
|
||||
Element addCDATA(String cdata);
|
||||
|
||||
Element addEntity(String name, String text);
|
||||
|
||||
Element addNamespace(String prefix, String uri);
|
||||
|
||||
Element addProcessingInstruction(String target, String text);
|
||||
|
||||
Element addProcessingInstruction(String target, Map<String, String> data);
|
||||
|
||||
Element addText(String text);
|
||||
|
||||
void add(Namespace namespace);
|
||||
|
||||
String getText();
|
||||
|
||||
String getTextTrim();
|
||||
|
||||
String getStringValue();
|
||||
|
||||
Object getData();
|
||||
|
||||
void setData(Object data);
|
||||
|
||||
int attributeCount();
|
||||
|
||||
String attributeValue(String name);
|
||||
|
||||
String attributeValue(String name, String defaultValue);
|
||||
|
||||
void setAttributeValue(String name, String value);
|
||||
|
||||
Element element(String name);
|
||||
|
||||
List<Element> elements();
|
||||
|
||||
List<Element> elements(String name);
|
||||
|
||||
Iterator<Element> elementIterator();
|
||||
|
||||
Iterator<Element> elementIterator(String name);
|
||||
|
||||
boolean isRootElement();
|
||||
|
||||
boolean hasMixedContent();
|
||||
|
||||
boolean isTextOnly();
|
||||
|
||||
void appendAttributes(Element element);
|
||||
|
||||
Element createCopy();
|
||||
|
||||
Element createCopy(String name);
|
||||
|
||||
String elementText(String name);
|
||||
|
||||
String elementTextTrim(String name);
|
||||
|
||||
Node getXPathResult(int index);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Redistribution and use of this software and associated documentation
|
||||
* ("Software"), with or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain copyright statements and
|
||||
* notices. Redistributions must also contain a copy of this document.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. The name "DOM4J" must not be used to endorse or promote products derived
|
||||
* from this Software without prior written permission of MetaStuff, Ltd. For
|
||||
* written permission, please contact dom4j-info@metastuff.com.
|
||||
*
|
||||
* 4. Products derived from this Software may not be called "DOM4J" nor may
|
||||
* "DOM4J" appear in their names without prior written permission of MetaStuff,
|
||||
* Ltd. DOM4J is a registered trademark of MetaStuff, Ltd.
|
||||
*
|
||||
* 5. Due credit should be given to the DOM4J Project - http://www.dom4j.org
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL METASTUFF, LTD. OR ITS CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
|
||||
*/
|
||||
119
java/ql/test/stubs/dom4j-2.1.1/org/dom4j/Namespace.java
Normal file
119
java/ql/test/stubs/dom4j-2.1.1/org/dom4j/Namespace.java
Normal file
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
|
||||
*
|
||||
* This software is open source.
|
||||
* See the bottom of this file for the licence.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Adapted from DOM4J version 2.1.1 as available at
|
||||
* https://search.maven.org/remotecontent?filepath=org/dom4j/dom4j/2.1.1/dom4j-2.1.1-sources.jar
|
||||
* Only relevant stubs of this file have been retained for test purposes.
|
||||
*/
|
||||
|
||||
package org.dom4j;
|
||||
|
||||
import org.dom4j.tree.AbstractNode;
|
||||
|
||||
public class Namespace extends AbstractNode {
|
||||
|
||||
public Namespace(String prefix, String uri) {
|
||||
}
|
||||
|
||||
public static Namespace get(String prefix, String uri) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Namespace get(String uri) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public short getNodeType() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public boolean equals(Object object) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getStringValue() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getPrefix() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getURI() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getXPathNameStep() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getPath(Element context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getUniquePath(Element context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String asXML() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void accept(Visitor visitor) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Redistribution and use of this software and associated documentation
|
||||
* ("Software"), with or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain copyright statements and
|
||||
* notices. Redistributions must also contain a copy of this document.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. The name "DOM4J" must not be used to endorse or promote products derived
|
||||
* from this Software without prior written permission of MetaStuff, Ltd. For
|
||||
* written permission, please contact dom4j-info@metastuff.com.
|
||||
*
|
||||
* 4. Products derived from this Software may not be called "DOM4J" nor may
|
||||
* "DOM4J" appear in their names without prior written permission of MetaStuff,
|
||||
* Ltd. DOM4J is a registered trademark of MetaStuff, Ltd.
|
||||
*
|
||||
* 5. Due credit should be given to the DOM4J Project - http://www.dom4j.org
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL METASTUFF, LTD. OR ITS CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
|
||||
*/
|
||||
@@ -15,8 +15,6 @@ package org.dom4j;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.xpath.XPath;
|
||||
|
||||
public interface Node extends Cloneable {
|
||||
|
||||
List<Node> selectNodes(String xpathExpression);
|
||||
|
||||
56
java/ql/test/stubs/dom4j-2.1.1/org/dom4j/NodeFilter.java
Normal file
56
java/ql/test/stubs/dom4j-2.1.1/org/dom4j/NodeFilter.java
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
|
||||
*
|
||||
* This software is open source.
|
||||
* See the bottom of this file for the licence.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Adapted from DOM4J version 2.1.1 as available at
|
||||
* https://search.maven.org/remotecontent?filepath=org/dom4j/dom4j/2.1.1/dom4j-2.1.1-sources.jar
|
||||
* Only relevant stubs of this file have been retained for test purposes.
|
||||
*/
|
||||
|
||||
package org.dom4j;
|
||||
|
||||
public interface NodeFilter {
|
||||
boolean matches(Node node);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Redistribution and use of this software and associated documentation
|
||||
* ("Software"), with or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain copyright statements and
|
||||
* notices. Redistributions must also contain a copy of this document.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. The name "DOM4J" must not be used to endorse or promote products derived
|
||||
* from this Software without prior written permission of MetaStuff, Ltd. For
|
||||
* written permission, please contact dom4j-info@metastuff.com.
|
||||
*
|
||||
* 4. Products derived from this Software may not be called "DOM4J" nor may
|
||||
* "DOM4J" appear in their names without prior written permission of MetaStuff,
|
||||
* Ltd. DOM4J is a registered trademark of MetaStuff, Ltd.
|
||||
*
|
||||
* 5. Due credit should be given to the DOM4J Project - http://www.dom4j.org
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL METASTUFF, LTD. OR ITS CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
|
||||
*/
|
||||
60
java/ql/test/stubs/dom4j-2.1.1/org/dom4j/Visitor.java
Normal file
60
java/ql/test/stubs/dom4j-2.1.1/org/dom4j/Visitor.java
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
|
||||
*
|
||||
* This software is open source.
|
||||
* See the bottom of this file for the licence.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Adapted from DOM4J version 2.1.1 as available at
|
||||
* https://search.maven.org/remotecontent?filepath=org/dom4j/dom4j/2.1.1/dom4j-2.1.1-sources.jar
|
||||
* Only relevant stubs of this file have been retained for test purposes.
|
||||
*/
|
||||
|
||||
package org.dom4j;
|
||||
|
||||
public interface Visitor {
|
||||
void visit(Document document);
|
||||
|
||||
void visit(Element node);
|
||||
|
||||
void visit(Namespace namespace);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Redistribution and use of this software and associated documentation
|
||||
* ("Software"), with or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain copyright statements and
|
||||
* notices. Redistributions must also contain a copy of this document.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. The name "DOM4J" must not be used to endorse or promote products derived
|
||||
* from this Software without prior written permission of MetaStuff, Ltd. For
|
||||
* written permission, please contact dom4j-info@metastuff.com.
|
||||
*
|
||||
* 4. Products derived from this Software may not be called "DOM4J" nor may
|
||||
* "DOM4J" appear in their names without prior written permission of MetaStuff,
|
||||
* Ltd. DOM4J is a registered trademark of MetaStuff, Ltd.
|
||||
*
|
||||
* 5. Due credit should be given to the DOM4J Project - http://www.dom4j.org
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL METASTUFF, LTD. OR ITS CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
|
||||
*/
|
||||
85
java/ql/test/stubs/dom4j-2.1.1/org/dom4j/XPath.java
Normal file
85
java/ql/test/stubs/dom4j-2.1.1/org/dom4j/XPath.java
Normal file
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
|
||||
*
|
||||
* This software is open source.
|
||||
* See the bottom of this file for the licence.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Adapted from DOM4J version 2.1.1 as available at
|
||||
* https://search.maven.org/remotecontent?filepath=org/dom4j/dom4j/2.1.1/dom4j-2.1.1-sources.jar
|
||||
* Only relevant stubs of this file have been retained for test purposes.
|
||||
*/
|
||||
|
||||
package org.dom4j;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface XPath extends NodeFilter {
|
||||
String getText();
|
||||
|
||||
boolean matches(Node node);
|
||||
|
||||
Object evaluate(Object context);
|
||||
|
||||
Object selectObject(Object context);
|
||||
|
||||
List<Node> selectNodes(Object context);
|
||||
|
||||
List<Node> selectNodes(Object context, XPath sortXPath);
|
||||
|
||||
List<Node> selectNodes(Object context, XPath sortXPath, boolean distinct);
|
||||
|
||||
Node selectSingleNode(Object context);
|
||||
|
||||
String valueOf(Object context);
|
||||
|
||||
Number numberValueOf(Object context);
|
||||
|
||||
boolean booleanValueOf(Object context);
|
||||
|
||||
void sort(List<Node> list);
|
||||
|
||||
void sort(List<Node> list, boolean distinct);
|
||||
|
||||
void setNamespaceURIs(Map<String, String> map);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Redistribution and use of this software and associated documentation
|
||||
* ("Software"), with or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain copyright statements and
|
||||
* notices. Redistributions must also contain a copy of this document.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. The name "DOM4J" must not be used to endorse or promote products derived
|
||||
* from this Software without prior written permission of MetaStuff, Ltd. For
|
||||
* written permission, please contact dom4j-info@metastuff.com.
|
||||
*
|
||||
* 4. Products derived from this Software may not be called "DOM4J" nor may
|
||||
* "DOM4J" appear in their names without prior written permission of MetaStuff,
|
||||
* Ltd. DOM4J is a registered trademark of MetaStuff, Ltd.
|
||||
*
|
||||
* 5. Due credit should be given to the DOM4J Project - http://www.dom4j.org
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL METASTUFF, LTD. OR ITS CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
|
||||
*/
|
||||
67
java/ql/test/stubs/dom4j-2.1.1/org/dom4j/rule/Pattern.java
Normal file
67
java/ql/test/stubs/dom4j-2.1.1/org/dom4j/rule/Pattern.java
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
|
||||
*
|
||||
* This software is open source.
|
||||
* See the bottom of this file for the licence.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Adapted from DOM4J version 2.1.1 as available at
|
||||
* https://search.maven.org/remotecontent?filepath=org/dom4j/dom4j/2.1.1/dom4j-2.1.1-sources.jar
|
||||
* Only relevant stubs of this file have been retained for test purposes.
|
||||
*/
|
||||
|
||||
package org.dom4j.rule;
|
||||
|
||||
import org.dom4j.Node;
|
||||
import org.dom4j.NodeFilter;
|
||||
|
||||
public interface Pattern extends NodeFilter {
|
||||
boolean matches(Node node);
|
||||
|
||||
double getPriority();
|
||||
|
||||
Pattern[] getUnionPatterns();
|
||||
|
||||
short getMatchType();
|
||||
|
||||
String getMatchesNodeName();
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Redistribution and use of this software and associated documentation
|
||||
* ("Software"), with or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain copyright statements and
|
||||
* notices. Redistributions must also contain a copy of this document.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. The name "DOM4J" must not be used to endorse or promote products derived
|
||||
* from this Software without prior written permission of MetaStuff, Ltd. For
|
||||
* written permission, please contact dom4j-info@metastuff.com.
|
||||
*
|
||||
* 4. Products derived from this Software may not be called "DOM4J" nor may
|
||||
* "DOM4J" appear in their names without prior written permission of MetaStuff,
|
||||
* Ltd. DOM4J is a registered trademark of MetaStuff, Ltd.
|
||||
*
|
||||
* 5. Due credit should be given to the DOM4J Project - http://www.dom4j.org
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL METASTUFF, LTD. OR ITS CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
|
||||
*/
|
||||
183
java/ql/test/stubs/dom4j-2.1.1/org/dom4j/tree/AbstractNode.java
Normal file
183
java/ql/test/stubs/dom4j-2.1.1/org/dom4j/tree/AbstractNode.java
Normal file
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
|
||||
*
|
||||
* This software is open source.
|
||||
* See the bottom of this file for the licence.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Adapted from DOM4J version 2.1.1 as available at
|
||||
* https://search.maven.org/remotecontent?filepath=org/dom4j/dom4j/2.1.1/dom4j-2.1.1-sources.jar
|
||||
* Only relevant stubs of this file have been retained for test purposes.
|
||||
*/
|
||||
|
||||
package org.dom4j.tree;
|
||||
|
||||
import org.dom4j.*;
|
||||
import org.dom4j.rule.Pattern;
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.io.Writer;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class AbstractNode implements Node, Cloneable, Serializable {
|
||||
public AbstractNode() {
|
||||
}
|
||||
|
||||
public short getNodeType() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getNodeTypeName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Document getDocument() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setDocument(Document document) {
|
||||
}
|
||||
|
||||
public Element getParent() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setParent(Element parent) {
|
||||
}
|
||||
|
||||
public boolean supportsParent() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isReadOnly() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasContent() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getUniquePath() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Object clone() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Node detach() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getStringValue() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setText(String text) {
|
||||
}
|
||||
|
||||
public void write(Writer writer) throws IOException {
|
||||
}
|
||||
|
||||
public Object selectObject(String xpathExpression) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<Node> selectNodes(String xpathExpression) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<Node> selectNodes(String xpathExpression, String comparisonXPathExpression) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<Node> selectNodes(String xpathExpression, String comparisonXPathExpression, boolean removeDuplicates) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Node selectSingleNode(String xpathExpression) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String valueOf(String xpathExpression) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Number numberValueOf(String xpathExpression) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean matches(String patternText) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public XPath createXPath(String xpathExpression) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public NodeFilter createXPathFilter(String patternText) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Pattern createPattern(String patternText) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Node asXPathResult(Element parent) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Redistribution and use of this software and associated documentation
|
||||
* ("Software"), with or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain copyright statements and
|
||||
* notices. Redistributions must also contain a copy of this document.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. The name "DOM4J" must not be used to endorse or promote products derived
|
||||
* from this Software without prior written permission of MetaStuff, Ltd. For
|
||||
* written permission, please contact dom4j-info@metastuff.com.
|
||||
*
|
||||
* 4. Products derived from this Software may not be called "DOM4J" nor may
|
||||
* "DOM4J" appear in their names without prior written permission of MetaStuff,
|
||||
* Ltd. DOM4J is a registered trademark of MetaStuff, Ltd.
|
||||
*
|
||||
* 5. Due credit should be given to the DOM4J Project - http://www.dom4j.org
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL METASTUFF, LTD. OR ITS CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
|
||||
*/
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
|
||||
*
|
||||
* This software is open source.
|
||||
* See the bottom of this file for the licence.
|
||||
*/
|
||||
|
||||
package org.dom4j.util;
|
||||
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentFactory;
|
||||
import org.dom4j.Element;
|
||||
import org.dom4j.NodeFilter;
|
||||
import org.dom4j.XPath;
|
||||
import org.dom4j.rule.Pattern;
|
||||
import org.jaxen.VariableContext;
|
||||
|
||||
public abstract class ProxyDocumentFactory {
|
||||
public ProxyDocumentFactory() {
|
||||
}
|
||||
|
||||
public ProxyDocumentFactory(DocumentFactory proxy) {
|
||||
}
|
||||
|
||||
public Document createDocument() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Document createDocument(Element rootElement) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Element createElement(String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public XPath createXPath(String xpathExpression) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public XPath createXPath(String xpathExpression, VariableContext variableContext) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public NodeFilter createXPathFilter(String xpathFilterExpression, VariableContext variableContext) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public NodeFilter createXPathFilter(String xpathFilterExpression) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Pattern createPattern(String xpathPattern) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
131
java/ql/test/stubs/dom4j-2.1.1/org/dom4j/xpath/DefaultXPath.java
Normal file
131
java/ql/test/stubs/dom4j-2.1.1/org/dom4j/xpath/DefaultXPath.java
Normal file
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
* Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
|
||||
*
|
||||
* This software is open source.
|
||||
* See the bottom of this file for the licence.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Adapted from DOM4J version 2.1.1 as available at
|
||||
* https://search.maven.org/remotecontent?filepath=org/dom4j/dom4j/2.1.1/dom4j-2.1.1-sources.jar
|
||||
* Only relevant stubs of this file have been retained for test purposes.
|
||||
*/
|
||||
|
||||
package org.dom4j.xpath;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.dom4j.InvalidXPathException;
|
||||
import org.dom4j.Node;
|
||||
import org.dom4j.XPath;
|
||||
|
||||
public class DefaultXPath implements org.dom4j.XPath, Serializable {
|
||||
public DefaultXPath(String text) throws InvalidXPathException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(Node node) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object evaluate(Object context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object selectObject(Object context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Node> selectNodes(Object context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Node> selectNodes(Object context, XPath sortXPath) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Node> selectNodes(Object context, XPath sortXPath, boolean distinct) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Node selectSingleNode(Object context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String valueOf(Object context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Number numberValueOf(Object context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean booleanValueOf(Object context) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sort(List<Node> list) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sort(List<Node> list, boolean distinct) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNamespaceURIs(Map<String, String> map) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Redistribution and use of this software and associated documentation
|
||||
* ("Software"), with or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain copyright statements and
|
||||
* notices. Redistributions must also contain a copy of this document.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. The name "DOM4J" must not be used to endorse or promote products derived
|
||||
* from this Software without prior written permission of MetaStuff, Ltd. For
|
||||
* written permission, please contact dom4j-info@metastuff.com.
|
||||
*
|
||||
* 4. Products derived from this Software may not be called "DOM4J" nor may
|
||||
* "DOM4J" appear in their names without prior written permission of MetaStuff,
|
||||
* Ltd. DOM4J is a registered trademark of MetaStuff, Ltd.
|
||||
*
|
||||
* 5. Due credit should be given to the DOM4J Project - http://www.dom4j.org
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL METASTUFF, LTD. OR ITS CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
|
||||
*/
|
||||
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
|
||||
*
|
||||
* This software is open source.
|
||||
* See the bottom of this file for the licence.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Adapted from DOM4J version 2.1.1 as available at
|
||||
* https://search.maven.org/remotecontent?filepath=org/dom4j/dom4j/2.1.1/dom4j-2.1.1-sources.jar
|
||||
* Only relevant stubs of this file have been retained for test purposes.
|
||||
*/
|
||||
|
||||
package org.dom4j.xpath;
|
||||
|
||||
import org.dom4j.Node;
|
||||
|
||||
public class XPathPattern implements org.dom4j.rule.Pattern {
|
||||
public XPathPattern(String text) {
|
||||
}
|
||||
|
||||
public boolean matches(Node node) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public double getPriority() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public org.dom4j.rule.Pattern[] getUnionPatterns() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public short getMatchType() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getMatchesNodeName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Redistribution and use of this software and associated documentation
|
||||
* ("Software"), with or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain copyright statements and
|
||||
* notices. Redistributions must also contain a copy of this document.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. The name "DOM4J" must not be used to endorse or promote products derived
|
||||
* from this Software without prior written permission of MetaStuff, Ltd. For
|
||||
* written permission, please contact dom4j-info@metastuff.com.
|
||||
*
|
||||
* 4. Products derived from this Software may not be called "DOM4J" nor may
|
||||
* "DOM4J" appear in their names without prior written permission of MetaStuff,
|
||||
* Ltd. DOM4J is a registered trademark of MetaStuff, Ltd.
|
||||
*
|
||||
* 5. Due credit should be given to the DOM4J Project - http://www.dom4j.org
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL METASTUFF, LTD. OR ITS CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
|
||||
*/
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* $Header$
|
||||
* $Revision$
|
||||
* $Date$
|
||||
*
|
||||
* ====================================================================
|
||||
*
|
||||
* Copyright 2000-2002 bob mcwhirter & James Strachan.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of the Jaxen Project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
|
||||
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* ====================================================================
|
||||
* This software consists of voluntary contributions made by many
|
||||
* individuals on behalf of the Jaxen Project and was originally
|
||||
* created by bob mcwhirter <bob@werken.com> and
|
||||
* James Strachan <jstrachan@apache.org>. For more information on the
|
||||
* Jaxen Project, please see <http://www.jaxen.org/>.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Adapted from Jaxen version 1.2.0 as available at
|
||||
* https://repo1.maven.org/maven2/jaxen/jaxen/1.2.0/jaxen-1.2.0-sources.jar
|
||||
* Only relevant stubs of this file have been retained for test purposes.
|
||||
*/
|
||||
|
||||
package org.jaxen;
|
||||
|
||||
public interface VariableContext {
|
||||
public Object getVariableValue(String namespaceURI, String prefix, String localName);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user