repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
jaliss/securesocial | module-code/app/securesocial/core/java/BasePasswordValidator.java | BasePasswordValidator.toScalaTuple | protected Tuple2<String, Seq<Object>> toScalaTuple(String message, List<Object> params) {
return new Tuple2<String, Seq<Object>>(message, JavaConverters.collectionAsScalaIterableConverter(params).asScala().toSeq());
} | java | protected Tuple2<String, Seq<Object>> toScalaTuple(String message, List<Object> params) {
return new Tuple2<String, Seq<Object>>(message, JavaConverters.collectionAsScalaIterableConverter(params).asScala().toSeq());
} | [
"protected",
"Tuple2",
"<",
"String",
",",
"Seq",
"<",
"Object",
">",
">",
"toScalaTuple",
"(",
"String",
"message",
",",
"List",
"<",
"Object",
">",
"params",
")",
"{",
"return",
"new",
"Tuple2",
"<",
"String",
",",
"Seq",
"<",
"Object",
">",
">",
"... | A helper method to create the tuple expected by PasswordValidator from a Java String and List objects.
@param message
@param params
@return | [
"A",
"helper",
"method",
"to",
"create",
"the",
"tuple",
"expected",
"by",
"PasswordValidator",
"from",
"a",
"Java",
"String",
"and",
"List",
"objects",
"."
] | 0f9710325724da34a46c5ecefb439121fce837b7 | https://github.com/jaliss/securesocial/blob/0f9710325724da34a46c5ecefb439121fce837b7/module-code/app/securesocial/core/java/BasePasswordValidator.java#L43-L45 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/Validator.java | Validator.validate | private void validate() {
if (isValid != null) {
return;
}
ParsingValidator v =
new ParsingValidator(useSchema ? Languages.W3C_XML_SCHEMA_NS_URI
: Languages.XML_DTD_NS_URI);
List<Source> schemaSourceList = new ArrayList<Source>();... | java | private void validate() {
if (isValid != null) {
return;
}
ParsingValidator v =
new ParsingValidator(useSchema ? Languages.W3C_XML_SCHEMA_NS_URI
: Languages.XML_DTD_NS_URI);
List<Source> schemaSourceList = new ArrayList<Source>();... | [
"private",
"void",
"validate",
"(",
")",
"{",
"if",
"(",
"isValid",
"!=",
"null",
")",
"{",
"return",
";",
"}",
"ParsingValidator",
"v",
"=",
"new",
"ParsingValidator",
"(",
"useSchema",
"?",
"Languages",
".",
"W3C_XML_SCHEMA_NS_URI",
":",
"Languages",
".",
... | Actually perform validation. | [
"Actually",
"perform",
"validation",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/Validator.java#L310-L346 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/Validator.java | Validator.invalidate | private void invalidate(String message) {
isValid = Boolean.FALSE;
messages.append(message).append(' ');
} | java | private void invalidate(String message) {
isValid = Boolean.FALSE;
messages.append(message).append(' ');
} | [
"private",
"void",
"invalidate",
"(",
"String",
"message",
")",
"{",
"isValid",
"=",
"Boolean",
".",
"FALSE",
";",
"messages",
".",
"append",
"(",
"message",
")",
".",
"append",
"(",
"'",
"'",
")",
";",
"}"
] | Set the validation status flag to false and capture the message for use
later.
@param message | [
"Set",
"the",
"validation",
"status",
"flag",
"to",
"false",
"and",
"capture",
"the",
"message",
"for",
"use",
"later",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/Validator.java#L363-L366 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/SimpleXpathEngine.java | SimpleXpathEngine.getXSLTBase | private StringBuilder getXSLTBase() {
StringBuilder result = new StringBuilder(XML_DECLARATION)
.append(XMLUnit.getXSLTStart());
String tmp = result.toString();
int close = tmp.lastIndexOf('>');
if (close == -1) {
close = tmp.length();
}
result.ins... | java | private StringBuilder getXSLTBase() {
StringBuilder result = new StringBuilder(XML_DECLARATION)
.append(XMLUnit.getXSLTStart());
String tmp = result.toString();
int close = tmp.lastIndexOf('>');
if (close == -1) {
close = tmp.length();
}
result.ins... | [
"private",
"StringBuilder",
"getXSLTBase",
"(",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
"XML_DECLARATION",
")",
".",
"append",
"(",
"XMLUnit",
".",
"getXSLTStart",
"(",
")",
")",
";",
"String",
"tmp",
"=",
"result",
".",
"toStr... | What every XSL transform needs | [
"What",
"every",
"XSL",
"transform",
"needs"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/SimpleXpathEngine.java#L74-L84 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/SimpleXpathEngine.java | SimpleXpathEngine.performTransform | private void performTransform(String xslt, Document document,
Result result)
throws TransformerException, ConfigurationException, XpathException {
try {
StreamSource source = new StreamSource(new StringReader(xslt));
TransformerFactory tf = XMLUn... | java | private void performTransform(String xslt, Document document,
Result result)
throws TransformerException, ConfigurationException, XpathException {
try {
StreamSource source = new StreamSource(new StringReader(xslt));
TransformerFactory tf = XMLUn... | [
"private",
"void",
"performTransform",
"(",
"String",
"xslt",
",",
"Document",
"document",
",",
"Result",
"result",
")",
"throws",
"TransformerException",
",",
"ConfigurationException",
",",
"XpathException",
"{",
"try",
"{",
"StreamSource",
"source",
"=",
"new",
... | Perform the actual transformation work required
@param xslt
@param document
@param result
@throws XpathException
@throws TransformerException
@throws ConfigurationException | [
"Perform",
"the",
"actual",
"transformation",
"work",
"required"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/SimpleXpathEngine.java#L130-L164 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/SimpleXpathEngine.java | SimpleXpathEngine.getXPathResultNode | protected Node getXPathResultNode(String select, Document document)
throws ConfigurationException, TransformerException, XpathException {
return getXPathResultAsDocument(select, document).getDocumentElement();
} | java | protected Node getXPathResultNode(String select, Document document)
throws ConfigurationException, TransformerException, XpathException {
return getXPathResultAsDocument(select, document).getDocumentElement();
} | [
"protected",
"Node",
"getXPathResultNode",
"(",
"String",
"select",
",",
"Document",
"document",
")",
"throws",
"ConfigurationException",
",",
"TransformerException",
",",
"XpathException",
"{",
"return",
"getXPathResultAsDocument",
"(",
"select",
",",
"document",
")",
... | Testable method to execute the copy-of transform and return the root
node of the resulting Document.
@param select
@param document
@throws ConfigurationException
@throws TransformerException
@return the root node of the Document created by the copy-of transform. | [
"Testable",
"method",
"to",
"execute",
"the",
"copy",
"-",
"of",
"transform",
"and",
"return",
"the",
"root",
"node",
"of",
"the",
"resulting",
"Document",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/SimpleXpathEngine.java#L175-L178 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/SimpleXpathEngine.java | SimpleXpathEngine.getXPathResultAsDocument | protected Document getXPathResultAsDocument(String select,
Document document)
throws ConfigurationException, TransformerException, XpathException {
DOMResult result = new DOMResult();
performTransform(getCopyTransformation(select), document, result... | java | protected Document getXPathResultAsDocument(String select,
Document document)
throws ConfigurationException, TransformerException, XpathException {
DOMResult result = new DOMResult();
performTransform(getCopyTransformation(select), document, result... | [
"protected",
"Document",
"getXPathResultAsDocument",
"(",
"String",
"select",
",",
"Document",
"document",
")",
"throws",
"ConfigurationException",
",",
"TransformerException",
",",
"XpathException",
"{",
"DOMResult",
"result",
"=",
"new",
"DOMResult",
"(",
")",
";",
... | Execute the copy-of transform and return the resulting Document.
Used for XMLTestCase comparison
@param select
@param document
@throws ConfigurationException
@throws TransformerException
@return the Document created by the copy-of transform. | [
"Execute",
"the",
"copy",
"-",
"of",
"transform",
"and",
"return",
"the",
"resulting",
"Document",
".",
"Used",
"for",
"XMLTestCase",
"comparison"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/SimpleXpathEngine.java#L189-L195 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/SimpleXpathEngine.java | SimpleXpathEngine.getNamespaceDeclarations | private String getNamespaceDeclarations() {
StringBuilder nsDecls = new StringBuilder();
String quoteStyle = "'";
for (Iterator keys = ctx.getPrefixes(); keys.hasNext(); ) {
String prefix = (String) keys.next();
String uri = ctx.getNamespaceURI(prefix);
if (ur... | java | private String getNamespaceDeclarations() {
StringBuilder nsDecls = new StringBuilder();
String quoteStyle = "'";
for (Iterator keys = ctx.getPrefixes(); keys.hasNext(); ) {
String prefix = (String) keys.next();
String uri = ctx.getNamespaceURI(prefix);
if (ur... | [
"private",
"String",
"getNamespaceDeclarations",
"(",
")",
"{",
"StringBuilder",
"nsDecls",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"String",
"quoteStyle",
"=",
"\"'\"",
";",
"for",
"(",
"Iterator",
"keys",
"=",
"ctx",
".",
"getPrefixes",
"(",
")",
";",
... | returns namespace declarations for all namespaces known to the
current context. | [
"returns",
"namespace",
"declarations",
"for",
"all",
"namespaces",
"known",
"to",
"the",
"current",
"context",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/SimpleXpathEngine.java#L241-L267 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/ElementNameAndTextQualifier.java | ElementNameAndTextQualifier.similar | protected boolean similar(Text control, Text test) {
if (control == null) {
return test == null;
} else if (test == null) {
return false;
}
return control.getNodeValue().equals(test.getNodeValue());
} | java | protected boolean similar(Text control, Text test) {
if (control == null) {
return test == null;
} else if (test == null) {
return false;
}
return control.getNodeValue().equals(test.getNodeValue());
} | [
"protected",
"boolean",
"similar",
"(",
"Text",
"control",
",",
"Text",
"test",
")",
"{",
"if",
"(",
"control",
"==",
"null",
")",
"{",
"return",
"test",
"==",
"null",
";",
"}",
"else",
"if",
"(",
"test",
"==",
"null",
")",
"{",
"return",
"false",
... | Determine whether the text nodes contain similar values
@param control
@param test
@return true if text nodes are similar, false otherwise | [
"Determine",
"whether",
"the",
"text",
"nodes",
"contain",
"similar",
"values"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/ElementNameAndTextQualifier.java#L71-L78 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/ElementNameAndTextQualifier.java | ElementNameAndTextQualifier.extractText | protected Text extractText(Element fromElement) {
fromElement.normalize();
NodeList fromNodeList = fromElement.getChildNodes();
Node currentNode;
for (int i=0; i < fromNodeList.getLength(); ++i) {
currentNode = fromNodeList.item(i);
if (currentNode.getNodeType() ... | java | protected Text extractText(Element fromElement) {
fromElement.normalize();
NodeList fromNodeList = fromElement.getChildNodes();
Node currentNode;
for (int i=0; i < fromNodeList.getLength(); ++i) {
currentNode = fromNodeList.item(i);
if (currentNode.getNodeType() ... | [
"protected",
"Text",
"extractText",
"(",
"Element",
"fromElement",
")",
"{",
"fromElement",
".",
"normalize",
"(",
")",
";",
"NodeList",
"fromNodeList",
"=",
"fromElement",
".",
"getChildNodes",
"(",
")",
";",
"Node",
"currentNode",
";",
"for",
"(",
"int",
"... | Extract the normalized text from within an element
@param fromElement
@return extracted Text node (could be null) | [
"Extract",
"the",
"normalized",
"text",
"from",
"within",
"an",
"element"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/ElementNameAndTextQualifier.java#L85-L96 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/diff/DifferenceEvaluators.java | DifferenceEvaluators.first | public static DifferenceEvaluator
first(final DifferenceEvaluator... evaluators) {
return new DifferenceEvaluator() {
@Override
public ComparisonResult evaluate(Comparison comparison,
ComparisonResult orig) {
for (Diffe... | java | public static DifferenceEvaluator
first(final DifferenceEvaluator... evaluators) {
return new DifferenceEvaluator() {
@Override
public ComparisonResult evaluate(Comparison comparison,
ComparisonResult orig) {
for (Diffe... | [
"public",
"static",
"DifferenceEvaluator",
"first",
"(",
"final",
"DifferenceEvaluator",
"...",
"evaluators",
")",
"{",
"return",
"new",
"DifferenceEvaluator",
"(",
")",
"{",
"@",
"Override",
"public",
"ComparisonResult",
"evaluate",
"(",
"Comparison",
"comparison",
... | Combines multiple DifferenceEvaluators so that the first one
that changes the outcome wins. | [
"Combines",
"multiple",
"DifferenceEvaluators",
"so",
"that",
"the",
"first",
"one",
"that",
"changes",
"the",
"outcome",
"wins",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/DifferenceEvaluators.java#L91-L106 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/diff/DifferenceEvaluators.java | DifferenceEvaluators.chain | public static DifferenceEvaluator
chain(final DifferenceEvaluator... evaluators) {
return new DifferenceEvaluator() {
@Override
public ComparisonResult evaluate(Comparison comparison, ComparisonResult orig) {
ComparisonResult finalResult = orig;
fo... | java | public static DifferenceEvaluator
chain(final DifferenceEvaluator... evaluators) {
return new DifferenceEvaluator() {
@Override
public ComparisonResult evaluate(Comparison comparison, ComparisonResult orig) {
ComparisonResult finalResult = orig;
fo... | [
"public",
"static",
"DifferenceEvaluator",
"chain",
"(",
"final",
"DifferenceEvaluator",
"...",
"evaluators",
")",
"{",
"return",
"new",
"DifferenceEvaluator",
"(",
")",
"{",
"@",
"Override",
"public",
"ComparisonResult",
"evaluate",
"(",
"Comparison",
"comparison",
... | Combines multiple DifferenceEvaluators so that the result of the
first Evaluator will be passed to the next Evaluator. | [
"Combines",
"multiple",
"DifferenceEvaluators",
"so",
"that",
"the",
"result",
"of",
"the",
"first",
"Evaluator",
"will",
"be",
"passed",
"to",
"the",
"next",
"Evaluator",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/DifferenceEvaluators.java#L112-L125 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/util/Nodes.java | Nodes.getMergedNestedText | public static String getMergedNestedText(Node n) {
StringBuilder sb = new StringBuilder();
for (Node child : new IterableNodeList(n.getChildNodes())) {
if (child instanceof Text || child instanceof CDATASection) {
String s = child.getNodeValue();
if (s != null... | java | public static String getMergedNestedText(Node n) {
StringBuilder sb = new StringBuilder();
for (Node child : new IterableNodeList(n.getChildNodes())) {
if (child instanceof Text || child instanceof CDATASection) {
String s = child.getNodeValue();
if (s != null... | [
"public",
"static",
"String",
"getMergedNestedText",
"(",
"Node",
"n",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Node",
"child",
":",
"new",
"IterableNodeList",
"(",
"n",
".",
"getChildNodes",
"(",
")",
")",
... | Tries to merge all direct Text and CDATA children of the given
Node and concatenates their value.
@return an empty string if the Node has no Text or CDATA
children. | [
"Tries",
"to",
"merge",
"all",
"direct",
"Text",
"and",
"CDATA",
"children",
"of",
"the",
"given",
"Node",
"and",
"concatenates",
"their",
"value",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/util/Nodes.java#L58-L69 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/util/Nodes.java | Nodes.getAttributes | public static Map<QName, String> getAttributes(Node n) {
Map<QName, String> map = new LinkedHashMap<QName, String>();
NamedNodeMap m = n.getAttributes();
if (m != null) {
final int len = m.getLength();
for (int i = 0; i < len; i++) {
Attr a = (Attr) m.item... | java | public static Map<QName, String> getAttributes(Node n) {
Map<QName, String> map = new LinkedHashMap<QName, String>();
NamedNodeMap m = n.getAttributes();
if (m != null) {
final int len = m.getLength();
for (int i = 0; i < len; i++) {
Attr a = (Attr) m.item... | [
"public",
"static",
"Map",
"<",
"QName",
",",
"String",
">",
"getAttributes",
"(",
"Node",
"n",
")",
"{",
"Map",
"<",
"QName",
",",
"String",
">",
"map",
"=",
"new",
"LinkedHashMap",
"<",
"QName",
",",
"String",
">",
"(",
")",
";",
"NamedNodeMap",
"m... | Obtains an element's attributes as Map. | [
"Obtains",
"an",
"element",
"s",
"attributes",
"as",
"Map",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/util/Nodes.java#L74-L85 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/util/Nodes.java | Nodes.handleWsRec | private static void handleWsRec(Node n, boolean normalize) {
if (n instanceof CharacterData || n instanceof ProcessingInstruction) {
String s = n.getNodeValue().trim();
if (normalize) {
s = normalize(s);
}
n.setNodeValue(s);
}
List<... | java | private static void handleWsRec(Node n, boolean normalize) {
if (n instanceof CharacterData || n instanceof ProcessingInstruction) {
String s = n.getNodeValue().trim();
if (normalize) {
s = normalize(s);
}
n.setNodeValue(s);
}
List<... | [
"private",
"static",
"void",
"handleWsRec",
"(",
"Node",
"n",
",",
"boolean",
"normalize",
")",
"{",
"if",
"(",
"n",
"instanceof",
"CharacterData",
"||",
"n",
"instanceof",
"ProcessingInstruction",
")",
"{",
"String",
"s",
"=",
"n",
".",
"getNodeValue",
"(",... | Trims textual content of this node, removes empty text and
CDATA children, recurses into its child nodes.
@param normalize whether to normalize whitespace as well | [
"Trims",
"textual",
"content",
"of",
"this",
"node",
"removes",
"empty",
"text",
"and",
"CDATA",
"children",
"recurses",
"into",
"its",
"child",
"nodes",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/util/Nodes.java#L139-L166 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/util/Nodes.java | Nodes.normalize | static String normalize(String s) {
StringBuilder sb = new StringBuilder();
boolean changed = false;
boolean lastCharWasWS = false;
final int len = s.length();
for (int i = 0; i < len; i++) {
char c = s.charAt(i);
if (Character.isWhitespace(c)) {
... | java | static String normalize(String s) {
StringBuilder sb = new StringBuilder();
boolean changed = false;
boolean lastCharWasWS = false;
final int len = s.length();
for (int i = 0; i < len; i++) {
char c = s.charAt(i);
if (Character.isWhitespace(c)) {
... | [
"static",
"String",
"normalize",
"(",
"String",
"s",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"boolean",
"changed",
"=",
"false",
";",
"boolean",
"lastCharWasWS",
"=",
"false",
";",
"final",
"int",
"len",
"=",
"s",
"."... | Normalize a string.
<p>"normalized" in this context means all whitespace characters
are replaced by space characters and consecutive whitespace
characaters are collapsed.</p> | [
"Normalize",
"a",
"string",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/util/Nodes.java#L175-L196 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java | XMLAssert.assertXMLEqual | public static void assertXMLEqual(String msg, Diff diff,
boolean assertion) {
if (assertion != diff.similar()) {
fail(getFailMessage(msg, diff));
}
} | java | public static void assertXMLEqual(String msg, Diff diff,
boolean assertion) {
if (assertion != diff.similar()) {
fail(getFailMessage(msg, diff));
}
} | [
"public",
"static",
"void",
"assertXMLEqual",
"(",
"String",
"msg",
",",
"Diff",
"diff",
",",
"boolean",
"assertion",
")",
"{",
"if",
"(",
"assertion",
"!=",
"diff",
".",
"similar",
"(",
")",
")",
"{",
"fail",
"(",
"getFailMessage",
"(",
"msg",
",",
"d... | Assert that the result of an XML comparison is or is not similar.
@param msg additional message to display if assertion fails
@param diff the result of an XML comparison
@param assertion true if asserting that result is similar | [
"Assert",
"that",
"the",
"result",
"of",
"an",
"XML",
"comparison",
"is",
"or",
"is",
"not",
"similar",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java#L126-L131 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java | XMLAssert.assertXMLIdentical | public static void assertXMLIdentical(String msg, Diff diff, boolean assertion) {
if (assertion != diff.identical()) {
fail(getFailMessage(msg, diff));
}
} | java | public static void assertXMLIdentical(String msg, Diff diff, boolean assertion) {
if (assertion != diff.identical()) {
fail(getFailMessage(msg, diff));
}
} | [
"public",
"static",
"void",
"assertXMLIdentical",
"(",
"String",
"msg",
",",
"Diff",
"diff",
",",
"boolean",
"assertion",
")",
"{",
"if",
"(",
"assertion",
"!=",
"diff",
".",
"identical",
"(",
")",
")",
"{",
"fail",
"(",
"getFailMessage",
"(",
"msg",
","... | Assert that the result of an XML comparison is or is not identical
@param msg Message to display if assertion fails
@param diff the result of an XML comparison
@param assertion true if asserting that result is identical | [
"Assert",
"that",
"the",
"result",
"of",
"an",
"XML",
"comparison",
"is",
"or",
"is",
"not",
"identical"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java#L156-L160 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java | XMLAssert.assertXpathsEqual | public static void assertXpathsEqual(String controlXpath, String testXpath,
Document document)
throws XpathException {
assertXpathsEqual(controlXpath, document, testXpath, document);
} | java | public static void assertXpathsEqual(String controlXpath, String testXpath,
Document document)
throws XpathException {
assertXpathsEqual(controlXpath, document, testXpath, document);
} | [
"public",
"static",
"void",
"assertXpathsEqual",
"(",
"String",
"controlXpath",
",",
"String",
"testXpath",
",",
"Document",
"document",
")",
"throws",
"XpathException",
"{",
"assertXpathsEqual",
"(",
"controlXpath",
",",
"document",
",",
"testXpath",
",",
"document... | Assert that the node lists of two Xpaths in the same document are equal
@param controlXpath
@param testXpath
@param document
@see XpathEngine | [
"Assert",
"that",
"the",
"node",
"lists",
"of",
"two",
"Xpaths",
"in",
"the",
"same",
"document",
"are",
"equal"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java#L369-L373 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java | XMLAssert.assertXpathsEqual | public static void assertXpathsEqual(String controlXpath,
Document controlDocument,
String testXpath,
Document testDocument)
throws XpathException {
assertXpathEquality(controlXpath... | java | public static void assertXpathsEqual(String controlXpath,
Document controlDocument,
String testXpath,
Document testDocument)
throws XpathException {
assertXpathEquality(controlXpath... | [
"public",
"static",
"void",
"assertXpathsEqual",
"(",
"String",
"controlXpath",
",",
"Document",
"controlDocument",
",",
"String",
"testXpath",
",",
"Document",
"testDocument",
")",
"throws",
"XpathException",
"{",
"assertXpathEquality",
"(",
"controlXpath",
",",
"con... | Assert that the node lists of two Xpaths in two documents are equal
@param controlXpath
@param testXpath
@param controlDocument
@param testDocument
@see XpathEngine | [
"Assert",
"that",
"the",
"node",
"lists",
"of",
"two",
"Xpaths",
"in",
"two",
"documents",
"are",
"equal"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java#L452-L459 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java | XMLAssert.assertXpathsNotEqual | public static void assertXpathsNotEqual(String controlXpath,
String testXpath,
Document document)
throws XpathException {
assertXpathsNotEqual(controlXpath, document, testXpath, document);
} | java | public static void assertXpathsNotEqual(String controlXpath,
String testXpath,
Document document)
throws XpathException {
assertXpathsNotEqual(controlXpath, document, testXpath, document);
} | [
"public",
"static",
"void",
"assertXpathsNotEqual",
"(",
"String",
"controlXpath",
",",
"String",
"testXpath",
",",
"Document",
"document",
")",
"throws",
"XpathException",
"{",
"assertXpathsNotEqual",
"(",
"controlXpath",
",",
"document",
",",
"testXpath",
",",
"do... | Assert that the node lists of two Xpaths in the same document are NOT equal
@param controlXpath
@param testXpath
@param document
@see XpathEngine | [
"Assert",
"that",
"the",
"node",
"lists",
"of",
"two",
"Xpaths",
"in",
"the",
"same",
"document",
"are",
"NOT",
"equal"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java#L468-L473 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java | XMLAssert.assertXpathsNotEqual | public static void assertXpathsNotEqual(String controlXpath,
InputSource controlDocument,
String testXpath,
InputSource testDocument)
throws SAXException, IOException, XpathExcepti... | java | public static void assertXpathsNotEqual(String controlXpath,
InputSource controlDocument,
String testXpath,
InputSource testDocument)
throws SAXException, IOException, XpathExcepti... | [
"public",
"static",
"void",
"assertXpathsNotEqual",
"(",
"String",
"controlXpath",
",",
"InputSource",
"controlDocument",
",",
"String",
"testXpath",
",",
"InputSource",
"testDocument",
")",
"throws",
"SAXException",
",",
"IOException",
",",
"XpathException",
"{",
"as... | Assert that the node lists of two Xpaths in two XML strings are
NOT equal
@param controlXpath
@param controlDocument
@param testXpath
@param testDocument
@throws SAXException
@throws IOException | [
"Assert",
"that",
"the",
"node",
"lists",
"of",
"two",
"Xpaths",
"in",
"two",
"XML",
"strings",
"are",
"NOT",
"equal"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java#L537-L546 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java | XMLAssert.assertXpathsNotEqual | public static void assertXpathsNotEqual(String controlXpath,
Document controlDocument,
String testXpath,
Document testDocument)
throws XpathException {
assertXpathEquality(... | java | public static void assertXpathsNotEqual(String controlXpath,
Document controlDocument,
String testXpath,
Document testDocument)
throws XpathException {
assertXpathEquality(... | [
"public",
"static",
"void",
"assertXpathsNotEqual",
"(",
"String",
"controlXpath",
",",
"Document",
"controlDocument",
",",
"String",
"testXpath",
",",
"Document",
"testDocument",
")",
"throws",
"XpathException",
"{",
"assertXpathEquality",
"(",
"controlXpath",
",",
"... | Assert that the node lists of two Xpaths in two documents are NOT equal
@param controlXpath
@param testXpath
@param controlDocument
@param testDocument
@see XpathEngine | [
"Assert",
"that",
"the",
"node",
"lists",
"of",
"two",
"Xpaths",
"in",
"two",
"documents",
"are",
"NOT",
"equal"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java#L556-L563 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java | XMLAssert.assertXpathEquality | private static void assertXpathEquality(String controlXpath,
Document controlDocument,
String testXpath,
Document testDocument,
boolean equal)
... | java | private static void assertXpathEquality(String controlXpath,
Document controlDocument,
String testXpath,
Document testDocument,
boolean equal)
... | [
"private",
"static",
"void",
"assertXpathEquality",
"(",
"String",
"controlXpath",
",",
"Document",
"controlDocument",
",",
"String",
"testXpath",
",",
"Document",
"testDocument",
",",
"boolean",
"equal",
")",
"throws",
"XpathException",
"{",
"XpathEngine",
"xpath",
... | Assert that the node lists of two Xpaths in two documents are
equal or not.
@param controlXpath
@param testXpath
@param controlDocument
@param testDocument
@param equal whether the values should be equal.
@see XpathEngine | [
"Assert",
"that",
"the",
"node",
"lists",
"of",
"two",
"Xpaths",
"in",
"two",
"documents",
"are",
"equal",
"or",
"not",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java#L575-L589 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java | XMLAssert.assertXpathValuesEqual | public static void assertXpathValuesEqual(String controlXpath,
String testXpath,
Document document)
throws XpathException {
assertXpathValuesEqual(controlXpath, document, testXpath, document);
} | java | public static void assertXpathValuesEqual(String controlXpath,
String testXpath,
Document document)
throws XpathException {
assertXpathValuesEqual(controlXpath, document, testXpath, document);
} | [
"public",
"static",
"void",
"assertXpathValuesEqual",
"(",
"String",
"controlXpath",
",",
"String",
"testXpath",
",",
"Document",
"document",
")",
"throws",
"XpathException",
"{",
"assertXpathValuesEqual",
"(",
"controlXpath",
",",
"document",
",",
"testXpath",
",",
... | Assert that the evaluation of two Xpaths in the same document are equal
@param controlXpath
@param testXpath
@param document
@see XpathEngine | [
"Assert",
"that",
"the",
"evaluation",
"of",
"two",
"Xpaths",
"in",
"the",
"same",
"document",
"are",
"equal"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java#L598-L603 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java | XMLAssert.assertXpathValuesEqual | public static void assertXpathValuesEqual(String controlXpath,
Document controlDocument,
String testXpath,
Document testDocument)
throws XpathException {
XpathEngine ... | java | public static void assertXpathValuesEqual(String controlXpath,
Document controlDocument,
String testXpath,
Document testDocument)
throws XpathException {
XpathEngine ... | [
"public",
"static",
"void",
"assertXpathValuesEqual",
"(",
"String",
"controlXpath",
",",
"Document",
"controlDocument",
",",
"String",
"testXpath",
",",
"Document",
"testDocument",
")",
"throws",
"XpathException",
"{",
"XpathEngine",
"xpath",
"=",
"XMLUnit",
".",
"... | Assert that the evaluation of two Xpaths in two documents are equal
@param controlXpath
@param testXpath
@param controlDocument
@param testDocument
@see XpathEngine | [
"Assert",
"that",
"the",
"evaluation",
"of",
"two",
"Xpaths",
"in",
"two",
"documents",
"are",
"equal"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java#L689-L697 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java | XMLAssert.assertXpathValuesNotEqual | public static void assertXpathValuesNotEqual(String controlXpath,
String testXpath,
Document document)
throws XpathException {
assertXpathValuesNotEqual(controlXpath, document, testXpath, document);
} | java | public static void assertXpathValuesNotEqual(String controlXpath,
String testXpath,
Document document)
throws XpathException {
assertXpathValuesNotEqual(controlXpath, document, testXpath, document);
} | [
"public",
"static",
"void",
"assertXpathValuesNotEqual",
"(",
"String",
"controlXpath",
",",
"String",
"testXpath",
",",
"Document",
"document",
")",
"throws",
"XpathException",
"{",
"assertXpathValuesNotEqual",
"(",
"controlXpath",
",",
"document",
",",
"testXpath",
... | Assert that the evaluation of two Xpaths in the same document are
NOT equal
@param controlXpath
@param testXpath
@param document | [
"Assert",
"that",
"the",
"evaluation",
"of",
"two",
"Xpaths",
"in",
"the",
"same",
"document",
"are",
"NOT",
"equal"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java#L741-L746 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java | XMLAssert.assertXpathValuesNotEqual | public static void assertXpathValuesNotEqual(String controlXpath,
Document controlDocument,
String testXpath,
Document testDocument)
throws XpathException {
... | java | public static void assertXpathValuesNotEqual(String controlXpath,
Document controlDocument,
String testXpath,
Document testDocument)
throws XpathException {
... | [
"public",
"static",
"void",
"assertXpathValuesNotEqual",
"(",
"String",
"controlXpath",
",",
"Document",
"controlDocument",
",",
"String",
"testXpath",
",",
"Document",
"testDocument",
")",
"throws",
"XpathException",
"{",
"XpathEngine",
"xpath",
"=",
"XMLUnit",
".",
... | Assert that the evaluation of two Xpaths in two documents are
NOT equal
@param controlXpath
@param testXpath
@param controlDocument
@param testDocument | [
"Assert",
"that",
"the",
"evaluation",
"of",
"two",
"Xpaths",
"in",
"two",
"documents",
"are",
"NOT",
"equal"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java#L799-L815 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java | XMLAssert.assertXpathEvaluatesTo | public static void assertXpathEvaluatesTo(String expectedValue,
String xpathExpression,
InputSource control)
throws SAXException, IOException,
XpathException {
Document document = XMLUnit.buildCont... | java | public static void assertXpathEvaluatesTo(String expectedValue,
String xpathExpression,
InputSource control)
throws SAXException, IOException,
XpathException {
Document document = XMLUnit.buildCont... | [
"public",
"static",
"void",
"assertXpathEvaluatesTo",
"(",
"String",
"expectedValue",
",",
"String",
"xpathExpression",
",",
"InputSource",
"control",
")",
"throws",
"SAXException",
",",
"IOException",
",",
"XpathException",
"{",
"Document",
"document",
"=",
"XMLUnit"... | Assert the value of an Xpath expression in an XML document.
@param expectedValue
@param xpathExpression
@param control
@throws SAXException
@throws IOException
@see XpathEngine which provides the underlying evaluation mechanism | [
"Assert",
"the",
"value",
"of",
"an",
"Xpath",
"expression",
"in",
"an",
"XML",
"document",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java#L826-L833 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java | XMLAssert.assertXpathNotExists | public static void assertXpathNotExists(String xPathExpression,
Document inDocument)
throws XpathException {
XpathEngine simpleXpathEngine = XMLUnit.newXpathEngine();
NodeList nodeList = simpleXpathEngine.getMatchingNodes(
... | java | public static void assertXpathNotExists(String xPathExpression,
Document inDocument)
throws XpathException {
XpathEngine simpleXpathEngine = XMLUnit.newXpathEngine();
NodeList nodeList = simpleXpathEngine.getMatchingNodes(
... | [
"public",
"static",
"void",
"assertXpathNotExists",
"(",
"String",
"xPathExpression",
",",
"Document",
"inDocument",
")",
"throws",
"XpathException",
"{",
"XpathEngine",
"simpleXpathEngine",
"=",
"XMLUnit",
".",
"newXpathEngine",
"(",
")",
";",
"NodeList",
"nodeList",... | Assert that a specific XPath does NOT exist in some given XML
@param xPathExpression
@param inDocument
@see XpathEngine which provides the underlying evaluation mechanism | [
"Assert",
"that",
"a",
"specific",
"XPath",
"does",
"NOT",
"exist",
"in",
"some",
"given",
"XML"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java#L1005-L1014 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/Transform.java | Transform.provideSystemIdIfRequired | private void provideSystemIdIfRequired(Source source) {
if (source!=null && (source.getSystemId() == null
|| source.getSystemId().length() == 0)) {
source.setSystemId(getDefaultSystemId());
}
} | java | private void provideSystemIdIfRequired(Source source) {
if (source!=null && (source.getSystemId() == null
|| source.getSystemId().length() == 0)) {
source.setSystemId(getDefaultSystemId());
}
} | [
"private",
"void",
"provideSystemIdIfRequired",
"(",
"Source",
"source",
")",
"{",
"if",
"(",
"source",
"!=",
"null",
"&&",
"(",
"source",
".",
"getSystemId",
"(",
")",
"==",
"null",
"||",
"source",
".",
"getSystemId",
"(",
")",
".",
"length",
"(",
")",
... | Ensure that the source has a systemId
@param source | [
"Ensure",
"that",
"the",
"source",
"has",
"a",
"systemId"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/Transform.java#L165-L170 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/Transform.java | Transform.transformTo | protected void transformTo(final Result result) throws TransformerException {
withExceptionHandling(new Trans<Object>() {
public Object transform() {
transformation.transformTo(result);
return null;
}
});
} | java | protected void transformTo(final Result result) throws TransformerException {
withExceptionHandling(new Trans<Object>() {
public Object transform() {
transformation.transformTo(result);
return null;
}
});
} | [
"protected",
"void",
"transformTo",
"(",
"final",
"Result",
"result",
")",
"throws",
"TransformerException",
"{",
"withExceptionHandling",
"(",
"new",
"Trans",
"<",
"Object",
">",
"(",
")",
"{",
"public",
"Object",
"transform",
"(",
")",
"{",
"transformation",
... | Perform the actual transformation
@param result
@throws TransformerException | [
"Perform",
"the",
"actual",
"transformation"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/Transform.java#L188-L195 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/Transform.java | Transform.setOutputProperties | public void setOutputProperties(Properties outputProperties) {
for (Enumeration e = outputProperties.propertyNames();
e.hasMoreElements(); ) {
Object key = e.nextElement();
if (key != null) {
String name = key.toString();
String value = output... | java | public void setOutputProperties(Properties outputProperties) {
for (Enumeration e = outputProperties.propertyNames();
e.hasMoreElements(); ) {
Object key = e.nextElement();
if (key != null) {
String name = key.toString();
String value = output... | [
"public",
"void",
"setOutputProperties",
"(",
"Properties",
"outputProperties",
")",
"{",
"for",
"(",
"Enumeration",
"e",
"=",
"outputProperties",
".",
"propertyNames",
"(",
")",
";",
"e",
".",
"hasMoreElements",
"(",
")",
";",
")",
"{",
"Object",
"key",
"="... | Override output properties specified in the transformation stylesheet
@param outputProperties
@see Transformer#setOutputProperties(java.util.Properties) | [
"Override",
"output",
"properties",
"specified",
"in",
"the",
"transformation",
"stylesheet"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/Transform.java#L237-L249 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/Transform.java | Transform.setParameter | public void setParameter(String name, Object value) {
parameters.put(name, value);
transformation.addParameter(name, value);
} | java | public void setParameter(String name, Object value) {
parameters.put(name, value);
transformation.addParameter(name, value);
} | [
"public",
"void",
"setParameter",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"parameters",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"transformation",
".",
"addParameter",
"(",
"name",
",",
"value",
")",
";",
"}"
] | Add a parameter for the transformation
@param name
@param value
@see Transformer#setParameter(java.lang.String, java.lang.Object) | [
"Add",
"a",
"parameter",
"for",
"the",
"transformation"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/Transform.java#L257-L260 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/NodeInputStream.java | NodeInputStream.ensureContentAvailable | private void ensureContentAvailable() throws IOException {
if (nodeContentBytes.size() > 0) {
return;
}
try {
Transform serializeTransform = new Transform(rootNode);
if (outputProperties!=null) {
serializeTransform.setOutputProperties(outputPro... | java | private void ensureContentAvailable() throws IOException {
if (nodeContentBytes.size() > 0) {
return;
}
try {
Transform serializeTransform = new Transform(rootNode);
if (outputProperties!=null) {
serializeTransform.setOutputProperties(outputPro... | [
"private",
"void",
"ensureContentAvailable",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"nodeContentBytes",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"return",
";",
"}",
"try",
"{",
"Transform",
"serializeTransform",
"=",
"new",
"Transform",
"(",
... | Do the actual work of serializing the node to bytes
@throws IOException if serialization goes awry | [
"Do",
"the",
"actual",
"work",
"of",
"serializing",
"the",
"node",
"to",
"bytes"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/NodeInputStream.java#L78-L93 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/DoctypeReader.java | DoctypeReader.read | public int read(char[] cbuf, int off, int len) throws IOException {
int startPos = off;
int currentlyRead;
while (off - startPos < len && (currentlyRead = read()) != -1) {
cbuf[off++] = (char) currentlyRead;
}
return off == startPos && len != 0 ? -1 : off - startPos;
... | java | public int read(char[] cbuf, int off, int len) throws IOException {
int startPos = off;
int currentlyRead;
while (off - startPos < len && (currentlyRead = read()) != -1) {
cbuf[off++] = (char) currentlyRead;
}
return off == startPos && len != 0 ? -1 : off - startPos;
... | [
"public",
"int",
"read",
"(",
"char",
"[",
"]",
"cbuf",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"int",
"startPos",
"=",
"off",
";",
"int",
"currentlyRead",
";",
"while",
"(",
"off",
"-",
"startPos",
"<",
"len",
"&&",
... | Read DOCTYPE-replaced content from the wrapped Reader
@param cbuf
@param off
@param len
@return The number of characters read, or -1 if the end of the
stream has been reached
@throws IOException | [
"Read",
"DOCTYPE",
"-",
"replaced",
"content",
"from",
"the",
"wrapped",
"Reader"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/DoctypeReader.java#L124-L131 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/diff/RecursiveXPathBuilder.java | RecursiveXPathBuilder.setNamespaceContext | public void setNamespaceContext(Map<String, String> prefix2uri) {
this.prefix2uri = prefix2uri == null
? Collections.<String, String> emptyMap()
: Collections.unmodifiableMap(prefix2uri);
} | java | public void setNamespaceContext(Map<String, String> prefix2uri) {
this.prefix2uri = prefix2uri == null
? Collections.<String, String> emptyMap()
: Collections.unmodifiableMap(prefix2uri);
} | [
"public",
"void",
"setNamespaceContext",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"prefix2uri",
")",
"{",
"this",
".",
"prefix2uri",
"=",
"prefix2uri",
"==",
"null",
"?",
"Collections",
".",
"<",
"String",
",",
"String",
">",
"emptyMap",
"(",
")",
... | Establish a namespace context that will be used in for the
XPath.
<p>Without a namespace context (or with an empty context) the
XPath expressions will only use local names for elements and
attributes.</p>
@param prefix2uri maps from prefix to namespace URI. | [
"Establish",
"a",
"namespace",
"context",
"that",
"will",
"be",
"used",
"in",
"for",
"the",
"XPath",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/RecursiveXPathBuilder.java#L45-L49 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/Diff.java | Diff.appendDifference | private void appendDifference(StringBuilder appendTo, Difference difference) {
appendTo.append(' ').append(difference).append('\n');
} | java | private void appendDifference(StringBuilder appendTo, Difference difference) {
appendTo.append(' ').append(difference).append('\n');
} | [
"private",
"void",
"appendDifference",
"(",
"StringBuilder",
"appendTo",
",",
"Difference",
"difference",
")",
"{",
"appendTo",
".",
"append",
"(",
"'",
"'",
")",
".",
"append",
"(",
"difference",
")",
".",
"append",
"(",
"'",
"'",
")",
";",
"}"
] | Append a meaningful message to the buffer of messages
@param appendTo the messages buffer
@param difference | [
"Append",
"a",
"meaningful",
"message",
"to",
"the",
"buffer",
"of",
"messages"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/Diff.java#L268-L270 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/Diff.java | Diff.appendMessage | public StringBuffer appendMessage(StringBuffer toAppendTo) {
compare();
if (messages.length()==0) {
messages.append("[identical]");
}
// fix for JDK1.4 backwards incompatibility
return toAppendTo.append(messages.toString());
} | java | public StringBuffer appendMessage(StringBuffer toAppendTo) {
compare();
if (messages.length()==0) {
messages.append("[identical]");
}
// fix for JDK1.4 backwards incompatibility
return toAppendTo.append(messages.toString());
} | [
"public",
"StringBuffer",
"appendMessage",
"(",
"StringBuffer",
"toAppendTo",
")",
"{",
"compare",
"(",
")",
";",
"if",
"(",
"messages",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"messages",
".",
"append",
"(",
"\"[identical]\"",
")",
";",
"}",
"// f... | Append the message from the result of this Diff instance to a specified
StringBuffer
@param toAppendTo
@return specified StringBuffer with message appended | [
"Append",
"the",
"message",
"from",
"the",
"result",
"of",
"this",
"Diff",
"instance",
"to",
"a",
"specified",
"StringBuffer"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/Diff.java#L361-L368 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/Diff.java | Diff.getDifferenceEngine | private DifferenceEngineContract getDifferenceEngine() {
if (differenceEngine == null) {
if (
XMLUnit.getIgnoreAttributeOrder()
&&
(!usesUnknownElementQualifier()
|| XMLUnit.getCompareUnmatched())
) {
re... | java | private DifferenceEngineContract getDifferenceEngine() {
if (differenceEngine == null) {
if (
XMLUnit.getIgnoreAttributeOrder()
&&
(!usesUnknownElementQualifier()
|| XMLUnit.getCompareUnmatched())
) {
re... | [
"private",
"DifferenceEngineContract",
"getDifferenceEngine",
"(",
")",
"{",
"if",
"(",
"differenceEngine",
"==",
"null",
")",
"{",
"if",
"(",
"XMLUnit",
".",
"getIgnoreAttributeOrder",
"(",
")",
"&&",
"(",
"!",
"usesUnknownElementQualifier",
"(",
")",
"||",
"XM... | Lazily initializes the difference engine if it hasn't been set
via a constructor. | [
"Lazily",
"initializes",
"the",
"difference",
"engine",
"if",
"it",
"hasn",
"t",
"been",
"set",
"via",
"a",
"constructor",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/Diff.java#L420-L433 | train |
xmlunit/xmlunit | xmlunit-assertj/src/main/java/org/xmlunit/assertj/SingleNodeAssert.java | SingleNodeAssert.hasAttribute | public SingleNodeAssert hasAttribute(String attributeName) {
isNotNull();
final Map.Entry<QName, String> entry = attributeForName(attributeName);
if (entry == null) {
throwAssertionError(shouldHaveAttribute(actual.getNodeName(), attributeName));
}
return this;
} | java | public SingleNodeAssert hasAttribute(String attributeName) {
isNotNull();
final Map.Entry<QName, String> entry = attributeForName(attributeName);
if (entry == null) {
throwAssertionError(shouldHaveAttribute(actual.getNodeName(), attributeName));
}
return this;
} | [
"public",
"SingleNodeAssert",
"hasAttribute",
"(",
"String",
"attributeName",
")",
"{",
"isNotNull",
"(",
")",
";",
"final",
"Map",
".",
"Entry",
"<",
"QName",
",",
"String",
">",
"entry",
"=",
"attributeForName",
"(",
"attributeName",
")",
";",
"if",
"(",
... | Verifies that node has attribute with given name.
@throws AssertionError if the actual node is {@code null}.
@throws AssertionError if node has not attribute with given name. | [
"Verifies",
"that",
"node",
"has",
"attribute",
"with",
"given",
"name",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-assertj/src/main/java/org/xmlunit/assertj/SingleNodeAssert.java#L54-L62 | train |
xmlunit/xmlunit | xmlunit-assertj/src/main/java/org/xmlunit/assertj/SingleNodeAssert.java | SingleNodeAssert.hasAttribute | public SingleNodeAssert hasAttribute(String attributeName, String attributeValue) {
isNotNull();
final Map.Entry<QName, String> attribute = attributeForName(attributeName);
if (attribute == null || !attribute.getValue().equals(attributeValue)) {
throwAssertionError(shouldHaveAttribu... | java | public SingleNodeAssert hasAttribute(String attributeName, String attributeValue) {
isNotNull();
final Map.Entry<QName, String> attribute = attributeForName(attributeName);
if (attribute == null || !attribute.getValue().equals(attributeValue)) {
throwAssertionError(shouldHaveAttribu... | [
"public",
"SingleNodeAssert",
"hasAttribute",
"(",
"String",
"attributeName",
",",
"String",
"attributeValue",
")",
"{",
"isNotNull",
"(",
")",
";",
"final",
"Map",
".",
"Entry",
"<",
"QName",
",",
"String",
">",
"attribute",
"=",
"attributeForName",
"(",
"att... | Verifies that node has attribute with given name and value.
@throws AssertionError if the actual node is {@code null}.
@throws AssertionError if node has not attribute with given name and value. | [
"Verifies",
"that",
"node",
"has",
"attribute",
"with",
"given",
"name",
"and",
"value",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-assertj/src/main/java/org/xmlunit/assertj/SingleNodeAssert.java#L70-L79 | train |
xmlunit/xmlunit | xmlunit-assertj/src/main/java/org/xmlunit/assertj/SingleNodeAssert.java | SingleNodeAssert.doesNotHaveAttribute | public SingleNodeAssert doesNotHaveAttribute(String attributeName) {
isNotNull();
final Map.Entry<QName, String> entry = attributeForName(attributeName);
if (entry != null) {
throwAssertionError(shouldNotHaveAttribute(actual.getNodeName(), attributeName));
}
return t... | java | public SingleNodeAssert doesNotHaveAttribute(String attributeName) {
isNotNull();
final Map.Entry<QName, String> entry = attributeForName(attributeName);
if (entry != null) {
throwAssertionError(shouldNotHaveAttribute(actual.getNodeName(), attributeName));
}
return t... | [
"public",
"SingleNodeAssert",
"doesNotHaveAttribute",
"(",
"String",
"attributeName",
")",
"{",
"isNotNull",
"(",
")",
";",
"final",
"Map",
".",
"Entry",
"<",
"QName",
",",
"String",
">",
"entry",
"=",
"attributeForName",
"(",
"attributeName",
")",
";",
"if",
... | Verifies that node has not attribute with given name.
@throws AssertionError if the actual node is {@code null}.
@throws AssertionError if node has attribute with given name. | [
"Verifies",
"that",
"node",
"has",
"not",
"attribute",
"with",
"given",
"name",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-assertj/src/main/java/org/xmlunit/assertj/SingleNodeAssert.java#L87-L95 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/diff/AbstractDifferenceEngine.java | AbstractDifferenceEngine.compare | protected final ComparisonState compare(Comparison comp) {
Object controlValue = comp.getControlDetails().getValue();
Object testValue = comp.getTestDetails().getValue();
boolean equal = controlValue == null
? testValue == null : controlValue.equals(testValue);
ComparisonResu... | java | protected final ComparisonState compare(Comparison comp) {
Object controlValue = comp.getControlDetails().getValue();
Object testValue = comp.getTestDetails().getValue();
boolean equal = controlValue == null
? testValue == null : controlValue.equals(testValue);
ComparisonResu... | [
"protected",
"final",
"ComparisonState",
"compare",
"(",
"Comparison",
"comp",
")",
"{",
"Object",
"controlValue",
"=",
"comp",
".",
"getControlDetails",
"(",
")",
".",
"getValue",
"(",
")",
";",
"Object",
"testValue",
"=",
"comp",
".",
"getTestDetails",
"(",
... | Compares the detail values for object equality, lets the
difference evaluator and comparison controller evaluate the
result, notifies all listeners and returns the outcome.
@return the outcome as pair of result and a flag that says
"stop the whole comparison process" when true. | [
"Compares",
"the",
"detail",
"values",
"for",
"object",
"equality",
"lets",
"the",
"difference",
"evaluator",
"and",
"comparison",
"controller",
"evaluate",
"the",
"result",
"notifies",
"all",
"listeners",
"and",
"returns",
"the",
"outcome",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/AbstractDifferenceEngine.java#L168-L182 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java | XMLUnit.setIgnoreWhitespace | public static void setIgnoreWhitespace(boolean ignore){
ignoreWhitespace = ignore;
getControlDocumentBuilderFactory().setIgnoringElementContentWhitespace(ignore);
getTestDocumentBuilderFactory().setIgnoringElementContentWhitespace(ignore);
} | java | public static void setIgnoreWhitespace(boolean ignore){
ignoreWhitespace = ignore;
getControlDocumentBuilderFactory().setIgnoringElementContentWhitespace(ignore);
getTestDocumentBuilderFactory().setIgnoringElementContentWhitespace(ignore);
} | [
"public",
"static",
"void",
"setIgnoreWhitespace",
"(",
"boolean",
"ignore",
")",
"{",
"ignoreWhitespace",
"=",
"ignore",
";",
"getControlDocumentBuilderFactory",
"(",
")",
".",
"setIgnoringElementContentWhitespace",
"(",
"ignore",
")",
";",
"getTestDocumentBuilderFactory... | Whether to ignore whitespace when comparing node values.
<p>This method also invokes
<code>setIgnoringElementContentWhitespace()</code> on the
underlying control AND test document builder factories.</p>
<p>Setting this parameter has no effect on {@link
#setNormalizeWhitespace whitespace inside texts}.</p> | [
"Whether",
"to",
"ignore",
"whitespace",
"when",
"comparing",
"node",
"values",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java#L283-L287 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java | XMLUnit.buildControlDocument | public static Document buildControlDocument(String fromXML)
throws SAXException, IOException {
return buildDocument(newControlParser(), new StringReader(fromXML));
} | java | public static Document buildControlDocument(String fromXML)
throws SAXException, IOException {
return buildDocument(newControlParser(), new StringReader(fromXML));
} | [
"public",
"static",
"Document",
"buildControlDocument",
"(",
"String",
"fromXML",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"return",
"buildDocument",
"(",
"newControlParser",
"(",
")",
",",
"new",
"StringReader",
"(",
"fromXML",
")",
")",
";",
"}"... | Utility method to build a Document using the control DocumentBuilder
to parse the specified String.
@param fromXML
@return Document representation of the String content
@throws SAXException
@throws IOException | [
"Utility",
"method",
"to",
"build",
"a",
"Document",
"using",
"the",
"control",
"DocumentBuilder",
"to",
"parse",
"the",
"specified",
"String",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java#L306-L309 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java | XMLUnit.buildDocument | public static Document buildDocument(DocumentBuilder withBuilder,
Reader fromReader) throws SAXException, IOException {
return buildDocument(withBuilder, new InputSource(fromReader));
} | java | public static Document buildDocument(DocumentBuilder withBuilder,
Reader fromReader) throws SAXException, IOException {
return buildDocument(withBuilder, new InputSource(fromReader));
} | [
"public",
"static",
"Document",
"buildDocument",
"(",
"DocumentBuilder",
"withBuilder",
",",
"Reader",
"fromReader",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"return",
"buildDocument",
"(",
"withBuilder",
",",
"new",
"InputSource",
"(",
"fromReader",
... | Utility method to build a Document using a specific DocumentBuilder
and reading characters from a specific Reader.
@param withBuilder
@param fromReader
@return Document built
@throws SAXException
@throws IOException | [
"Utility",
"method",
"to",
"build",
"a",
"Document",
"using",
"a",
"specific",
"DocumentBuilder",
"and",
"reading",
"characters",
"from",
"a",
"specific",
"Reader",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java#L359-L362 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java | XMLUnit.buildDocument | public static Document buildDocument(DocumentBuilder withBuilder,
InputSource fromSource) throws IOException, SAXException {
return withBuilder.parse(fromSource);
} | java | public static Document buildDocument(DocumentBuilder withBuilder,
InputSource fromSource) throws IOException, SAXException {
return withBuilder.parse(fromSource);
} | [
"public",
"static",
"Document",
"buildDocument",
"(",
"DocumentBuilder",
"withBuilder",
",",
"InputSource",
"fromSource",
")",
"throws",
"IOException",
",",
"SAXException",
"{",
"return",
"withBuilder",
".",
"parse",
"(",
"fromSource",
")",
";",
"}"
] | Utility method to build a Document using a specific DocumentBuilder
and a specific InputSource
@param withBuilder
@param fromSource
@return Document built
@throws SAXException
@throws IOException | [
"Utility",
"method",
"to",
"build",
"a",
"Document",
"using",
"a",
"specific",
"DocumentBuilder",
"and",
"a",
"specific",
"InputSource"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java#L372-L375 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java | XMLUnit.setURIResolver | public static void setURIResolver(URIResolver resolver) {
if (uriResolver != resolver) {
uriResolver = resolver;
transformerFactory = null;
getTransformerFactory();
}
} | java | public static void setURIResolver(URIResolver resolver) {
if (uriResolver != resolver) {
uriResolver = resolver;
transformerFactory = null;
getTransformerFactory();
}
} | [
"public",
"static",
"void",
"setURIResolver",
"(",
"URIResolver",
"resolver",
")",
"{",
"if",
"(",
"uriResolver",
"!=",
"resolver",
")",
"{",
"uriResolver",
"=",
"resolver",
";",
"transformerFactory",
"=",
"null",
";",
"getTransformerFactory",
"(",
")",
";",
"... | Sets the URIResolver to use during transformations. | [
"Sets",
"the",
"URIResolver",
"to",
"use",
"during",
"transformations",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java#L421-L427 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java | XMLUnit.getSAXParserFactory | public static SAXParserFactory getSAXParserFactory() {
if (saxParserFactory == null) {
saxParserFactory = SAXParserFactory.newInstance();
saxParserFactory.setNamespaceAware(true);
}
return saxParserFactory;
} | java | public static SAXParserFactory getSAXParserFactory() {
if (saxParserFactory == null) {
saxParserFactory = SAXParserFactory.newInstance();
saxParserFactory.setNamespaceAware(true);
}
return saxParserFactory;
} | [
"public",
"static",
"SAXParserFactory",
"getSAXParserFactory",
"(",
")",
"{",
"if",
"(",
"saxParserFactory",
"==",
"null",
")",
"{",
"saxParserFactory",
"=",
"SAXParserFactory",
".",
"newInstance",
"(",
")",
";",
"saxParserFactory",
".",
"setNamespaceAware",
"(",
... | Get the SAX parser to use in tests.
<p>Unless an instance has been given via {@link
#setSAXParserFactory(SAXParserFactory) setSAXParserFactory}
explicitly, the returned factory will be namespace aware.</p>
@return the SAXParserFactory instance used by the {@link
Validator Validator} to perform DTD validation | [
"Get",
"the",
"SAX",
"parser",
"to",
"use",
"in",
"tests",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java#L466-L472 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java | XMLUnit.getWhitespaceStrippedDocument | public static Document getWhitespaceStrippedDocument(Document forDoc) {
String factory = getTransformerFactory().getClass().getName();
if (XSLTConstants.JAVA5_XSLTC_FACTORY_NAME.equals(factory)) {
return stripWhiteSpaceWithoutXSLT(forDoc);
} else {
return stripWhiteSpaceU... | java | public static Document getWhitespaceStrippedDocument(Document forDoc) {
String factory = getTransformerFactory().getClass().getName();
if (XSLTConstants.JAVA5_XSLTC_FACTORY_NAME.equals(factory)) {
return stripWhiteSpaceWithoutXSLT(forDoc);
} else {
return stripWhiteSpaceU... | [
"public",
"static",
"Document",
"getWhitespaceStrippedDocument",
"(",
"Document",
"forDoc",
")",
"{",
"String",
"factory",
"=",
"getTransformerFactory",
"(",
")",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
";",
"if",
"(",
"XSLTConstants",
".",
"JAVA5... | Returns a new Document instance that is identical to the one
passed in with element content whitespace removed.
<p>Will use {@link #getStripWhitespaceTransform
getStripWhitespaceTransform} unless we are operating under the
severly broken XSLTC Transformer shipping with JDK 1.5.</p> | [
"Returns",
"a",
"new",
"Document",
"instance",
"that",
"is",
"identical",
"to",
"the",
"one",
"passed",
"in",
"with",
"element",
"content",
"whitespace",
"removed",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java#L497-L504 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java | XMLUnit.compareXML | public static Diff compareXML(InputSource control, InputSource test)
throws SAXException, IOException {
return new Diff(control, test);
} | java | public static Diff compareXML(InputSource control, InputSource test)
throws SAXException, IOException {
return new Diff(control, test);
} | [
"public",
"static",
"Diff",
"compareXML",
"(",
"InputSource",
"control",
",",
"InputSource",
"test",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"return",
"new",
"Diff",
"(",
"control",
",",
"test",
")",
";",
"}"
] | Compare XML documents provided by two InputSource classes
@param control Control document
@param test Document to test
@return Diff object describing differences in documents
@throws SAXException
@throws IOException | [
"Compare",
"XML",
"documents",
"provided",
"by",
"two",
"InputSource",
"classes"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java#L567-L570 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java | XMLUnit.compareXML | public static Diff compareXML(String control, String test)
throws SAXException, IOException {
return new Diff(control, test);
} | java | public static Diff compareXML(String control, String test)
throws SAXException, IOException {
return new Diff(control, test);
} | [
"public",
"static",
"Diff",
"compareXML",
"(",
"String",
"control",
",",
"String",
"test",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"return",
"new",
"Diff",
"(",
"control",
",",
"test",
")",
";",
"}"
] | Compare two XML documents provided as strings
@param control Control document
@param test Document to test
@return Diff object describing differences in documents
@throws SAXException
@throws IOException | [
"Compare",
"two",
"XML",
"documents",
"provided",
"as",
"strings"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java#L619-L622 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java | XMLUnit.newXpathEngine | public static XpathEngine newXpathEngine() {
XpathEngine eng = new org.custommonkey.xmlunit.jaxp13.Jaxp13XpathEngine();
if (namespaceContext != null) {
eng.setNamespaceContext(namespaceContext);
}
return eng;
} | java | public static XpathEngine newXpathEngine() {
XpathEngine eng = new org.custommonkey.xmlunit.jaxp13.Jaxp13XpathEngine();
if (namespaceContext != null) {
eng.setNamespaceContext(namespaceContext);
}
return eng;
} | [
"public",
"static",
"XpathEngine",
"newXpathEngine",
"(",
")",
"{",
"XpathEngine",
"eng",
"=",
"new",
"org",
".",
"custommonkey",
".",
"xmlunit",
".",
"jaxp13",
".",
"Jaxp13XpathEngine",
"(",
")",
";",
"if",
"(",
"namespaceContext",
"!=",
"null",
")",
"{",
... | Obtains an XpathEngine to use in XPath tests. | [
"Obtains",
"an",
"XpathEngine",
"to",
"use",
"in",
"XPath",
"tests",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java#L651-L657 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java | XMLUnit.setIgnoreDiffBetweenTextAndCDATA | public static void setIgnoreDiffBetweenTextAndCDATA(boolean b) {
ignoreDiffBetweenTextAndCDATA = b;
getControlDocumentBuilderFactory().setCoalescing(b);
getTestDocumentBuilderFactory().setCoalescing(b);
} | java | public static void setIgnoreDiffBetweenTextAndCDATA(boolean b) {
ignoreDiffBetweenTextAndCDATA = b;
getControlDocumentBuilderFactory().setCoalescing(b);
getTestDocumentBuilderFactory().setCoalescing(b);
} | [
"public",
"static",
"void",
"setIgnoreDiffBetweenTextAndCDATA",
"(",
"boolean",
"b",
")",
"{",
"ignoreDiffBetweenTextAndCDATA",
"=",
"b",
";",
"getControlDocumentBuilderFactory",
"(",
")",
".",
"setCoalescing",
"(",
"b",
")",
";",
"getTestDocumentBuilderFactory",
"(",
... | Whether CDATA sections and Text nodes should be considered the same.
<p>The default is false.</p>
<p>This also set the DocumentBuilderFactory's {@link
javax.xml.parsers.DocumentBuilderFactory#setCoalescing
coalescing} flag on the factories for the control and test
document.</p> | [
"Whether",
"CDATA",
"sections",
"and",
"Text",
"nodes",
"should",
"be",
"considered",
"the",
"same",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java#L669-L673 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java | XMLUnit.setXSLTVersion | public static void setXSLTVersion(String s) {
try {
Number n = NumberFormat.getInstance(Locale.US).parse(s);
if (n.doubleValue() < 0) {
throw new ConfigurationException(s + " doesn't reperesent a"
+ " positive number.");
... | java | public static void setXSLTVersion(String s) {
try {
Number n = NumberFormat.getInstance(Locale.US).parse(s);
if (n.doubleValue() < 0) {
throw new ConfigurationException(s + " doesn't reperesent a"
+ " positive number.");
... | [
"public",
"static",
"void",
"setXSLTVersion",
"(",
"String",
"s",
")",
"{",
"try",
"{",
"Number",
"n",
"=",
"NumberFormat",
".",
"getInstance",
"(",
"Locale",
".",
"US",
")",
".",
"parse",
"(",
"s",
")",
";",
"if",
"(",
"n",
".",
"doubleValue",
"(",
... | Sets the XSLT version to set on stylesheets used internally.
<p>Defaults to "1.0".</p>
@throws ConfigurationException if the argument cannot be parsed
as a positive number. | [
"Sets",
"the",
"XSLT",
"version",
"to",
"set",
"on",
"stylesheets",
"used",
"internally",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java#L802-L813 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java | XMLUnit.setExpandEntityReferences | public static void setExpandEntityReferences(boolean b) {
expandEntities = b;
getControlDocumentBuilderFactory().setExpandEntityReferences(b);
getTestDocumentBuilderFactory().setExpandEntityReferences(b);
} | java | public static void setExpandEntityReferences(boolean b) {
expandEntities = b;
getControlDocumentBuilderFactory().setExpandEntityReferences(b);
getTestDocumentBuilderFactory().setExpandEntityReferences(b);
} | [
"public",
"static",
"void",
"setExpandEntityReferences",
"(",
"boolean",
"b",
")",
"{",
"expandEntities",
"=",
"b",
";",
"getControlDocumentBuilderFactory",
"(",
")",
".",
"setExpandEntityReferences",
"(",
"b",
")",
";",
"getTestDocumentBuilderFactory",
"(",
")",
".... | Whether the parser shall be instructed to expand entity references.
<p>Defaults to false.</p>
@see javax.xml.parsers.DocumentBuilderFactory#setExpandEntityReferences | [
"Whether",
"the",
"parser",
"shall",
"be",
"instructed",
"to",
"expand",
"entity",
"references",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLUnit.java#L853-L857 | train |
xmlunit/xmlunit | xmlunit-assertj/src/main/java/org/xmlunit/assertj/ValidationAssert.java | ValidationAssert.isValid | public ValidationAssert isValid() {
ValidationResult validationResult = validate();
if (!validationResult.isValid()) {
throwAssertionError(shouldBeValid(actual.getSystemId(), validationResult.getProblems()));
}
return this;
} | java | public ValidationAssert isValid() {
ValidationResult validationResult = validate();
if (!validationResult.isValid()) {
throwAssertionError(shouldBeValid(actual.getSystemId(), validationResult.getProblems()));
}
return this;
} | [
"public",
"ValidationAssert",
"isValid",
"(",
")",
"{",
"ValidationResult",
"validationResult",
"=",
"validate",
"(",
")",
";",
"if",
"(",
"!",
"validationResult",
".",
"isValid",
"(",
")",
")",
"{",
"throwAssertionError",
"(",
"shouldBeValid",
"(",
"actual",
... | Verifies that actual value is valid against given schema
@throws AssertionError if the actual value is not valid against schema | [
"Verifies",
"that",
"actual",
"value",
"is",
"valid",
"against",
"given",
"schema"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-assertj/src/main/java/org/xmlunit/assertj/ValidationAssert.java#L106-L112 | train |
xmlunit/xmlunit | xmlunit-assertj/src/main/java/org/xmlunit/assertj/ValidationAssert.java | ValidationAssert.isInvalid | public void isInvalid() {
ValidationResult validateResult = validate();
if (validateResult.isValid()) {
throwAssertionError(shouldBeInvalid(actual.getSystemId()));
}
} | java | public void isInvalid() {
ValidationResult validateResult = validate();
if (validateResult.isValid()) {
throwAssertionError(shouldBeInvalid(actual.getSystemId()));
}
} | [
"public",
"void",
"isInvalid",
"(",
")",
"{",
"ValidationResult",
"validateResult",
"=",
"validate",
"(",
")",
";",
"if",
"(",
"validateResult",
".",
"isValid",
"(",
")",
")",
"{",
"throwAssertionError",
"(",
"shouldBeInvalid",
"(",
"actual",
".",
"getSystemId... | Verifies that actual value is not valid against given schema
@throws AssertionError if the actual value is valid against schema | [
"Verifies",
"that",
"actual",
"value",
"is",
"not",
"valid",
"against",
"given",
"schema"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-assertj/src/main/java/org/xmlunit/assertj/ValidationAssert.java#L119-L124 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/ElementNameQualifier.java | ElementNameQualifier.equalsNamespace | protected boolean equalsNamespace(Node control, Node test) {
String controlNS = control.getNamespaceURI();
String testNS = test.getNamespaceURI();
if (controlNS == null) {
return testNS == null;
}
return controlNS.equals(testNS);
} | java | protected boolean equalsNamespace(Node control, Node test) {
String controlNS = control.getNamespaceURI();
String testNS = test.getNamespaceURI();
if (controlNS == null) {
return testNS == null;
}
return controlNS.equals(testNS);
} | [
"protected",
"boolean",
"equalsNamespace",
"(",
"Node",
"control",
",",
"Node",
"test",
")",
"{",
"String",
"controlNS",
"=",
"control",
".",
"getNamespaceURI",
"(",
")",
";",
"String",
"testNS",
"=",
"test",
".",
"getNamespaceURI",
"(",
")",
";",
"if",
"(... | Determine whether two nodes are defined by the same namespace URI
@param control
@param test
@return true if the two nodes are both defined by the same namespace URI
(including the default - empty - namespace), false otherwise | [
"Determine",
"whether",
"two",
"nodes",
"are",
"defined",
"by",
"the",
"same",
"namespace",
"URI"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/ElementNameQualifier.java#L70-L77 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/ElementNameQualifier.java | ElementNameQualifier.getNonNamespacedNodeName | protected String getNonNamespacedNodeName(Node node) {
String name = node.getLocalName();
if (name == null) {
return node.getNodeName();
}
return name;
} | java | protected String getNonNamespacedNodeName(Node node) {
String name = node.getLocalName();
if (name == null) {
return node.getNodeName();
}
return name;
} | [
"protected",
"String",
"getNonNamespacedNodeName",
"(",
"Node",
"node",
")",
"{",
"String",
"name",
"=",
"node",
".",
"getLocalName",
"(",
")",
";",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"return",
"node",
".",
"getNodeName",
"(",
")",
";",
"}",
"r... | Strip any namespace information off a node name
@param node
@return the localName if the node is namespaced, or the name otherwise | [
"Strip",
"any",
"namespace",
"information",
"off",
"a",
"node",
"name"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/ElementNameQualifier.java#L84-L90 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/DoctypeSupport.java | DoctypeSupport.read | int read() throws IOException {
int nextInt = -1;
if (!hasSplit) {
split();
}
if (beforeDoctype != null) {
nextInt = beforeDoctype.read();
if (nextInt == -1) {
beforeDoctype = null;
}
}
if (nextInt == -1 && d... | java | int read() throws IOException {
int nextInt = -1;
if (!hasSplit) {
split();
}
if (beforeDoctype != null) {
nextInt = beforeDoctype.read();
if (nextInt == -1) {
beforeDoctype = null;
}
}
if (nextInt == -1 && d... | [
"int",
"read",
"(",
")",
"throws",
"IOException",
"{",
"int",
"nextInt",
"=",
"-",
"1",
";",
"if",
"(",
"!",
"hasSplit",
")",
"{",
"split",
"(",
")",
";",
"}",
"if",
"(",
"beforeDoctype",
"!=",
"null",
")",
"{",
"nextInt",
"=",
"beforeDoctype",
"."... | Reads the next character from the declaration.
@return -1 if the end of the declaration has been reached. | [
"Reads",
"the",
"next",
"character",
"from",
"the",
"declaration",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/DoctypeSupport.java#L108-L135 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/DoctypeSupport.java | DoctypeSupport.split | private void split() throws IOException {
hasSplit = true;
IntegerBuffer before = new IntegerBuffer();
IntegerBuffer after = new IntegerBuffer();
int current;
boolean ready = false;
boolean stillNeedToSeeDoctype = true;
while (!ready && (current = original.read()... | java | private void split() throws IOException {
hasSplit = true;
IntegerBuffer before = new IntegerBuffer();
IntegerBuffer after = new IntegerBuffer();
int current;
boolean ready = false;
boolean stillNeedToSeeDoctype = true;
while (!ready && (current = original.read()... | [
"private",
"void",
"split",
"(",
")",
"throws",
"IOException",
"{",
"hasSplit",
"=",
"true",
";",
"IntegerBuffer",
"before",
"=",
"new",
"IntegerBuffer",
"(",
")",
";",
"IntegerBuffer",
"after",
"=",
"new",
"IntegerBuffer",
"(",
")",
";",
"int",
"current",
... | Reads enough of the original Readable to know where to place
the declaration. Fills beforeDecl and afterDecl from the data
read ahead. Swallows the original DOCTYPE if there is one. | [
"Reads",
"enough",
"of",
"the",
"original",
"Readable",
"to",
"know",
"where",
"to",
"place",
"the",
"declaration",
".",
"Fills",
"beforeDecl",
"and",
"afterDecl",
"from",
"the",
"data",
"read",
"ahead",
".",
"Swallows",
"the",
"original",
"DOCTYPE",
"if",
"... | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/DoctypeSupport.java#L142-L237 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XpathNodeTracker.java | XpathNodeTracker.visited | public void visited(Node node) {
switch(node.getNodeType()) {
case Node.ATTRIBUTE_NODE:
visitedAttribute(getNodeName(node));
break;
case Node.ELEMENT_NODE:
visitedNode(node, getNodeName(node));
break;
case Node.COMMENT_NODE:
vis... | java | public void visited(Node node) {
switch(node.getNodeType()) {
case Node.ATTRIBUTE_NODE:
visitedAttribute(getNodeName(node));
break;
case Node.ELEMENT_NODE:
visitedNode(node, getNodeName(node));
break;
case Node.COMMENT_NODE:
vis... | [
"public",
"void",
"visited",
"(",
"Node",
"node",
")",
"{",
"switch",
"(",
"node",
".",
"getNodeType",
"(",
")",
")",
"{",
"case",
"Node",
".",
"ATTRIBUTE_NODE",
":",
"visitedAttribute",
"(",
"getNodeName",
"(",
"node",
")",
")",
";",
"break",
";",
"ca... | Call when visiting a node whose xpath location needs tracking
<p>Delegates to {@link #visitedAttribute visitedAttribute} for
attribute nodes, {@link #visitedNode visitedNode} for elements,
texts, CDATA sections, comments or processing instructions and
ignores any other type of node.</p>
@param node the Node being vis... | [
"Call",
"when",
"visiting",
"a",
"node",
"whose",
"xpath",
"location",
"needs",
"tracking"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XpathNodeTracker.java#L153-L175 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XpathNodeTracker.java | XpathNodeTracker.preloadChildList | public void preloadChildList(List nodeList) {
Iterable<Node> nodes = Linqy.cast(nodeList);
preloadChildren(nodes);
} | java | public void preloadChildList(List nodeList) {
Iterable<Node> nodes = Linqy.cast(nodeList);
preloadChildren(nodes);
} | [
"public",
"void",
"preloadChildList",
"(",
"List",
"nodeList",
")",
"{",
"Iterable",
"<",
"Node",
">",
"nodes",
"=",
"Linqy",
".",
"cast",
"(",
"nodeList",
")",
";",
"preloadChildren",
"(",
"nodes",
")",
";",
"}"
] | Preload the items in a List by visiting each in turn
Required for pieces of test XML whose node children can be visited
out of sequence by a DifferenceEngine comparison
<p>Makes the nodes of this list known as nodes that are
visitable at the current level and makes the last child node
the current node as a side effect... | [
"Preload",
"the",
"items",
"in",
"a",
"List",
"by",
"visiting",
"each",
"in",
"turn",
"Required",
"for",
"pieces",
"of",
"test",
"XML",
"whose",
"node",
"children",
"can",
"be",
"visited",
"out",
"of",
"sequence",
"by",
"a",
"DifferenceEngine",
"comparison"
... | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XpathNodeTracker.java#L227-L230 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XpathNodeTracker.java | XpathNodeTracker.getNodeName | private static String getNodeName(Node n) {
String nodeName = n.getLocalName();
if (nodeName == null || nodeName.length() == 0) {
nodeName = n.getNodeName();
}
return nodeName;
} | java | private static String getNodeName(Node n) {
String nodeName = n.getLocalName();
if (nodeName == null || nodeName.length() == 0) {
nodeName = n.getNodeName();
}
return nodeName;
} | [
"private",
"static",
"String",
"getNodeName",
"(",
"Node",
"n",
")",
"{",
"String",
"nodeName",
"=",
"n",
".",
"getLocalName",
"(",
")",
";",
"if",
"(",
"nodeName",
"==",
"null",
"||",
"nodeName",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"nodeNa... | extracts the local name of a node. | [
"extracts",
"the",
"local",
"name",
"of",
"a",
"node",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XpathNodeTracker.java#L242-L248 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XpathNodeTracker.java | XpathNodeTracker.preloadChildren | private void preloadChildren(Iterable<Node> nodeList) {
levels.getLast().trackNodesAsWellAsValues(true);
for (Node n : nodeList) {
visited(n);
}
levels.getLast().trackNodesAsWellAsValues(false);
} | java | private void preloadChildren(Iterable<Node> nodeList) {
levels.getLast().trackNodesAsWellAsValues(true);
for (Node n : nodeList) {
visited(n);
}
levels.getLast().trackNodesAsWellAsValues(false);
} | [
"private",
"void",
"preloadChildren",
"(",
"Iterable",
"<",
"Node",
">",
"nodeList",
")",
"{",
"levels",
".",
"getLast",
"(",
")",
".",
"trackNodesAsWellAsValues",
"(",
"true",
")",
";",
"for",
"(",
"Node",
"n",
":",
"nodeList",
")",
"{",
"visited",
"(",... | Preload the nodes by visiting each in turn.
Required for pieces of test XML whose node children can be visited
out of sequence by a DifferenceEngine comparison
<p>Makes the nodes of this list known as nodes that are
visitable at the current level and makes the last child node
the current node as a side effect.</p>
@p... | [
"Preload",
"the",
"nodes",
"by",
"visiting",
"each",
"in",
"turn",
".",
"Required",
"for",
"pieces",
"of",
"test",
"XML",
"whose",
"node",
"children",
"can",
"be",
"visited",
"out",
"of",
"sequence",
"by",
"a",
"DifferenceEngine",
"comparison"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XpathNodeTracker.java#L261-L267 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/jaxp13/Validator.java | Validator.addSchemaSource | public void addSchemaSource(Source s) {
sources.add(s);
validator.setSchemaSources(sources.toArray(new Source[0]));
} | java | public void addSchemaSource(Source s) {
sources.add(s);
validator.setSchemaSources(sources.toArray(new Source[0]));
} | [
"public",
"void",
"addSchemaSource",
"(",
"Source",
"s",
")",
"{",
"sources",
".",
"add",
"(",
"s",
")",
";",
"validator",
".",
"setSchemaSources",
"(",
"sources",
".",
"toArray",
"(",
"new",
"Source",
"[",
"0",
"]",
")",
")",
";",
"}"
] | Adds a source for the schema defintion. | [
"Adds",
"a",
"source",
"for",
"the",
"schema",
"defintion",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/jaxp13/Validator.java#L108-L111 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/jaxp13/Validator.java | Validator.getInstanceErrors | public List<SAXParseException> getInstanceErrors(Source instance) {
try {
return problemToExceptionList(validator.validateInstance(instance).
getProblems());
} catch (XMLUnitException e) {
throw new XMLUnitRuntimeException(e.getMessage(),... | java | public List<SAXParseException> getInstanceErrors(Source instance) {
try {
return problemToExceptionList(validator.validateInstance(instance).
getProblems());
} catch (XMLUnitException e) {
throw new XMLUnitRuntimeException(e.getMessage(),... | [
"public",
"List",
"<",
"SAXParseException",
">",
"getInstanceErrors",
"(",
"Source",
"instance",
")",
"{",
"try",
"{",
"return",
"problemToExceptionList",
"(",
"validator",
".",
"validateInstance",
"(",
"instance",
")",
".",
"getProblems",
"(",
")",
")",
";",
... | Obtain a list of all errors in the given instance.
<p>The list contains {@link org.xml.sax.SAXParseException
SAXParseException}s.</p>
@throws XMLUnitRuntimeException if the schema definition is
invalid or the Source is a SAXSource and the underlying
XMLReader throws an IOException (see {@link
javax.xml.validation.Val... | [
"Obtain",
"a",
"list",
"of",
"all",
"errors",
"in",
"the",
"given",
"instance",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/jaxp13/Validator.java#L160-L167 | train |
xmlunit/xmlunit | xmlunit-assertj/src/main/java/org/xmlunit/assertj/XmlAssert.java | XmlAssert.isValidAgainst | public XmlAssert isValidAgainst(Schema schema) {
isNotNull();
ValidationAssert.create(actual, schema).isValid();
return this;
} | java | public XmlAssert isValidAgainst(Schema schema) {
isNotNull();
ValidationAssert.create(actual, schema).isValid();
return this;
} | [
"public",
"XmlAssert",
"isValidAgainst",
"(",
"Schema",
"schema",
")",
"{",
"isNotNull",
"(",
")",
";",
"ValidationAssert",
".",
"create",
"(",
"actual",
",",
"schema",
")",
".",
"isValid",
"(",
")",
";",
"return",
"this",
";",
"}"
] | Check if actual value is valid against given schema
@throws AssertionError if the actual value is {@code null}.
@throws AssertionError if the actual value is invalid | [
"Check",
"if",
"actual",
"value",
"is",
"valid",
"against",
"given",
"schema"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-assertj/src/main/java/org/xmlunit/assertj/XmlAssert.java#L254-L258 | train |
xmlunit/xmlunit | xmlunit-assertj/src/main/java/org/xmlunit/assertj/XmlAssert.java | XmlAssert.isNotValidAgainst | public XmlAssert isNotValidAgainst(Schema schema) {
isNotNull();
ValidationAssert.create(actual, schema).isInvalid();
return this;
} | java | public XmlAssert isNotValidAgainst(Schema schema) {
isNotNull();
ValidationAssert.create(actual, schema).isInvalid();
return this;
} | [
"public",
"XmlAssert",
"isNotValidAgainst",
"(",
"Schema",
"schema",
")",
"{",
"isNotNull",
"(",
")",
";",
"ValidationAssert",
".",
"create",
"(",
"actual",
",",
"schema",
")",
".",
"isInvalid",
"(",
")",
";",
"return",
"this",
";",
"}"
] | Check if actual value is not valid against given schema
@throws AssertionError if the actual value is {@code null}.
@throws AssertionError if the actual value is valid | [
"Check",
"if",
"actual",
"value",
"is",
"not",
"valid",
"against",
"given",
"schema"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-assertj/src/main/java/org/xmlunit/assertj/XmlAssert.java#L266-L270 | train |
xmlunit/xmlunit | xmlunit-assertj/src/main/java/org/xmlunit/assertj/XmlAssert.java | XmlAssert.isValidAgainst | public XmlAssert isValidAgainst(Object... schemaSources) {
isNotNull();
ValidationAssert.create(actual, schemaSources).isValid();
return this;
} | java | public XmlAssert isValidAgainst(Object... schemaSources) {
isNotNull();
ValidationAssert.create(actual, schemaSources).isValid();
return this;
} | [
"public",
"XmlAssert",
"isValidAgainst",
"(",
"Object",
"...",
"schemaSources",
")",
"{",
"isNotNull",
"(",
")",
";",
"ValidationAssert",
".",
"create",
"(",
"actual",
",",
"schemaSources",
")",
".",
"isValid",
"(",
")",
";",
"return",
"this",
";",
"}"
] | Check if actual value is valid against schema provided by given sources
@throws AssertionError if the actual value is {@code null}.
@throws AssertionError if the actual value is invalid | [
"Check",
"if",
"actual",
"value",
"is",
"valid",
"against",
"schema",
"provided",
"by",
"given",
"sources"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-assertj/src/main/java/org/xmlunit/assertj/XmlAssert.java#L278-L282 | train |
xmlunit/xmlunit | xmlunit-assertj/src/main/java/org/xmlunit/assertj/XmlAssert.java | XmlAssert.isNotValidAgainst | public XmlAssert isNotValidAgainst(Object... schemaSources) {
isNotNull();
ValidationAssert.create(actual, schemaSources).isInvalid();
return this;
} | java | public XmlAssert isNotValidAgainst(Object... schemaSources) {
isNotNull();
ValidationAssert.create(actual, schemaSources).isInvalid();
return this;
} | [
"public",
"XmlAssert",
"isNotValidAgainst",
"(",
"Object",
"...",
"schemaSources",
")",
"{",
"isNotNull",
"(",
")",
";",
"ValidationAssert",
".",
"create",
"(",
"actual",
",",
"schemaSources",
")",
".",
"isInvalid",
"(",
")",
";",
"return",
"this",
";",
"}"
... | Check if actual value is not valid against schema provided by given sources
@throws AssertionError if the actual value is {@code null}.
@throws AssertionError if the actual value is valid | [
"Check",
"if",
"actual",
"value",
"is",
"not",
"valid",
"against",
"schema",
"provided",
"by",
"given",
"sources"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-assertj/src/main/java/org/xmlunit/assertj/XmlAssert.java#L290-L294 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/diff/XPathContext.java | XPathContext.navigateToAttribute | public void navigateToAttribute(QName attribute) {
path.addLast(path.getLast().attributes.get(attribute));
} | java | public void navigateToAttribute(QName attribute) {
path.addLast(path.getLast().attributes.get(attribute));
} | [
"public",
"void",
"navigateToAttribute",
"(",
"QName",
"attribute",
")",
"{",
"path",
".",
"addLast",
"(",
"path",
".",
"getLast",
"(",
")",
".",
"attributes",
".",
"get",
"(",
"attribute",
")",
")",
";",
"}"
] | Moves from the current node to the given attribute. | [
"Moves",
"from",
"the",
"current",
"node",
"to",
"the",
"given",
"attribute",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/XPathContext.java#L100-L102 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/diff/XPathContext.java | XPathContext.addAttributes | public void addAttributes(Iterable<? extends QName> attributes) {
Level current = path.getLast();
for (QName attribute : attributes) {
current.attributes.put(attribute,
new Level(ATTR + getName(attribute)));
}
} | java | public void addAttributes(Iterable<? extends QName> attributes) {
Level current = path.getLast();
for (QName attribute : attributes) {
current.attributes.put(attribute,
new Level(ATTR + getName(attribute)));
}
} | [
"public",
"void",
"addAttributes",
"(",
"Iterable",
"<",
"?",
"extends",
"QName",
">",
"attributes",
")",
"{",
"Level",
"current",
"=",
"path",
".",
"getLast",
"(",
")",
";",
"for",
"(",
"QName",
"attribute",
":",
"attributes",
")",
"{",
"current",
".",
... | Adds knowledge about the current node's attributes. | [
"Adds",
"knowledge",
"about",
"the",
"current",
"node",
"s",
"attributes",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/XPathContext.java#L114-L120 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/diff/XPathContext.java | XPathContext.addAttribute | public void addAttribute(QName attribute) {
Level current = path.getLast();
current.attributes.put(attribute,
new Level(ATTR + getName(attribute)));
} | java | public void addAttribute(QName attribute) {
Level current = path.getLast();
current.attributes.put(attribute,
new Level(ATTR + getName(attribute)));
} | [
"public",
"void",
"addAttribute",
"(",
"QName",
"attribute",
")",
"{",
"Level",
"current",
"=",
"path",
".",
"getLast",
"(",
")",
";",
"current",
".",
"attributes",
".",
"put",
"(",
"attribute",
",",
"new",
"Level",
"(",
"ATTR",
"+",
"getName",
"(",
"a... | Adds knowledge about a single attribute of the current node. | [
"Adds",
"knowledge",
"about",
"a",
"single",
"attribute",
"of",
"the",
"current",
"node",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/XPathContext.java#L125-L129 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/diff/XPathContext.java | XPathContext.setChildren | public void setChildren(Iterable<? extends NodeInfo> children) {
Level current = path.getLast();
current.children.clear();
appendChildren(children);
} | java | public void setChildren(Iterable<? extends NodeInfo> children) {
Level current = path.getLast();
current.children.clear();
appendChildren(children);
} | [
"public",
"void",
"setChildren",
"(",
"Iterable",
"<",
"?",
"extends",
"NodeInfo",
">",
"children",
")",
"{",
"Level",
"current",
"=",
"path",
".",
"getLast",
"(",
")",
";",
"current",
".",
"children",
".",
"clear",
"(",
")",
";",
"appendChildren",
"(",
... | Adds knowledge about the current node's children replacing
existing knowledge. | [
"Adds",
"knowledge",
"about",
"the",
"current",
"node",
"s",
"children",
"replacing",
"existing",
"knowledge",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/XPathContext.java#L135-L139 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/diff/XPathContext.java | XPathContext.appendChildren | public void appendChildren(Iterable<? extends NodeInfo> children) {
Level current = path.getLast();
int comments, pis, texts;
comments = pis = texts = 0;
Map<String, Integer> elements = new HashMap<String, Integer>();
for (Level l : current.children) {
String childNa... | java | public void appendChildren(Iterable<? extends NodeInfo> children) {
Level current = path.getLast();
int comments, pis, texts;
comments = pis = texts = 0;
Map<String, Integer> elements = new HashMap<String, Integer>();
for (Level l : current.children) {
String childNa... | [
"public",
"void",
"appendChildren",
"(",
"Iterable",
"<",
"?",
"extends",
"NodeInfo",
">",
"children",
")",
"{",
"Level",
"current",
"=",
"path",
".",
"getLast",
"(",
")",
";",
"int",
"comments",
",",
"pis",
",",
"texts",
";",
"comments",
"=",
"pis",
"... | Adds knowledge about the current node's children appending to
the knowledge already present. | [
"Adds",
"knowledge",
"about",
"the",
"current",
"node",
"s",
"children",
"appending",
"to",
"the",
"knowledge",
"already",
"present",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/XPathContext.java#L145-L191 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/diff/XPathContext.java | XPathContext.getParentXPath | public String getParentXPath() {
Iterator<Level> levelIterator = path.descendingIterator();
if (levelIterator.hasNext()) {
levelIterator.next();
}
return getXPath(levelIterator);
} | java | public String getParentXPath() {
Iterator<Level> levelIterator = path.descendingIterator();
if (levelIterator.hasNext()) {
levelIterator.next();
}
return getXPath(levelIterator);
} | [
"public",
"String",
"getParentXPath",
"(",
")",
"{",
"Iterator",
"<",
"Level",
">",
"levelIterator",
"=",
"path",
".",
"descendingIterator",
"(",
")",
";",
"if",
"(",
"levelIterator",
".",
"hasNext",
"(",
")",
")",
"{",
"levelIterator",
".",
"next",
"(",
... | Stringifies the XPath of the current node's parent. | [
"Stringifies",
"the",
"XPath",
"of",
"the",
"current",
"node",
"s",
"parent",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/XPathContext.java#L203-L209 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/diff/XPathContext.java | XPathContext.add1OrIncrement | private static int add1OrIncrement(String name, Map<String, Integer> map) {
Integer old = map.get(name);
int index = old == null ? 1 : old.intValue() + 1;
map.put(name, Integer.valueOf(index));
return index;
} | java | private static int add1OrIncrement(String name, Map<String, Integer> map) {
Integer old = map.get(name);
int index = old == null ? 1 : old.intValue() + 1;
map.put(name, Integer.valueOf(index));
return index;
} | [
"private",
"static",
"int",
"add1OrIncrement",
"(",
"String",
"name",
",",
"Map",
"<",
"String",
",",
"Integer",
">",
"map",
")",
"{",
"Integer",
"old",
"=",
"map",
".",
"get",
"(",
"name",
")",
";",
"int",
"index",
"=",
"old",
"==",
"null",
"?",
"... | Increments the value name maps to or adds 1 as value if name
isn't present inside the map.
@return the new mapping for name | [
"Increments",
"the",
"value",
"name",
"maps",
"to",
"or",
"adds",
"1",
"as",
"value",
"if",
"name",
"isn",
"t",
"present",
"inside",
"the",
"map",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/XPathContext.java#L260-L265 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/diff/DefaultComparisonFormatter.java | DefaultComparisonFormatter.getDescription | @Override
public String getDescription(Comparison difference) {
final ComparisonType type = difference.getType();
String description = type.getDescription();
final Detail controlDetails = difference.getControlDetails();
final Detail testDetails = difference.getTestDetails();
... | java | @Override
public String getDescription(Comparison difference) {
final ComparisonType type = difference.getType();
String description = type.getDescription();
final Detail controlDetails = difference.getControlDetails();
final Detail testDetails = difference.getTestDetails();
... | [
"@",
"Override",
"public",
"String",
"getDescription",
"(",
"Comparison",
"difference",
")",
"{",
"final",
"ComparisonType",
"type",
"=",
"difference",
".",
"getType",
"(",
")",
";",
"String",
"description",
"=",
"type",
".",
"getDescription",
"(",
")",
";",
... | Return a short String of the Comparison including the XPath and the shorten value of the effected control and
test Node.
<p>In general the String will look like "Expected X 'Y' but was 'Z' - comparing A to B" where A and B are the
result of invoking {@link #getShortString} on the target and XPath of the control and te... | [
"Return",
"a",
"short",
"String",
"of",
"the",
"Comparison",
"including",
"the",
"XPath",
"and",
"the",
"shorten",
"value",
"of",
"the",
"effected",
"control",
"and",
"test",
"Node",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/DefaultComparisonFormatter.java#L59-L82 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/diff/DefaultComparisonFormatter.java | DefaultComparisonFormatter.getFullFormattedXml | protected String getFullFormattedXml(final Node node, ComparisonType type, boolean formatXml) {
StringBuilder sb = new StringBuilder();
final Node nodeToConvert;
if (type == ComparisonType.CHILD_NODELIST_SEQUENCE) {
nodeToConvert = node.getParentNode();
} else if (node instan... | java | protected String getFullFormattedXml(final Node node, ComparisonType type, boolean formatXml) {
StringBuilder sb = new StringBuilder();
final Node nodeToConvert;
if (type == ComparisonType.CHILD_NODELIST_SEQUENCE) {
nodeToConvert = node.getParentNode();
} else if (node instan... | [
"protected",
"String",
"getFullFormattedXml",
"(",
"final",
"Node",
"node",
",",
"ComparisonType",
"type",
",",
"boolean",
"formatXml",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"final",
"Node",
"nodeToConvert",
";",
"if",
"(... | Formats the node using a format suitable for the node type and comparison.
<p>The implementation outputs the document prolog and start element for {@code Document} and {@code DocumentType}
nodes and may elect to format the node's parent element rather than just the node depending on the node and
comparison type. It de... | [
"Formats",
"the",
"node",
"using",
"a",
"format",
"suitable",
"for",
"the",
"node",
"type",
"and",
"comparison",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/DefaultComparisonFormatter.java#L359-L382 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/diff/DefaultComparisonFormatter.java | DefaultComparisonFormatter.getFormattedNodeXml | protected String getFormattedNodeXml(final Node nodeToConvert, boolean formatXml) {
String formattedNodeXml;
try {
final int numberOfBlanksToIndent = formatXml ? 2 : -1;
final Transformer transformer = createXmlTransformer(numberOfBlanksToIndent);
final StringWriter b... | java | protected String getFormattedNodeXml(final Node nodeToConvert, boolean formatXml) {
String formattedNodeXml;
try {
final int numberOfBlanksToIndent = formatXml ? 2 : -1;
final Transformer transformer = createXmlTransformer(numberOfBlanksToIndent);
final StringWriter b... | [
"protected",
"String",
"getFormattedNodeXml",
"(",
"final",
"Node",
"nodeToConvert",
",",
"boolean",
"formatXml",
")",
"{",
"String",
"formattedNodeXml",
";",
"try",
"{",
"final",
"int",
"numberOfBlanksToIndent",
"=",
"formatXml",
"?",
"2",
":",
"-",
"1",
";",
... | Formats a node with the help of an identity XML transformation.
@param nodeToConvert the node to format
@param formatXml true if the Comparison was generated with {@link
org.xmlunit.builder.DiffBuilder#ignoreWhitespace()} - this affects the indentation of the generated output
@return the fomatted XML
@since XMLUnit 2... | [
"Formats",
"a",
"node",
"with",
"the",
"help",
"of",
"an",
"identity",
"XML",
"transformation",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/DefaultComparisonFormatter.java#L433-L445 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/diff/DefaultComparisonFormatter.java | DefaultComparisonFormatter.createXmlTransformer | protected Transformer createXmlTransformer(int numberOfBlanksToIndent) throws TransformerConfigurationException {
TransformerFactoryConfigurer.Builder b = TransformerFactoryConfigurer.builder()
.withExternalStylesheetLoadingDisabled()
.withDTDLoadingDisabled();
if (numberOfBlank... | java | protected Transformer createXmlTransformer(int numberOfBlanksToIndent) throws TransformerConfigurationException {
TransformerFactoryConfigurer.Builder b = TransformerFactoryConfigurer.builder()
.withExternalStylesheetLoadingDisabled()
.withDTDLoadingDisabled();
if (numberOfBlank... | [
"protected",
"Transformer",
"createXmlTransformer",
"(",
"int",
"numberOfBlanksToIndent",
")",
"throws",
"TransformerConfigurationException",
"{",
"TransformerFactoryConfigurer",
".",
"Builder",
"b",
"=",
"TransformerFactoryConfigurer",
".",
"builder",
"(",
")",
".",
"withE... | Create a default Transformer to format a XML-Node to a String.
@param numberOfBlanksToIndent the number of spaces which is used for indent the XML-structure
@return the transformer
@since XMLUnit 2.4.0 | [
"Create",
"a",
"default",
"Transformer",
"to",
"format",
"a",
"XML",
"-",
"Node",
"to",
"a",
"String",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/DefaultComparisonFormatter.java#L455-L480 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/diff/ComparisonListenerSupport.java | ComparisonListenerSupport.fireComparisonPerformed | public void fireComparisonPerformed(Comparison comparison,
ComparisonResult outcome) {
fire(comparison, outcome, compListeners);
if (outcome == ComparisonResult.EQUAL) {
fire(comparison, outcome, matchListeners);
} else {
fire(compa... | java | public void fireComparisonPerformed(Comparison comparison,
ComparisonResult outcome) {
fire(comparison, outcome, compListeners);
if (outcome == ComparisonResult.EQUAL) {
fire(comparison, outcome, matchListeners);
} else {
fire(compa... | [
"public",
"void",
"fireComparisonPerformed",
"(",
"Comparison",
"comparison",
",",
"ComparisonResult",
"outcome",
")",
"{",
"fire",
"(",
"comparison",
",",
"outcome",
",",
"compListeners",
")",
";",
"if",
"(",
"outcome",
"==",
"ComparisonResult",
".",
"EQUAL",
"... | Propagates the result of a comparision to all registered
listeners. | [
"Propagates",
"the",
"result",
"of",
"a",
"comparision",
"to",
"all",
"registered",
"listeners",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/ComparisonListenerSupport.java#L58-L66 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/util/IntegerBuffer.java | IntegerBuffer.append | public void append(int[] i) {
// could simply delegate to the other append methods, but this
// (avoiding repeated comparisions) is more efficient.
while (currentSize + i.length > buffer.length) {
grow();
}
System.arraycopy(i, 0, buffer, currentSize, i.length);
... | java | public void append(int[] i) {
// could simply delegate to the other append methods, but this
// (avoiding repeated comparisions) is more efficient.
while (currentSize + i.length > buffer.length) {
grow();
}
System.arraycopy(i, 0, buffer, currentSize, i.length);
... | [
"public",
"void",
"append",
"(",
"int",
"[",
"]",
"i",
")",
"{",
"// could simply delegate to the other append methods, but this",
"// (avoiding repeated comparisions) is more efficient.",
"while",
"(",
"currentSize",
"+",
"i",
".",
"length",
">",
"buffer",
".",
"length",... | Appends an array of ints. | [
"Appends",
"an",
"array",
"of",
"ints",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/util/IntegerBuffer.java#L98-L106 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/util/IntegerBuffer.java | IntegerBuffer.indexOf | public int indexOf(int[] sequence) {
int index = -1;
for (int i = 0; index == -1 && i <= currentSize - sequence.length;
i++) {
if (buffer[i] == sequence[0]) {
boolean matches = true;
for (int j = 1; matches && j < sequence.length; j++) {
... | java | public int indexOf(int[] sequence) {
int index = -1;
for (int i = 0; index == -1 && i <= currentSize - sequence.length;
i++) {
if (buffer[i] == sequence[0]) {
boolean matches = true;
for (int j = 1; matches && j < sequence.length; j++) {
... | [
"public",
"int",
"indexOf",
"(",
"int",
"[",
"]",
"sequence",
")",
"{",
"int",
"index",
"=",
"-",
"1",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"index",
"==",
"-",
"1",
"&&",
"i",
"<=",
"currentSize",
"-",
"sequence",
".",
"length",
";",
"i"... | finds sequence in current buffer.
@return index of sequence or -1 if not found | [
"finds",
"sequence",
"in",
"current",
"buffer",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/util/IntegerBuffer.java#L122-L139 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/util/Linqy.java | Linqy.asList | public static <E> List<E> asList(Iterable<E> i) {
if (i instanceof Collection) {
return new ArrayList<E>((Collection<E>) i);
}
ArrayList<E> a = new ArrayList<E>();
for (E e : i) {
a.add(e);
}
return a;
} | java | public static <E> List<E> asList(Iterable<E> i) {
if (i instanceof Collection) {
return new ArrayList<E>((Collection<E>) i);
}
ArrayList<E> a = new ArrayList<E>();
for (E e : i) {
a.add(e);
}
return a;
} | [
"public",
"static",
"<",
"E",
">",
"List",
"<",
"E",
">",
"asList",
"(",
"Iterable",
"<",
"E",
">",
"i",
")",
"{",
"if",
"(",
"i",
"instanceof",
"Collection",
")",
"{",
"return",
"new",
"ArrayList",
"<",
"E",
">",
"(",
"(",
"Collection",
"<",
"E"... | Turns the iterable into a list. | [
"Turns",
"the",
"iterable",
"into",
"a",
"list",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/util/Linqy.java#L32-L41 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/util/Linqy.java | Linqy.cast | public static <E> Iterable<E> cast(final Iterable i) {
return map(i, new Mapper<Object, E>() {
public E apply(Object o) {
return (E) o;
}
});
} | java | public static <E> Iterable<E> cast(final Iterable i) {
return map(i, new Mapper<Object, E>() {
public E apply(Object o) {
return (E) o;
}
});
} | [
"public",
"static",
"<",
"E",
">",
"Iterable",
"<",
"E",
">",
"cast",
"(",
"final",
"Iterable",
"i",
")",
"{",
"return",
"map",
"(",
"i",
",",
"new",
"Mapper",
"<",
"Object",
",",
"E",
">",
"(",
")",
"{",
"public",
"E",
"apply",
"(",
"Object",
... | Turns an iterable into its type-safe cousin. | [
"Turns",
"an",
"iterable",
"into",
"its",
"type",
"-",
"safe",
"cousin",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/util/Linqy.java#L46-L52 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/util/Linqy.java | Linqy.singleton | public static <E> Iterable<E> singleton(final E single) {
return new Iterable<E>() {
@Override
public Iterator<E> iterator() {
return new OnceOnlyIterator<E>(single);
}
};
} | java | public static <E> Iterable<E> singleton(final E single) {
return new Iterable<E>() {
@Override
public Iterator<E> iterator() {
return new OnceOnlyIterator<E>(single);
}
};
} | [
"public",
"static",
"<",
"E",
">",
"Iterable",
"<",
"E",
">",
"singleton",
"(",
"final",
"E",
"single",
")",
"{",
"return",
"new",
"Iterable",
"<",
"E",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Iterator",
"<",
"E",
">",
"iterator",
"(",
")",... | An iterable containing a single element. | [
"An",
"iterable",
"containing",
"a",
"single",
"element",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/util/Linqy.java#L57-L64 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/util/Linqy.java | Linqy.map | public static <F, T> Iterable<T> map(final Iterable<F> from,
final Mapper<? super F, T> mapper) {
return new Iterable<T>() {
@Override
public Iterator<T> iterator() {
return new MappingIterator<F, T>(from.iterator(), mapper);
... | java | public static <F, T> Iterable<T> map(final Iterable<F> from,
final Mapper<? super F, T> mapper) {
return new Iterable<T>() {
@Override
public Iterator<T> iterator() {
return new MappingIterator<F, T>(from.iterator(), mapper);
... | [
"public",
"static",
"<",
"F",
",",
"T",
">",
"Iterable",
"<",
"T",
">",
"map",
"(",
"final",
"Iterable",
"<",
"F",
">",
"from",
",",
"final",
"Mapper",
"<",
"?",
"super",
"F",
",",
"T",
">",
"mapper",
")",
"{",
"return",
"new",
"Iterable",
"<",
... | Create a new iterable by applying a mapper function to each
element of a given sequence. | [
"Create",
"a",
"new",
"iterable",
"by",
"applying",
"a",
"mapper",
"function",
"to",
"each",
"element",
"of",
"a",
"given",
"sequence",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/util/Linqy.java#L70-L78 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/util/Linqy.java | Linqy.filter | public static <T> Iterable<T> filter(final Iterable<T> sequence,
final Predicate<? super T> filter) {
return new Iterable<T>() {
@Override
public Iterator<T> iterator() {
return new FilteringIterator<T>(sequence.iterator(), filter)... | java | public static <T> Iterable<T> filter(final Iterable<T> sequence,
final Predicate<? super T> filter) {
return new Iterable<T>() {
@Override
public Iterator<T> iterator() {
return new FilteringIterator<T>(sequence.iterator(), filter)... | [
"public",
"static",
"<",
"T",
">",
"Iterable",
"<",
"T",
">",
"filter",
"(",
"final",
"Iterable",
"<",
"T",
">",
"sequence",
",",
"final",
"Predicate",
"<",
"?",
"super",
"T",
">",
"filter",
")",
"{",
"return",
"new",
"Iterable",
"<",
"T",
">",
"("... | Exclude all elements from an iterable that don't match a given
predicate. | [
"Exclude",
"all",
"elements",
"from",
"an",
"iterable",
"that",
"don",
"t",
"match",
"a",
"given",
"predicate",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/util/Linqy.java#L84-L92 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/util/Linqy.java | Linqy.count | public static int count(Iterable seq) {
if (seq instanceof Collection) {
return ((Collection) seq).size();
}
int c = 0;
Iterator it = seq.iterator();
while (it.hasNext()) {
c++;
it.next();
}
return c;
} | java | public static int count(Iterable seq) {
if (seq instanceof Collection) {
return ((Collection) seq).size();
}
int c = 0;
Iterator it = seq.iterator();
while (it.hasNext()) {
c++;
it.next();
}
return c;
} | [
"public",
"static",
"int",
"count",
"(",
"Iterable",
"seq",
")",
"{",
"if",
"(",
"seq",
"instanceof",
"Collection",
")",
"{",
"return",
"(",
"(",
"Collection",
")",
"seq",
")",
".",
"size",
"(",
")",
";",
"}",
"int",
"c",
"=",
"0",
";",
"Iterator",... | Count the number of elements in a sequence. | [
"Count",
"the",
"number",
"of",
"elements",
"in",
"a",
"sequence",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/util/Linqy.java#L97-L108 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/util/Linqy.java | Linqy.any | public static <T> boolean any(final Iterable<T> sequence,
final Predicate<? super T> predicate) {
for (T t : sequence) {
if (predicate.test(t)) {
return true;
}
}
return false;
} | java | public static <T> boolean any(final Iterable<T> sequence,
final Predicate<? super T> predicate) {
for (T t : sequence) {
if (predicate.test(t)) {
return true;
}
}
return false;
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"any",
"(",
"final",
"Iterable",
"<",
"T",
">",
"sequence",
",",
"final",
"Predicate",
"<",
"?",
"super",
"T",
">",
"predicate",
")",
"{",
"for",
"(",
"T",
"t",
":",
"sequence",
")",
"{",
"if",
"(",
"... | Determines whether a given predicate holds true for at least
one element.
<p>Returns false for an empty sequence.</p> | [
"Determines",
"whether",
"a",
"given",
"predicate",
"holds",
"true",
"for",
"at",
"least",
"one",
"element",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/util/Linqy.java#L116-L124 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/TolerantSaxDocumentBuilder.java | TolerantSaxDocumentBuilder.characters | public void characters(char[] data, int start, int length) {
if (length >= 0) {
String characterData = new String(data, start, length);
trace("characters:" + characterData);
if (currentElement == null) {
warn("Can't append text node to null currentElement");
... | java | public void characters(char[] data, int start, int length) {
if (length >= 0) {
String characterData = new String(data, start, length);
trace("characters:" + characterData);
if (currentElement == null) {
warn("Can't append text node to null currentElement");
... | [
"public",
"void",
"characters",
"(",
"char",
"[",
"]",
"data",
",",
"int",
"start",
",",
"int",
"length",
")",
"{",
"if",
"(",
"length",
">=",
"0",
")",
"{",
"String",
"characterData",
"=",
"new",
"String",
"(",
"data",
",",
"start",
",",
"length",
... | ContentHandler method. | [
"ContentHandler",
"method",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/TolerantSaxDocumentBuilder.java#L121-L134 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/TolerantSaxDocumentBuilder.java | TolerantSaxDocumentBuilder.createElement | private Element createElement(String namespaceURI, String qName,
Attributes attributes) {
Element newElement = currentDocument.createElement(qName);
if (namespaceURI != null && namespaceURI.length() > 0) {
newElement.setPrefix(namespaceURI);
}
... | java | private Element createElement(String namespaceURI, String qName,
Attributes attributes) {
Element newElement = currentDocument.createElement(qName);
if (namespaceURI != null && namespaceURI.length() > 0) {
newElement.setPrefix(namespaceURI);
}
... | [
"private",
"Element",
"createElement",
"(",
"String",
"namespaceURI",
",",
"String",
"qName",
",",
"Attributes",
"attributes",
")",
"{",
"Element",
"newElement",
"=",
"currentDocument",
".",
"createElement",
"(",
"qName",
")",
";",
"if",
"(",
"namespaceURI",
"!=... | Create a DOM Element for insertion into the current document
@param namespaceURI
@param qName
@param attributes
@return the created Element | [
"Create",
"a",
"DOM",
"Element",
"for",
"insertion",
"into",
"the",
"current",
"document"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/TolerantSaxDocumentBuilder.java#L344-L358 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/TolerantSaxDocumentBuilder.java | TolerantSaxDocumentBuilder.appendNode | private void appendNode(Node appendNode) {
if (currentElement==null) {
currentDocument.appendChild(appendNode);
} else {
currentElement.appendChild(appendNode);
}
} | java | private void appendNode(Node appendNode) {
if (currentElement==null) {
currentDocument.appendChild(appendNode);
} else {
currentElement.appendChild(appendNode);
}
} | [
"private",
"void",
"appendNode",
"(",
"Node",
"appendNode",
")",
"{",
"if",
"(",
"currentElement",
"==",
"null",
")",
"{",
"currentDocument",
".",
"appendChild",
"(",
"appendNode",
")",
";",
"}",
"else",
"{",
"currentElement",
".",
"appendChild",
"(",
"appen... | Append a node to the current document or the current element in the document
@param appendNode | [
"Append",
"a",
"node",
"to",
"the",
"current",
"document",
"or",
"the",
"current",
"element",
"in",
"the",
"document"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/TolerantSaxDocumentBuilder.java#L364-L370 | train |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/NodeDescriptor.java | NodeDescriptor.appendNodeDetail | public static void appendNodeDetail(StringBuffer buf, NodeDetail nodeDetail) {
appendNodeDetail(buf, nodeDetail.getNode(), true);
buf.append(" at ").append(nodeDetail.getXpathLocation());
} | java | public static void appendNodeDetail(StringBuffer buf, NodeDetail nodeDetail) {
appendNodeDetail(buf, nodeDetail.getNode(), true);
buf.append(" at ").append(nodeDetail.getXpathLocation());
} | [
"public",
"static",
"void",
"appendNodeDetail",
"(",
"StringBuffer",
"buf",
",",
"NodeDetail",
"nodeDetail",
")",
"{",
"appendNodeDetail",
"(",
"buf",
",",
"nodeDetail",
".",
"getNode",
"(",
")",
",",
"true",
")",
";",
"buf",
".",
"append",
"(",
"\" at \"",
... | Convert a Node into a simple String representation
and append to StringBuffer
@param buf
@param nodeDetail | [
"Convert",
"a",
"Node",
"into",
"a",
"simple",
"String",
"representation",
"and",
"append",
"to",
"StringBuffer"
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/NodeDescriptor.java#L56-L59 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/transform/Transformation.java | Transformation.addOutputProperty | public void addOutputProperty(String name, String value) {
if (name == null) {
throw new IllegalArgumentException("name must not be null");
}
if (value == null) {
throw new IllegalArgumentException("value must not be null");
}
output.setProperty(name, valu... | java | public void addOutputProperty(String name, String value) {
if (name == null) {
throw new IllegalArgumentException("name must not be null");
}
if (value == null) {
throw new IllegalArgumentException("value must not be null");
}
output.setProperty(name, valu... | [
"public",
"void",
"addOutputProperty",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"name must not be null\"",
")",
";",
"}",
"if",
"(",
"value",
"==",
... | Add a named output property.
@param name name of the property - must not be null
@param value value of the property - must not be null | [
"Add",
"a",
"named",
"output",
"property",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/transform/Transformation.java#L84-L92 | train |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/transform/Transformation.java | Transformation.addParameter | public void addParameter(String name, Object value) {
if (name == null) {
throw new IllegalArgumentException("name must not be null");
}
params.put(name, value);
} | java | public void addParameter(String name, Object value) {
if (name == null) {
throw new IllegalArgumentException("name must not be null");
}
params.put(name, value);
} | [
"public",
"void",
"addParameter",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"name must not be null\"",
")",
";",
"}",
"params",
".",
"put",
"(",
"n... | Add a named parameter.
@param name name of the parameter - must not be null
@param value value of the parameter - may be null | [
"Add",
"a",
"named",
"parameter",
"."
] | fe3d701d43f57ee83dcba336e4c1555619d3084b | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/transform/Transformation.java#L105-L110 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.