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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
EsotericSoftware/yamlbeans | src/com/esotericsoftware/yamlbeans/YamlConfig.java | YamlConfig.setScalarSerializer | public void setScalarSerializer (Class type, ScalarSerializer serializer) {
if (type == null) throw new IllegalArgumentException("type cannot be null.");
if (serializer == null) throw new IllegalArgumentException("serializer cannot be null.");
scalarSerializers.put(type, serializer);
} | java | public void setScalarSerializer (Class type, ScalarSerializer serializer) {
if (type == null) throw new IllegalArgumentException("type cannot be null.");
if (serializer == null) throw new IllegalArgumentException("serializer cannot be null.");
scalarSerializers.put(type, serializer);
} | [
"public",
"void",
"setScalarSerializer",
"(",
"Class",
"type",
",",
"ScalarSerializer",
"serializer",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"type cannot be null.\"",
")",
";",
"if",
"(",
"serializer",
... | Adds a serializer for the specified scalar type. | [
"Adds",
"a",
"serializer",
"for",
"the",
"specified",
"scalar",
"type",
"."
] | f5610997edbc5534fc7e9f0a91654d14742345ca | https://github.com/EsotericSoftware/yamlbeans/blob/f5610997edbc5534fc7e9f0a91654d14742345ca/src/com/esotericsoftware/yamlbeans/YamlConfig.java#L77-L81 | train |
EsotericSoftware/yamlbeans | src/com/esotericsoftware/yamlbeans/YamlConfig.java | YamlConfig.setPropertyElementType | public void setPropertyElementType (Class type, String propertyName, Class elementType) {
if (type == null) throw new IllegalArgumentException("type cannot be null.");
if (propertyName == null) throw new IllegalArgumentException("propertyName cannot be null.");
if (elementType == null) throw new IllegalArgumen... | java | public void setPropertyElementType (Class type, String propertyName, Class elementType) {
if (type == null) throw new IllegalArgumentException("type cannot be null.");
if (propertyName == null) throw new IllegalArgumentException("propertyName cannot be null.");
if (elementType == null) throw new IllegalArgumen... | [
"public",
"void",
"setPropertyElementType",
"(",
"Class",
"type",
",",
"String",
"propertyName",
",",
"Class",
"elementType",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"type cannot be null.\"",
")",
";",
"... | Sets the default type of elements in a Collection or Map property. No tag will be output for elements of this type. This
type will be used for each element if no tag is found. | [
"Sets",
"the",
"default",
"type",
"of",
"elements",
"in",
"a",
"Collection",
"or",
"Map",
"property",
".",
"No",
"tag",
"will",
"be",
"output",
"for",
"elements",
"of",
"this",
"type",
".",
"This",
"type",
"will",
"be",
"used",
"for",
"each",
"element",
... | f5610997edbc5534fc7e9f0a91654d14742345ca | https://github.com/EsotericSoftware/yamlbeans/blob/f5610997edbc5534fc7e9f0a91654d14742345ca/src/com/esotericsoftware/yamlbeans/YamlConfig.java#L85-L97 | train |
EsotericSoftware/yamlbeans | src/com/esotericsoftware/yamlbeans/YamlConfig.java | YamlConfig.setPropertyDefaultType | public void setPropertyDefaultType (Class type, String propertyName, Class defaultType) {
if (type == null) throw new IllegalArgumentException("type cannot be null.");
if (propertyName == null) throw new IllegalArgumentException("propertyName cannot be null.");
if (defaultType == null) throw new IllegalArgumen... | java | public void setPropertyDefaultType (Class type, String propertyName, Class defaultType) {
if (type == null) throw new IllegalArgumentException("type cannot be null.");
if (propertyName == null) throw new IllegalArgumentException("propertyName cannot be null.");
if (defaultType == null) throw new IllegalArgumen... | [
"public",
"void",
"setPropertyDefaultType",
"(",
"Class",
"type",
",",
"String",
"propertyName",
",",
"Class",
"defaultType",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"type cannot be null.\"",
")",
";",
"... | Sets the default type of a property. No tag will be output for values of this type. This type will be used if no tag is
found. | [
"Sets",
"the",
"default",
"type",
"of",
"a",
"property",
".",
"No",
"tag",
"will",
"be",
"output",
"for",
"values",
"of",
"this",
"type",
".",
"This",
"type",
"will",
"be",
"used",
"if",
"no",
"tag",
"is",
"found",
"."
] | f5610997edbc5534fc7e9f0a91654d14742345ca | https://github.com/EsotericSoftware/yamlbeans/blob/f5610997edbc5534fc7e9f0a91654d14742345ca/src/com/esotericsoftware/yamlbeans/YamlConfig.java#L101-L109 | train |
EsotericSoftware/yamlbeans | src/com/esotericsoftware/yamlbeans/YamlReader.java | YamlReader.read | public <T> T read (Class<T> type) throws YamlException {
return read(type, null);
} | java | public <T> T read (Class<T> type) throws YamlException {
return read(type, null);
} | [
"public",
"<",
"T",
">",
"T",
"read",
"(",
"Class",
"<",
"T",
">",
"type",
")",
"throws",
"YamlException",
"{",
"return",
"read",
"(",
"type",
",",
"null",
")",
";",
"}"
] | Reads an object of the specified type from YAML.
@param type The type of object to read. If null, behaves the same as {{@link #read()}. | [
"Reads",
"an",
"object",
"of",
"the",
"specified",
"type",
"from",
"YAML",
"."
] | f5610997edbc5534fc7e9f0a91654d14742345ca | https://github.com/EsotericSoftware/yamlbeans/blob/f5610997edbc5534fc7e9f0a91654d14742345ca/src/com/esotericsoftware/yamlbeans/YamlReader.java#L91-L93 | train |
EsotericSoftware/yamlbeans | src/com/esotericsoftware/yamlbeans/YamlReader.java | YamlReader.read | public <T> T read (Class<T> type, Class elementType) throws YamlException {
try {
while (true) {
Event event = parser.getNextEvent();
if (event == null) return null;
if (event.type == STREAM_END) return null;
if (event.type == DOCUMENT_START) break;
}
return (T)readValue(type, element... | java | public <T> T read (Class<T> type, Class elementType) throws YamlException {
try {
while (true) {
Event event = parser.getNextEvent();
if (event == null) return null;
if (event.type == STREAM_END) return null;
if (event.type == DOCUMENT_START) break;
}
return (T)readValue(type, element... | [
"public",
"<",
"T",
">",
"T",
"read",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"Class",
"elementType",
")",
"throws",
"YamlException",
"{",
"try",
"{",
"while",
"(",
"true",
")",
"{",
"Event",
"event",
"=",
"parser",
".",
"getNextEvent",
"(",
")",
... | Reads an array, Map, List, or Collection object of the specified type from YAML, using the specified element type.
@param type The type of object to read. If null, behaves the same as {{@link #read()}. | [
"Reads",
"an",
"array",
"Map",
"List",
"or",
"Collection",
"object",
"of",
"the",
"specified",
"type",
"from",
"YAML",
"using",
"the",
"specified",
"element",
"type",
"."
] | f5610997edbc5534fc7e9f0a91654d14742345ca | https://github.com/EsotericSoftware/yamlbeans/blob/f5610997edbc5534fc7e9f0a91654d14742345ca/src/com/esotericsoftware/yamlbeans/YamlReader.java#L97-L111 | train |
EsotericSoftware/yamlbeans | src/com/esotericsoftware/yamlbeans/YamlReader.java | YamlReader.readValue | protected Object readValue (Class type, Class elementType, Class defaultType)
throws YamlException, ParserException, TokenizerException {
String tag = null, anchor = null;
Event event = parser.peekNextEvent();
switch (event.type) {
case ALIAS:
parser.getNextEvent();
anchor = ((AliasEvent)event)... | java | protected Object readValue (Class type, Class elementType, Class defaultType)
throws YamlException, ParserException, TokenizerException {
String tag = null, anchor = null;
Event event = parser.peekNextEvent();
switch (event.type) {
case ALIAS:
parser.getNextEvent();
anchor = ((AliasEvent)event)... | [
"protected",
"Object",
"readValue",
"(",
"Class",
"type",
",",
"Class",
"elementType",
",",
"Class",
"defaultType",
")",
"throws",
"YamlException",
",",
"ParserException",
",",
"TokenizerException",
"{",
"String",
"tag",
"=",
"null",
",",
"anchor",
"=",
"null",
... | Reads an object from the YAML. Can be overidden to take some action for any of the objects returned. | [
"Reads",
"an",
"object",
"from",
"the",
"YAML",
".",
"Can",
"be",
"overidden",
"to",
"take",
"some",
"action",
"for",
"any",
"of",
"the",
"objects",
"returned",
"."
] | f5610997edbc5534fc7e9f0a91654d14742345ca | https://github.com/EsotericSoftware/yamlbeans/blob/f5610997edbc5534fc7e9f0a91654d14742345ca/src/com/esotericsoftware/yamlbeans/YamlReader.java#L114-L139 | train |
EsotericSoftware/yamlbeans | src/com/esotericsoftware/yamlbeans/YamlReader.java | YamlReader.createObject | protected Object createObject (Class type) throws InvocationTargetException {
// Use deferred construction if a non-zero-arg constructor is available.
DeferredConstruction deferredConstruction = Beans.getDeferredConstruction(type, config);
if (deferredConstruction != null) return deferredConstruction;
retur... | java | protected Object createObject (Class type) throws InvocationTargetException {
// Use deferred construction if a non-zero-arg constructor is available.
DeferredConstruction deferredConstruction = Beans.getDeferredConstruction(type, config);
if (deferredConstruction != null) return deferredConstruction;
retur... | [
"protected",
"Object",
"createObject",
"(",
"Class",
"type",
")",
"throws",
"InvocationTargetException",
"{",
"// Use deferred construction if a non-zero-arg constructor is available.\r",
"DeferredConstruction",
"deferredConstruction",
"=",
"Beans",
".",
"getDeferredConstruction",
... | Returns a new object of the requested type. | [
"Returns",
"a",
"new",
"object",
"of",
"the",
"requested",
"type",
"."
] | f5610997edbc5534fc7e9f0a91654d14742345ca | https://github.com/EsotericSoftware/yamlbeans/blob/f5610997edbc5534fc7e9f0a91654d14742345ca/src/com/esotericsoftware/yamlbeans/YamlReader.java#L460-L465 | train |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/HtmlStreamRenderer.java | HtmlStreamRenderer.error | private final void error(String message, CharSequence identifier) {
if (badHtmlHandler != Handler.DO_NOTHING) { // Avoid string append.
badHtmlHandler.handle(message + " : " + identifier);
}
} | java | private final void error(String message, CharSequence identifier) {
if (badHtmlHandler != Handler.DO_NOTHING) { // Avoid string append.
badHtmlHandler.handle(message + " : " + identifier);
}
} | [
"private",
"final",
"void",
"error",
"(",
"String",
"message",
",",
"CharSequence",
"identifier",
")",
"{",
"if",
"(",
"badHtmlHandler",
"!=",
"Handler",
".",
"DO_NOTHING",
")",
"{",
"// Avoid string append.",
"badHtmlHandler",
".",
"handle",
"(",
"message",
"+"... | Called when the series of calls make no sense.
May be overridden to throw an unchecked throwable, to log, or to take some
other action.
@param message for human consumption.
@param identifier an HTML identifier associated with the message. | [
"Called",
"when",
"the",
"series",
"of",
"calls",
"make",
"no",
"sense",
".",
"May",
"be",
"overridden",
"to",
"throw",
"an",
"unchecked",
"throwable",
"to",
"log",
"or",
"to",
"take",
"some",
"other",
"action",
"."
] | a30315fe9a41e19c449628e7ef3488b3a7856009 | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/HtmlStreamRenderer.java#L115-L119 | train |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/HtmlStreamRenderer.java | HtmlStreamRenderer.safeName | static String safeName(String unsafeElementName) {
String elementName = HtmlLexer.canonicalName(unsafeElementName);
// Substitute a reliably non-raw-text element for raw-text and
// plain-text elements.
switch (elementName.length()) {
case 3:
if ("xmp".equals(elementName)) { return "pre";... | java | static String safeName(String unsafeElementName) {
String elementName = HtmlLexer.canonicalName(unsafeElementName);
// Substitute a reliably non-raw-text element for raw-text and
// plain-text elements.
switch (elementName.length()) {
case 3:
if ("xmp".equals(elementName)) { return "pre";... | [
"static",
"String",
"safeName",
"(",
"String",
"unsafeElementName",
")",
"{",
"String",
"elementName",
"=",
"HtmlLexer",
".",
"canonicalName",
"(",
"unsafeElementName",
")",
";",
"// Substitute a reliably non-raw-text element for raw-text and",
"// plain-text elements.",
"swi... | Canonicalizes the element name and possibly substitutes an alternative
that has more consistent semantics. | [
"Canonicalizes",
"the",
"element",
"name",
"and",
"possibly",
"substitutes",
"an",
"alternative",
"that",
"has",
"more",
"consistent",
"semantics",
"."
] | a30315fe9a41e19c449628e7ef3488b3a7856009 | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/HtmlStreamRenderer.java#L388-L405 | train |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/Trie.java | Trie.lookup | public Trie lookup(char ch) {
int i = Arrays.binarySearch(childMap, ch);
return i >= 0 ? children[i] : null;
} | java | public Trie lookup(char ch) {
int i = Arrays.binarySearch(childMap, ch);
return i >= 0 ? children[i] : null;
} | [
"public",
"Trie",
"lookup",
"(",
"char",
"ch",
")",
"{",
"int",
"i",
"=",
"Arrays",
".",
"binarySearch",
"(",
"childMap",
",",
"ch",
")",
";",
"return",
"i",
">=",
"0",
"?",
"children",
"[",
"i",
"]",
":",
"null",
";",
"}"
] | The child corresponding to the given character.
@return null if no such trie. | [
"The",
"child",
"corresponding",
"to",
"the",
"given",
"character",
"."
] | a30315fe9a41e19c449628e7ef3488b3a7856009 | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/Trie.java#L125-L128 | train |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/Trie.java | Trie.lookup | public Trie lookup(CharSequence s) {
Trie t = this;
for (int i = 0, n = s.length(); i < n; ++i) {
t = t.lookup(s.charAt(i));
if (null == t) { break; }
}
return t;
} | java | public Trie lookup(CharSequence s) {
Trie t = this;
for (int i = 0, n = s.length(); i < n; ++i) {
t = t.lookup(s.charAt(i));
if (null == t) { break; }
}
return t;
} | [
"public",
"Trie",
"lookup",
"(",
"CharSequence",
"s",
")",
"{",
"Trie",
"t",
"=",
"this",
";",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"n",
"=",
"s",
".",
"length",
"(",
")",
";",
"i",
"<",
"n",
";",
"++",
"i",
")",
"{",
"t",
"=",
"t",
"."... | The descendant of this trie corresponding to the string for this trie
appended with s.
@param s non null.
@return null if no such trie. | [
"The",
"descendant",
"of",
"this",
"trie",
"corresponding",
"to",
"the",
"string",
"for",
"this",
"trie",
"appended",
"with",
"s",
"."
] | a30315fe9a41e19c449628e7ef3488b3a7856009 | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/Trie.java#L136-L143 | train |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/FilterUrlByProtocolAttributePolicy.java | FilterUrlByProtocolAttributePolicy.normalizeUri | static String normalizeUri(String s) {
int n = s.length();
boolean colonsIrrelevant = false;
for (int i = 0; i < n; ++i) {
char ch = s.charAt(i);
switch (ch) {
case '/': case '#': case '?': case ':':
colonsIrrelevant = true;
break;
case '(': case ')':
... | java | static String normalizeUri(String s) {
int n = s.length();
boolean colonsIrrelevant = false;
for (int i = 0; i < n; ++i) {
char ch = s.charAt(i);
switch (ch) {
case '/': case '#': case '?': case ':':
colonsIrrelevant = true;
break;
case '(': case ')':
... | [
"static",
"String",
"normalizeUri",
"(",
"String",
"s",
")",
"{",
"int",
"n",
"=",
"s",
".",
"length",
"(",
")",
";",
"boolean",
"colonsIrrelevant",
"=",
"false",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"n",
";",
"++",
"i",
")",
"... | Percent encodes anything that looks like a colon, or a parenthesis. | [
"Percent",
"encodes",
"anything",
"that",
"looks",
"like",
"a",
"colon",
"or",
"a",
"parenthesis",
"."
] | a30315fe9a41e19c449628e7ef3488b3a7856009 | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/FilterUrlByProtocolAttributePolicy.java#L97-L125 | train |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/HtmlElementTables.java | HtmlElementTables.canContain | public boolean canContain(int parent, int child) {
if (nofeatureElements.get(parent)) {
// It's hard to interrogate a browser about the behavior of
// <noscript> in scriptless mode using JavaScript, and the
// behavior of <noscript> is more dangerous when in that mode,
// so we hardcode that... | java | public boolean canContain(int parent, int child) {
if (nofeatureElements.get(parent)) {
// It's hard to interrogate a browser about the behavior of
// <noscript> in scriptless mode using JavaScript, and the
// behavior of <noscript> is more dangerous when in that mode,
// so we hardcode that... | [
"public",
"boolean",
"canContain",
"(",
"int",
"parent",
",",
"int",
"child",
")",
"{",
"if",
"(",
"nofeatureElements",
".",
"get",
"(",
"parent",
")",
")",
"{",
"// It's hard to interrogate a browser about the behavior of",
"// <noscript> in scriptless mode using JavaScr... | True if parent can directly contain child. | [
"True",
"if",
"parent",
"can",
"directly",
"contain",
"child",
"."
] | a30315fe9a41e19c449628e7ef3488b3a7856009 | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/HtmlElementTables.java#L193-L205 | train |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/HtmlElementTables.java | HtmlElementTables.impliedElements | int[] impliedElements(int anc, int desc) {
// <style> and <script> are allowed anywhere.
if (desc == SCRIPT_TAG || desc == STYLE_TAG) {
return ZERO_INTS;
}
// It's dangerous to allow free <li> tags because of the way an <li>
// implies a </li> if there is an <li> on the parse stack without a
... | java | int[] impliedElements(int anc, int desc) {
// <style> and <script> are allowed anywhere.
if (desc == SCRIPT_TAG || desc == STYLE_TAG) {
return ZERO_INTS;
}
// It's dangerous to allow free <li> tags because of the way an <li>
// implies a </li> if there is an <li> on the parse stack without a
... | [
"int",
"[",
"]",
"impliedElements",
"(",
"int",
"anc",
",",
"int",
"desc",
")",
"{",
"// <style> and <script> are allowed anywhere.",
"if",
"(",
"desc",
"==",
"SCRIPT_TAG",
"||",
"desc",
"==",
"STYLE_TAG",
")",
"{",
"return",
"ZERO_INTS",
";",
"}",
"// It's da... | Elements in order which are implicitly opened when a descendant tag is
lexically nested within an ancestor. | [
"Elements",
"in",
"order",
"which",
"are",
"implicitly",
"opened",
"when",
"a",
"descendant",
"tag",
"is",
"lexically",
"nested",
"within",
"an",
"ancestor",
"."
] | a30315fe9a41e19c449628e7ef3488b3a7856009 | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/HtmlElementTables.java#L325-L374 | train |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/HtmlLexer.java | HtmlLexer.canonicalName | static String canonicalName(String elementOrAttribName) {
return elementOrAttribName.indexOf(':') >= 0
? elementOrAttribName : Strings.toLowerCase(elementOrAttribName);
} | java | static String canonicalName(String elementOrAttribName) {
return elementOrAttribName.indexOf(':') >= 0
? elementOrAttribName : Strings.toLowerCase(elementOrAttribName);
} | [
"static",
"String",
"canonicalName",
"(",
"String",
"elementOrAttribName",
")",
"{",
"return",
"elementOrAttribName",
".",
"indexOf",
"(",
"'",
"'",
")",
">=",
"0",
"?",
"elementOrAttribName",
":",
"Strings",
".",
"toLowerCase",
"(",
"elementOrAttribName",
")",
... | Normalize case of names that are not name-spaced. This lower-cases HTML
element and attribute names, but not ones for embedded SVG or MATHML. | [
"Normalize",
"case",
"of",
"names",
"that",
"are",
"not",
"name",
"-",
"spaced",
".",
"This",
"lower",
"-",
"cases",
"HTML",
"element",
"and",
"attribute",
"names",
"but",
"not",
"ones",
"for",
"embedded",
"SVG",
"or",
"MATHML",
"."
] | a30315fe9a41e19c449628e7ef3488b3a7856009 | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/HtmlLexer.java#L60-L63 | train |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/HtmlLexer.java | HtmlLexer.produce | @Override
protected HtmlToken produce() {
HtmlToken token = readToken();
if (token == null) { return null; }
switch (token.type) {
// Keep track of whether we're inside a tag or not.
case TAGBEGIN:
state = State.IN_TAG;
break;
case TAGEND:
if (state == State.SAW... | java | @Override
protected HtmlToken produce() {
HtmlToken token = readToken();
if (token == null) { return null; }
switch (token.type) {
// Keep track of whether we're inside a tag or not.
case TAGBEGIN:
state = State.IN_TAG;
break;
case TAGEND:
if (state == State.SAW... | [
"@",
"Override",
"protected",
"HtmlToken",
"produce",
"(",
")",
"{",
"HtmlToken",
"token",
"=",
"readToken",
"(",
")",
";",
"if",
"(",
"token",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"switch",
"(",
"token",
".",
"type",
")",
"{",
"// Kee... | Makes sure that this.token contains a token if one is available.
This may require fetching and combining multiple tokens from the underlying
splitter. | [
"Makes",
"sure",
"that",
"this",
".",
"token",
"contains",
"a",
"token",
"if",
"one",
"is",
"available",
".",
"This",
"may",
"require",
"fetching",
"and",
"combining",
"multiple",
"tokens",
"from",
"the",
"underlying",
"splitter",
"."
] | a30315fe9a41e19c449628e7ef3488b3a7856009 | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/HtmlLexer.java#L82-L164 | train |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/HtmlLexer.java | HtmlLexer.collapseSubsequent | private HtmlToken collapseSubsequent(HtmlToken token) {
HtmlToken collapsed = token;
for (HtmlToken next;
(next= peekToken(0)) != null && next.type == token.type;
readToken()) {
collapsed = join(collapsed, next);
}
return collapsed;
} | java | private HtmlToken collapseSubsequent(HtmlToken token) {
HtmlToken collapsed = token;
for (HtmlToken next;
(next= peekToken(0)) != null && next.type == token.type;
readToken()) {
collapsed = join(collapsed, next);
}
return collapsed;
} | [
"private",
"HtmlToken",
"collapseSubsequent",
"(",
"HtmlToken",
"token",
")",
"{",
"HtmlToken",
"collapsed",
"=",
"token",
";",
"for",
"(",
"HtmlToken",
"next",
";",
"(",
"next",
"=",
"peekToken",
"(",
"0",
")",
")",
"!=",
"null",
"&&",
"next",
".",
"typ... | Collapses all the following tokens of the same type into this.token. | [
"Collapses",
"all",
"the",
"following",
"tokens",
"of",
"the",
"same",
"type",
"into",
"this",
".",
"token",
"."
] | a30315fe9a41e19c449628e7ef3488b3a7856009 | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/HtmlLexer.java#L169-L177 | train |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/HtmlLexer.java | HtmlLexer.isValuelessAttribute | private static boolean isValuelessAttribute(String attribName) {
boolean valueless = VALUELESS_ATTRIB_NAMES.contains(
Strings.toLowerCase(attribName));
return valueless;
} | java | private static boolean isValuelessAttribute(String attribName) {
boolean valueless = VALUELESS_ATTRIB_NAMES.contains(
Strings.toLowerCase(attribName));
return valueless;
} | [
"private",
"static",
"boolean",
"isValuelessAttribute",
"(",
"String",
"attribName",
")",
"{",
"boolean",
"valueless",
"=",
"VALUELESS_ATTRIB_NAMES",
".",
"contains",
"(",
"Strings",
".",
"toLowerCase",
"(",
"attribName",
")",
")",
";",
"return",
"valueless",
";",... | Can the attribute appear in HTML without a value. | [
"Can",
"the",
"attribute",
"appear",
"in",
"HTML",
"without",
"a",
"value",
"."
] | a30315fe9a41e19c449628e7ef3488b3a7856009 | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/HtmlLexer.java#L245-L249 | train |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/HtmlLexer.java | HtmlInputSplitter.produce | @Override
protected HtmlToken produce() {
HtmlToken token = parseToken();
if (null == token) { return null; }
// Handle escape-exempt blocks.
// The parse() method is only dimly aware of escape-excempt blocks, so
// here we detect the beginning and ends of escape exempt blocks, and
// reclass... | java | @Override
protected HtmlToken produce() {
HtmlToken token = parseToken();
if (null == token) { return null; }
// Handle escape-exempt blocks.
// The parse() method is only dimly aware of escape-excempt blocks, so
// here we detect the beginning and ends of escape exempt blocks, and
// reclass... | [
"@",
"Override",
"protected",
"HtmlToken",
"produce",
"(",
")",
"{",
"HtmlToken",
"token",
"=",
"parseToken",
"(",
")",
";",
"if",
"(",
"null",
"==",
"token",
")",
"{",
"return",
"null",
";",
"}",
"// Handle escape-exempt blocks.",
"// The parse() method is only... | Make sure that there is a token ready to yield in this.token. | [
"Make",
"sure",
"that",
"there",
"is",
"a",
"token",
"ready",
"to",
"yield",
"in",
"this",
".",
"token",
"."
] | a30315fe9a41e19c449628e7ef3488b3a7856009 | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/HtmlLexer.java#L293-L332 | train |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/HtmlPolicyBuilder.java | HtmlPolicyBuilder.allowElements | public HtmlPolicyBuilder allowElements(
ElementPolicy policy, String... elementNames) {
invalidateCompiledState();
for (String elementName : elementNames) {
elementName = HtmlLexer.canonicalName(elementName);
ElementPolicy newPolicy = ElementPolicy.Util.join(
elPolicies.get(elementNa... | java | public HtmlPolicyBuilder allowElements(
ElementPolicy policy, String... elementNames) {
invalidateCompiledState();
for (String elementName : elementNames) {
elementName = HtmlLexer.canonicalName(elementName);
ElementPolicy newPolicy = ElementPolicy.Util.join(
elPolicies.get(elementNa... | [
"public",
"HtmlPolicyBuilder",
"allowElements",
"(",
"ElementPolicy",
"policy",
",",
"String",
"...",
"elementNames",
")",
"{",
"invalidateCompiledState",
"(",
")",
";",
"for",
"(",
"String",
"elementName",
":",
"elementNames",
")",
"{",
"elementName",
"=",
"HtmlL... | Allow the given elements with the given policy.
@param policy May remove or add attributes, change the element name, or
deny the element. | [
"Allow",
"the",
"given",
"elements",
"with",
"the",
"given",
"policy",
"."
] | a30315fe9a41e19c449628e7ef3488b3a7856009 | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/HtmlPolicyBuilder.java#L229-L247 | train |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/HtmlPolicyBuilder.java | HtmlPolicyBuilder.allowWithoutAttributes | public HtmlPolicyBuilder allowWithoutAttributes(String... elementNames) {
invalidateCompiledState();
for (String elementName : elementNames) {
elementName = HtmlLexer.canonicalName(elementName);
skipIfEmpty.remove(elementName);
}
return this;
} | java | public HtmlPolicyBuilder allowWithoutAttributes(String... elementNames) {
invalidateCompiledState();
for (String elementName : elementNames) {
elementName = HtmlLexer.canonicalName(elementName);
skipIfEmpty.remove(elementName);
}
return this;
} | [
"public",
"HtmlPolicyBuilder",
"allowWithoutAttributes",
"(",
"String",
"...",
"elementNames",
")",
"{",
"invalidateCompiledState",
"(",
")",
";",
"for",
"(",
"String",
"elementName",
":",
"elementNames",
")",
"{",
"elementName",
"=",
"HtmlLexer",
".",
"canonicalNam... | Assuming the given elements are allowed, allows them to appear without
attributes.
@see #DEFAULT_SKIP_IF_EMPTY
@see #disallowWithoutAttributes | [
"Assuming",
"the",
"given",
"elements",
"are",
"allowed",
"allows",
"them",
"to",
"appear",
"without",
"attributes",
"."
] | a30315fe9a41e19c449628e7ef3488b3a7856009 | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/HtmlPolicyBuilder.java#L313-L320 | train |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/HtmlPolicyBuilder.java | HtmlPolicyBuilder.disallowWithoutAttributes | public HtmlPolicyBuilder disallowWithoutAttributes(String... elementNames) {
invalidateCompiledState();
for (String elementName : elementNames) {
elementName = HtmlLexer.canonicalName(elementName);
skipIfEmpty.add(elementName);
}
return this;
} | java | public HtmlPolicyBuilder disallowWithoutAttributes(String... elementNames) {
invalidateCompiledState();
for (String elementName : elementNames) {
elementName = HtmlLexer.canonicalName(elementName);
skipIfEmpty.add(elementName);
}
return this;
} | [
"public",
"HtmlPolicyBuilder",
"disallowWithoutAttributes",
"(",
"String",
"...",
"elementNames",
")",
"{",
"invalidateCompiledState",
"(",
")",
";",
"for",
"(",
"String",
"elementName",
":",
"elementNames",
")",
"{",
"elementName",
"=",
"HtmlLexer",
".",
"canonical... | Disallows the given elements from appearing without attributes.
@see #DEFAULT_SKIP_IF_EMPTY
@see #allowWithoutAttributes | [
"Disallows",
"the",
"given",
"elements",
"from",
"appearing",
"without",
"attributes",
"."
] | a30315fe9a41e19c449628e7ef3488b3a7856009 | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/HtmlPolicyBuilder.java#L328-L335 | train |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/HtmlPolicyBuilder.java | HtmlPolicyBuilder.allowAttributes | public AttributeBuilder allowAttributes(String... attributeNames) {
ImmutableList.Builder<String> b = ImmutableList.builder();
for (String attributeName : attributeNames) {
b.add(HtmlLexer.canonicalName(attributeName));
}
return new AttributeBuilder(b.build());
} | java | public AttributeBuilder allowAttributes(String... attributeNames) {
ImmutableList.Builder<String> b = ImmutableList.builder();
for (String attributeName : attributeNames) {
b.add(HtmlLexer.canonicalName(attributeName));
}
return new AttributeBuilder(b.build());
} | [
"public",
"AttributeBuilder",
"allowAttributes",
"(",
"String",
"...",
"attributeNames",
")",
"{",
"ImmutableList",
".",
"Builder",
"<",
"String",
">",
"b",
"=",
"ImmutableList",
".",
"builder",
"(",
")",
";",
"for",
"(",
"String",
"attributeName",
":",
"attri... | Returns an object that lets you associate policies with the given
attributes, and allow them globally or on specific elements. | [
"Returns",
"an",
"object",
"that",
"lets",
"you",
"associate",
"policies",
"with",
"the",
"given",
"attributes",
"and",
"allow",
"them",
"globally",
"or",
"on",
"specific",
"elements",
"."
] | a30315fe9a41e19c449628e7ef3488b3a7856009 | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/HtmlPolicyBuilder.java#L341-L347 | train |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/HtmlPolicyBuilder.java | HtmlPolicyBuilder.withPreprocessor | public HtmlPolicyBuilder withPreprocessor(HtmlStreamEventProcessor pp) {
this.preprocessor = HtmlStreamEventProcessor.Processors.compose(
this.preprocessor, pp);
return this;
} | java | public HtmlPolicyBuilder withPreprocessor(HtmlStreamEventProcessor pp) {
this.preprocessor = HtmlStreamEventProcessor.Processors.compose(
this.preprocessor, pp);
return this;
} | [
"public",
"HtmlPolicyBuilder",
"withPreprocessor",
"(",
"HtmlStreamEventProcessor",
"pp",
")",
"{",
"this",
".",
"preprocessor",
"=",
"HtmlStreamEventProcessor",
".",
"Processors",
".",
"compose",
"(",
"this",
".",
"preprocessor",
",",
"pp",
")",
";",
"return",
"t... | Inserts a pre-processor into the pipeline between the lexer and the policy.
Pre-processors receive HTML events before the policy, so the policy will
be applied to anything they add.
Pre-processors are not in the TCB since they cannot bypass the policy. | [
"Inserts",
"a",
"pre",
"-",
"processor",
"into",
"the",
"pipeline",
"between",
"the",
"lexer",
"and",
"the",
"policy",
".",
"Pre",
"-",
"processors",
"receive",
"HTML",
"events",
"before",
"the",
"policy",
"so",
"the",
"policy",
"will",
"be",
"applied",
"t... | a30315fe9a41e19c449628e7ef3488b3a7856009 | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/HtmlPolicyBuilder.java#L567-L571 | train |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/examples/SlashdotPolicyExample.java | SlashdotPolicyExample.main | public static void main(String[] args) throws IOException {
if (args.length != 0) {
System.err.println("Reads from STDIN and writes to STDOUT");
System.exit(-1);
}
System.err.println("[Reading from STDIN]");
// Fetch the HTML to sanitize.
String html = CharStreams.toString(
new I... | java | public static void main(String[] args) throws IOException {
if (args.length != 0) {
System.err.println("Reads from STDIN and writes to STDOUT");
System.exit(-1);
}
System.err.println("[Reading from STDIN]");
// Fetch the HTML to sanitize.
String html = CharStreams.toString(
new I... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"IOException",
"{",
"if",
"(",
"args",
".",
"length",
"!=",
"0",
")",
"{",
"System",
".",
"err",
".",
"println",
"(",
"\"Reads from STDIN and writes to STDOUT\"",
")",
";",... | A test-bed that reads HTML from stdin and writes sanitized content to
stdout. | [
"A",
"test",
"-",
"bed",
"that",
"reads",
"HTML",
"from",
"stdin",
"and",
"writes",
"sanitized",
"content",
"to",
"stdout",
"."
] | a30315fe9a41e19c449628e7ef3488b3a7856009 | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/examples/SlashdotPolicyExample.java#L95-L123 | train |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/Encoding.java | Encoding.decodeHtml | public static String decodeHtml(String s) {
int firstAmp = s.indexOf('&');
int safeLimit = longestPrefixOfGoodCodeunits(s);
if ((firstAmp & safeLimit) < 0) { return s; }
StringBuilder sb;
{
int n = s.length();
sb = new StringBuilder(n);
int pos = 0;
int amp = firstAmp;
... | java | public static String decodeHtml(String s) {
int firstAmp = s.indexOf('&');
int safeLimit = longestPrefixOfGoodCodeunits(s);
if ((firstAmp & safeLimit) < 0) { return s; }
StringBuilder sb;
{
int n = s.length();
sb = new StringBuilder(n);
int pos = 0;
int amp = firstAmp;
... | [
"public",
"static",
"String",
"decodeHtml",
"(",
"String",
"s",
")",
"{",
"int",
"firstAmp",
"=",
"s",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"int",
"safeLimit",
"=",
"longestPrefixOfGoodCodeunits",
"(",
"s",
")",
";",
"if",
"(",
"(",
"firstAmp",
"&"... | Decodes HTML entities to produce a string containing only valid
Unicode scalar values. | [
"Decodes",
"HTML",
"entities",
"to",
"produce",
"a",
"string",
"containing",
"only",
"valid",
"Unicode",
"scalar",
"values",
"."
] | a30315fe9a41e19c449628e7ef3488b3a7856009 | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/Encoding.java#L42-L71 | train |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/Encoding.java | Encoding.stripBannedCodeunits | @TCB
static String stripBannedCodeunits(String s) {
int safeLimit = longestPrefixOfGoodCodeunits(s);
if (safeLimit < 0) { return s; }
StringBuilder sb = new StringBuilder(s);
stripBannedCodeunits(sb, safeLimit);
return sb.toString();
} | java | @TCB
static String stripBannedCodeunits(String s) {
int safeLimit = longestPrefixOfGoodCodeunits(s);
if (safeLimit < 0) { return s; }
StringBuilder sb = new StringBuilder(s);
stripBannedCodeunits(sb, safeLimit);
return sb.toString();
} | [
"@",
"TCB",
"static",
"String",
"stripBannedCodeunits",
"(",
"String",
"s",
")",
"{",
"int",
"safeLimit",
"=",
"longestPrefixOfGoodCodeunits",
"(",
"s",
")",
";",
"if",
"(",
"safeLimit",
"<",
"0",
")",
"{",
"return",
"s",
";",
"}",
"StringBuilder",
"sb",
... | Returns the portion of its input that consists of XML safe chars.
@see <a href="http://www.w3.org/TR/2008/REC-xml-20081126/#charsets">XML Ch. 2.2 - Characters</a> | [
"Returns",
"the",
"portion",
"of",
"its",
"input",
"that",
"consists",
"of",
"XML",
"safe",
"chars",
"."
] | a30315fe9a41e19c449628e7ef3488b3a7856009 | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/Encoding.java#L77-L85 | train |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/Encoding.java | Encoding.longestPrefixOfGoodCodeunits | @TCB
private static int longestPrefixOfGoodCodeunits(String s) {
int n = s.length(), i;
for (i = 0; i < n; ++i) {
char ch = s.charAt(i);
if (ch < 0x20) {
if (IS_BANNED_ASCII[ch]) {
return i;
}
} else if (0xd800 <= ch) {
if (ch <= 0xdfff) {
if (i+1 ... | java | @TCB
private static int longestPrefixOfGoodCodeunits(String s) {
int n = s.length(), i;
for (i = 0; i < n; ++i) {
char ch = s.charAt(i);
if (ch < 0x20) {
if (IS_BANNED_ASCII[ch]) {
return i;
}
} else if (0xd800 <= ch) {
if (ch <= 0xdfff) {
if (i+1 ... | [
"@",
"TCB",
"private",
"static",
"int",
"longestPrefixOfGoodCodeunits",
"(",
"String",
"s",
")",
"{",
"int",
"n",
"=",
"s",
".",
"length",
"(",
")",
",",
"i",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"n",
";",
"++",
"i",
")",
"{",
"char",... | The number of code-units at the front of s that form code-points in the
XML Character production.
@return -1 if all of s is in the XML Character production. | [
"The",
"number",
"of",
"code",
"-",
"units",
"at",
"the",
"front",
"of",
"s",
"that",
"form",
"code",
"-",
"points",
"in",
"the",
"XML",
"Character",
"production",
"."
] | a30315fe9a41e19c449628e7ef3488b3a7856009 | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/Encoding.java#L130-L152 | train |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/TagBalancingHtmlStreamEventReceiver.java | TagBalancingHtmlStreamEventReceiver.canContain | private boolean canContain(
int child, int container, int containerIndexOnStack) {
Preconditions.checkArgument(containerIndexOnStack >= 0);
int anc = container;
int ancIndexOnStack = containerIndexOnStack;
while (true) {
if (METADATA.canContain(anc, child)) {
return true;
}
... | java | private boolean canContain(
int child, int container, int containerIndexOnStack) {
Preconditions.checkArgument(containerIndexOnStack >= 0);
int anc = container;
int ancIndexOnStack = containerIndexOnStack;
while (true) {
if (METADATA.canContain(anc, child)) {
return true;
}
... | [
"private",
"boolean",
"canContain",
"(",
"int",
"child",
",",
"int",
"container",
",",
"int",
"containerIndexOnStack",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"containerIndexOnStack",
">=",
"0",
")",
";",
"int",
"anc",
"=",
"container",
";",
"int... | Takes into account transparency when figuring out what
can be contained. | [
"Takes",
"into",
"account",
"transparency",
"when",
"figuring",
"out",
"what",
"can",
"be",
"contained",
"."
] | a30315fe9a41e19c449628e7ef3488b3a7856009 | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/TagBalancingHtmlStreamEventReceiver.java#L217-L235 | train |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/examples/UrlTextExample.java | UrlTextExample.run | public static void run(Appendable out, String... inputs) throws IOException {
PolicyFactory policyBuilder = new HtmlPolicyBuilder()
.allowAttributes("src").onElements("img")
.allowAttributes("href").onElements("a")
// Allow some URLs through.
.allowStandardUrlProtocols()
.allowElements... | java | public static void run(Appendable out, String... inputs) throws IOException {
PolicyFactory policyBuilder = new HtmlPolicyBuilder()
.allowAttributes("src").onElements("img")
.allowAttributes("href").onElements("a")
// Allow some URLs through.
.allowStandardUrlProtocols()
.allowElements... | [
"public",
"static",
"void",
"run",
"(",
"Appendable",
"out",
",",
"String",
"...",
"inputs",
")",
"throws",
"IOException",
"{",
"PolicyFactory",
"policyBuilder",
"=",
"new",
"HtmlPolicyBuilder",
"(",
")",
".",
"allowAttributes",
"(",
"\"src\"",
")",
".",
"onEl... | Sanitizes inputs to out. | [
"Sanitizes",
"inputs",
"to",
"out",
"."
] | a30315fe9a41e19c449628e7ef3488b3a7856009 | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/examples/UrlTextExample.java#L115-L138 | train |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/PolicyFactory.java | PolicyFactory.and | public PolicyFactory and(PolicyFactory f) {
ImmutableMap.Builder<String, ElementAndAttributePolicies> b
= ImmutableMap.builder();
// Merge this and f into a map of element names to attribute policies.
for (Map.Entry<String, ElementAndAttributePolicies> e
: policies.entrySet()) {
String... | java | public PolicyFactory and(PolicyFactory f) {
ImmutableMap.Builder<String, ElementAndAttributePolicies> b
= ImmutableMap.builder();
// Merge this and f into a map of element names to attribute policies.
for (Map.Entry<String, ElementAndAttributePolicies> e
: policies.entrySet()) {
String... | [
"public",
"PolicyFactory",
"and",
"(",
"PolicyFactory",
"f",
")",
"{",
"ImmutableMap",
".",
"Builder",
"<",
"String",
",",
"ElementAndAttributePolicies",
">",
"b",
"=",
"ImmutableMap",
".",
"builder",
"(",
")",
";",
"// Merge this and f into a map of element names to ... | Produces a factory that allows the union of the grants, and intersects
policies where they overlap on a particular granted attribute or element
name. | [
"Produces",
"a",
"factory",
"that",
"allows",
"the",
"union",
"of",
"the",
"grants",
"and",
"intersects",
"policies",
"where",
"they",
"overlap",
"on",
"a",
"particular",
"granted",
"attribute",
"or",
"element",
"name",
"."
] | a30315fe9a41e19c449628e7ef3488b3a7856009 | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/PolicyFactory.java#L142-L214 | train |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/CssGrammar.java | CssGrammar.cssContent | static String cssContent(String token) {
int n = token.length();
int pos = 0;
StringBuilder sb = null;
if (n >= 2) {
char ch0 = token.charAt(0);
if (ch0 == '"' || ch0 == '\'') {
if (ch0 == token.charAt(n - 1)) {
pos = 1;
--n;
sb = new StringBuilder(n);
... | java | static String cssContent(String token) {
int n = token.length();
int pos = 0;
StringBuilder sb = null;
if (n >= 2) {
char ch0 = token.charAt(0);
if (ch0 == '"' || ch0 == '\'') {
if (ch0 == token.charAt(n - 1)) {
pos = 1;
--n;
sb = new StringBuilder(n);
... | [
"static",
"String",
"cssContent",
"(",
"String",
"token",
")",
"{",
"int",
"n",
"=",
"token",
".",
"length",
"(",
")",
";",
"int",
"pos",
"=",
"0",
";",
"StringBuilder",
"sb",
"=",
"null",
";",
"if",
"(",
"n",
">=",
"2",
")",
"{",
"char",
"ch0",
... | Decodes any escape sequences and strips any quotes from the input. | [
"Decodes",
"any",
"escape",
"sequences",
"and",
"strips",
"any",
"quotes",
"from",
"the",
"input",
"."
] | a30315fe9a41e19c449628e7ef3488b3a7856009 | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/CssGrammar.java#L154-L198 | train |
tdunning/t-digest | core/src/main/java/com/tdunning/math/stats/Sort.java | Sort.quickSort | private static void quickSort(int[] order, double[] values, int start, int end, int limit) {
// the while loop implements tail-recursion to avoid excessive stack calls on nasty cases
while (end - start > limit) {
// pivot by a random element
int pivotIndex = start + prng.nextInt... | java | private static void quickSort(int[] order, double[] values, int start, int end, int limit) {
// the while loop implements tail-recursion to avoid excessive stack calls on nasty cases
while (end - start > limit) {
// pivot by a random element
int pivotIndex = start + prng.nextInt... | [
"private",
"static",
"void",
"quickSort",
"(",
"int",
"[",
"]",
"order",
",",
"double",
"[",
"]",
"values",
",",
"int",
"start",
",",
"int",
"end",
",",
"int",
"limit",
")",
"{",
"// the while loop implements tail-recursion to avoid excessive stack calls on nasty ca... | Standard quick sort except that sorting is done on an index array rather than the values themselves
@param order The pre-allocated index array
@param values The values to sort
@param start The beginning of the values to sort
@param end The value after the last value to sort
@param limit The minimum size to recur... | [
"Standard",
"quick",
"sort",
"except",
"that",
"sorting",
"is",
"done",
"on",
"an",
"index",
"array",
"rather",
"than",
"the",
"values",
"themselves"
] | 0820b016fefc1f66fe3b089cec9b4ba220da4ef1 | https://github.com/tdunning/t-digest/blob/0820b016fefc1f66fe3b089cec9b4ba220da4ef1/core/src/main/java/com/tdunning/math/stats/Sort.java#L79-L157 | train |
tdunning/t-digest | core/src/main/java/com/tdunning/math/stats/Sort.java | Sort.quickSort | private static void quickSort(double[] key, double[][] values, int start, int end, int limit) {
// the while loop implements tail-recursion to avoid excessive stack calls on nasty cases
while (end - start > limit) {
// median of three values for the pivot
int a = start;
... | java | private static void quickSort(double[] key, double[][] values, int start, int end, int limit) {
// the while loop implements tail-recursion to avoid excessive stack calls on nasty cases
while (end - start > limit) {
// median of three values for the pivot
int a = start;
... | [
"private",
"static",
"void",
"quickSort",
"(",
"double",
"[",
"]",
"key",
",",
"double",
"[",
"]",
"[",
"]",
"values",
",",
"int",
"start",
",",
"int",
"end",
",",
"int",
"limit",
")",
"{",
"// the while loop implements tail-recursion to avoid excessive stack ca... | Standard quick sort except that sorting rearranges parallel arrays
@param key Values to sort on
@param values The auxilliary values to sort.
@param start The beginning of the values to sort
@param end The value after the last value to sort
@param limit The minimum size to recurse down to. | [
"Standard",
"quick",
"sort",
"except",
"that",
"sorting",
"rearranges",
"parallel",
"arrays"
] | 0820b016fefc1f66fe3b089cec9b4ba220da4ef1 | https://github.com/tdunning/t-digest/blob/0820b016fefc1f66fe3b089cec9b4ba220da4ef1/core/src/main/java/com/tdunning/math/stats/Sort.java#L195-L317 | train |
tdunning/t-digest | core/src/main/java/com/tdunning/math/stats/Sort.java | Sort.insertionSort | @SuppressWarnings("SameParameterValue")
private static void insertionSort(double[] key, double[][] values, int start, int end, int limit) {
// loop invariant: all values start ... i-1 are ordered
for (int i = start + 1; i < end; i++) {
double v = key[i];
int m = Math.max(i - ... | java | @SuppressWarnings("SameParameterValue")
private static void insertionSort(double[] key, double[][] values, int start, int end, int limit) {
// loop invariant: all values start ... i-1 are ordered
for (int i = start + 1; i < end; i++) {
double v = key[i];
int m = Math.max(i - ... | [
"@",
"SuppressWarnings",
"(",
"\"SameParameterValue\"",
")",
"private",
"static",
"void",
"insertionSort",
"(",
"double",
"[",
"]",
"key",
",",
"double",
"[",
"]",
"[",
"]",
"values",
",",
"int",
"start",
",",
"int",
"end",
",",
"int",
"limit",
")",
"{",... | Limited range insertion sort. We assume that no element has to move more than limit steps
because quick sort has done its thing. This version works on parallel arrays of keys and values.
@param key The array of keys
@param values The values we are sorting
@param start The starting point of the sort
@param end ... | [
"Limited",
"range",
"insertion",
"sort",
".",
"We",
"assume",
"that",
"no",
"element",
"has",
"to",
"move",
"more",
"than",
"limit",
"steps",
"because",
"quick",
"sort",
"has",
"done",
"its",
"thing",
".",
"This",
"version",
"works",
"on",
"parallel",
"arr... | 0820b016fefc1f66fe3b089cec9b4ba220da4ef1 | https://github.com/tdunning/t-digest/blob/0820b016fefc1f66fe3b089cec9b4ba220da4ef1/core/src/main/java/com/tdunning/math/stats/Sort.java#L330-L351 | train |
tdunning/t-digest | core/src/main/java/com/tdunning/math/stats/Sort.java | Sort.checkPartition | @SuppressWarnings("UnusedDeclaration")
public static void checkPartition(int[] order, double[] values, double pivotValue, int start, int low, int high, int end) {
if (order.length != values.length) {
throw new IllegalArgumentException("Arguments must be same size");
}
if (!(star... | java | @SuppressWarnings("UnusedDeclaration")
public static void checkPartition(int[] order, double[] values, double pivotValue, int start, int low, int high, int end) {
if (order.length != values.length) {
throw new IllegalArgumentException("Arguments must be same size");
}
if (!(star... | [
"@",
"SuppressWarnings",
"(",
"\"UnusedDeclaration\"",
")",
"public",
"static",
"void",
"checkPartition",
"(",
"int",
"[",
"]",
"order",
",",
"double",
"[",
"]",
"values",
",",
"double",
"pivotValue",
",",
"int",
"start",
",",
"int",
"low",
",",
"int",
"hi... | Check that a partition step was done correctly. For debugging and testing.
@param order The array of indexes representing a permutation of the keys.
@param values The keys to sort.
@param pivotValue The value that splits the data
@param start The beginning of the data of interest.
@param low Valu... | [
"Check",
"that",
"a",
"partition",
"step",
"was",
"done",
"correctly",
".",
"For",
"debugging",
"and",
"testing",
"."
] | 0820b016fefc1f66fe3b089cec9b4ba220da4ef1 | https://github.com/tdunning/t-digest/blob/0820b016fefc1f66fe3b089cec9b4ba220da4ef1/core/src/main/java/com/tdunning/math/stats/Sort.java#L382-L411 | train |
tdunning/t-digest | core/src/main/java/com/tdunning/math/stats/Sort.java | Sort.insertionSort | @SuppressWarnings("SameParameterValue")
private static void insertionSort(int[] order, double[] values, int start, int n, int limit) {
for (int i = start + 1; i < n; i++) {
int t = order[i];
double v = values[order[i]];
int m = Math.max(i - limit, start);
for ... | java | @SuppressWarnings("SameParameterValue")
private static void insertionSort(int[] order, double[] values, int start, int n, int limit) {
for (int i = start + 1; i < n; i++) {
int t = order[i];
double v = values[order[i]];
int m = Math.max(i - limit, start);
for ... | [
"@",
"SuppressWarnings",
"(",
"\"SameParameterValue\"",
")",
"private",
"static",
"void",
"insertionSort",
"(",
"int",
"[",
"]",
"order",
",",
"double",
"[",
"]",
"values",
",",
"int",
"start",
",",
"int",
"n",
",",
"int",
"limit",
")",
"{",
"for",
"(",
... | Limited range insertion sort. We assume that no element has to move more than limit steps
because quick sort has done its thing.
@param order The permutation index
@param values The values we are sorting
@param start Where to start the sort
@param n How many elements to sort
@param limit The largest amount of... | [
"Limited",
"range",
"insertion",
"sort",
".",
"We",
"assume",
"that",
"no",
"element",
"has",
"to",
"move",
"more",
"than",
"limit",
"steps",
"because",
"quick",
"sort",
"has",
"done",
"its",
"thing",
"."
] | 0820b016fefc1f66fe3b089cec9b4ba220da4ef1 | https://github.com/tdunning/t-digest/blob/0820b016fefc1f66fe3b089cec9b4ba220da4ef1/core/src/main/java/com/tdunning/math/stats/Sort.java#L423-L439 | train |
tdunning/t-digest | core/src/main/java/com/tdunning/math/stats/AbstractTDigest.java | AbstractTDigest.quantile | static double quantile(double index, double previousIndex, double nextIndex, double previousMean, double nextMean) {
final double delta = nextIndex - previousIndex;
final double previousWeight = (nextIndex - index) / delta;
final double nextWeight = (index - previousIndex) / delta;
retur... | java | static double quantile(double index, double previousIndex, double nextIndex, double previousMean, double nextMean) {
final double delta = nextIndex - previousIndex;
final double previousWeight = (nextIndex - index) / delta;
final double nextWeight = (index - previousIndex) / delta;
retur... | [
"static",
"double",
"quantile",
"(",
"double",
"index",
",",
"double",
"previousIndex",
",",
"double",
"nextIndex",
",",
"double",
"previousMean",
",",
"double",
"nextMean",
")",
"{",
"final",
"double",
"delta",
"=",
"nextIndex",
"-",
"previousIndex",
";",
"fi... | Computes an interpolated value of a quantile that is between two centroids.
Index is the quantile desired multiplied by the total number of samples - 1.
@param index Denormalized quantile desired
@param previousIndex The denormalized quantile corresponding to the center of the previous centroid.
@pa... | [
"Computes",
"an",
"interpolated",
"value",
"of",
"a",
"quantile",
"that",
"is",
"between",
"two",
"centroids",
"."
] | 0820b016fefc1f66fe3b089cec9b4ba220da4ef1 | https://github.com/tdunning/t-digest/blob/0820b016fefc1f66fe3b089cec9b4ba220da4ef1/core/src/main/java/com/tdunning/math/stats/AbstractTDigest.java#L103-L108 | train |
tdunning/t-digest | core/src/main/java/com/tdunning/math/stats/AVLGroupTree.java | AVLGroupTree.add | public void add(double centroid, int count, List<Double> data) {
this.centroid = centroid;
this.count = count;
this.data = data;
tree.add();
} | java | public void add(double centroid, int count, List<Double> data) {
this.centroid = centroid;
this.count = count;
this.data = data;
tree.add();
} | [
"public",
"void",
"add",
"(",
"double",
"centroid",
",",
"int",
"count",
",",
"List",
"<",
"Double",
">",
"data",
")",
"{",
"this",
".",
"centroid",
"=",
"centroid",
";",
"this",
".",
"count",
"=",
"count",
";",
"this",
".",
"data",
"=",
"data",
";... | Add the provided centroid to the tree. | [
"Add",
"the",
"provided",
"centroid",
"to",
"the",
"tree",
"."
] | 0820b016fefc1f66fe3b089cec9b4ba220da4ef1 | https://github.com/tdunning/t-digest/blob/0820b016fefc1f66fe3b089cec9b4ba220da4ef1/core/src/main/java/com/tdunning/math/stats/AVLGroupTree.java#L154-L159 | train |
tdunning/t-digest | core/src/main/java/com/tdunning/math/stats/AVLGroupTree.java | AVLGroupTree.update | @SuppressWarnings("WeakerAccess")
public void update(int node, double centroid, int count, List<Double> data, boolean forceInPlace) {
if (centroid == centroids[node]||forceInPlace) {
// we prefer to update in place so repeated values don't shuffle around and for merging
centroids[nod... | java | @SuppressWarnings("WeakerAccess")
public void update(int node, double centroid, int count, List<Double> data, boolean forceInPlace) {
if (centroid == centroids[node]||forceInPlace) {
// we prefer to update in place so repeated values don't shuffle around and for merging
centroids[nod... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"void",
"update",
"(",
"int",
"node",
",",
"double",
"centroid",
",",
"int",
"count",
",",
"List",
"<",
"Double",
">",
"data",
",",
"boolean",
"forceInPlace",
")",
"{",
"if",
"(",
"centroid",... | Update values associated with a node, readjusting the tree if necessary. | [
"Update",
"values",
"associated",
"with",
"a",
"node",
"readjusting",
"the",
"tree",
"if",
"necessary",
"."
] | 0820b016fefc1f66fe3b089cec9b4ba220da4ef1 | https://github.com/tdunning/t-digest/blob/0820b016fefc1f66fe3b089cec9b4ba220da4ef1/core/src/main/java/com/tdunning/math/stats/AVLGroupTree.java#L170-L186 | train |
tdunning/t-digest | core/src/main/java/com/tdunning/math/stats/AVLTreeDigest.java | AVLTreeDigest.smallByteSize | @Override
public int smallByteSize() {
int bound = byteSize();
ByteBuffer buf = ByteBuffer.allocate(bound);
asSmallBytes(buf);
return buf.position();
} | java | @Override
public int smallByteSize() {
int bound = byteSize();
ByteBuffer buf = ByteBuffer.allocate(bound);
asSmallBytes(buf);
return buf.position();
} | [
"@",
"Override",
"public",
"int",
"smallByteSize",
"(",
")",
"{",
"int",
"bound",
"=",
"byteSize",
"(",
")",
";",
"ByteBuffer",
"buf",
"=",
"ByteBuffer",
".",
"allocate",
"(",
"bound",
")",
";",
"asSmallBytes",
"(",
"buf",
")",
";",
"return",
"buf",
".... | Returns an upper bound on the number of bytes that will be required to represent this histogram in
the tighter representation. | [
"Returns",
"an",
"upper",
"bound",
"on",
"the",
"number",
"of",
"bytes",
"that",
"will",
"be",
"required",
"to",
"represent",
"this",
"histogram",
"in",
"the",
"tighter",
"representation",
"."
] | 0820b016fefc1f66fe3b089cec9b4ba220da4ef1 | https://github.com/tdunning/t-digest/blob/0820b016fefc1f66fe3b089cec9b4ba220da4ef1/core/src/main/java/com/tdunning/math/stats/AVLTreeDigest.java#L491-L497 | train |
tdunning/t-digest | core/src/main/java/com/tdunning/math/stats/AVLTreeDigest.java | AVLTreeDigest.asBytes | @Override
public void asBytes(ByteBuffer buf) {
buf.putInt(VERBOSE_ENCODING);
buf.putDouble(min);
buf.putDouble(max);
buf.putDouble((float) compression());
buf.putInt(summary.size());
for (Centroid centroid : summary) {
buf.putDouble(centroid.mean());
... | java | @Override
public void asBytes(ByteBuffer buf) {
buf.putInt(VERBOSE_ENCODING);
buf.putDouble(min);
buf.putDouble(max);
buf.putDouble((float) compression());
buf.putInt(summary.size());
for (Centroid centroid : summary) {
buf.putDouble(centroid.mean());
... | [
"@",
"Override",
"public",
"void",
"asBytes",
"(",
"ByteBuffer",
"buf",
")",
"{",
"buf",
".",
"putInt",
"(",
"VERBOSE_ENCODING",
")",
";",
"buf",
".",
"putDouble",
"(",
"min",
")",
";",
"buf",
".",
"putDouble",
"(",
"max",
")",
";",
"buf",
".",
"putD... | Outputs a histogram as bytes using a particularly cheesy encoding. | [
"Outputs",
"a",
"histogram",
"as",
"bytes",
"using",
"a",
"particularly",
"cheesy",
"encoding",
"."
] | 0820b016fefc1f66fe3b089cec9b4ba220da4ef1 | https://github.com/tdunning/t-digest/blob/0820b016fefc1f66fe3b089cec9b4ba220da4ef1/core/src/main/java/com/tdunning/math/stats/AVLTreeDigest.java#L505-L519 | train |
tdunning/t-digest | core/src/main/java/com/tdunning/math/stats/AVLTreeDigest.java | AVLTreeDigest.fromBytes | @SuppressWarnings("WeakerAccess")
public static AVLTreeDigest fromBytes(ByteBuffer buf) {
int encoding = buf.getInt();
if (encoding == VERBOSE_ENCODING) {
double min = buf.getDouble();
double max = buf.getDouble();
double compression = buf.getDouble();
... | java | @SuppressWarnings("WeakerAccess")
public static AVLTreeDigest fromBytes(ByteBuffer buf) {
int encoding = buf.getInt();
if (encoding == VERBOSE_ENCODING) {
double min = buf.getDouble();
double max = buf.getDouble();
double compression = buf.getDouble();
... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"static",
"AVLTreeDigest",
"fromBytes",
"(",
"ByteBuffer",
"buf",
")",
"{",
"int",
"encoding",
"=",
"buf",
".",
"getInt",
"(",
")",
";",
"if",
"(",
"encoding",
"==",
"VERBOSE_ENCODING",
")",
"{... | Reads a histogram from a byte buffer
@param buf The buffer to read from.
@return The new histogram structure | [
"Reads",
"a",
"histogram",
"from",
"a",
"byte",
"buffer"
] | 0820b016fefc1f66fe3b089cec9b4ba220da4ef1 | https://github.com/tdunning/t-digest/blob/0820b016fefc1f66fe3b089cec9b4ba220da4ef1/core/src/main/java/com/tdunning/math/stats/AVLTreeDigest.java#L548-L589 | train |
tdunning/t-digest | core/src/main/java/com/tdunning/math/stats/Comparison.java | Comparison.compareChi2 | @SuppressWarnings("WeakerAccess")
public static double compareChi2(TDigest dist1, TDigest dist2, double[] qCuts) {
double[][] count = new double[2][];
count[0] = new double[qCuts.length + 1];
count[1] = new double[qCuts.length + 1];
double oldQ = 0;
double oldQ2 = 0;
... | java | @SuppressWarnings("WeakerAccess")
public static double compareChi2(TDigest dist1, TDigest dist2, double[] qCuts) {
double[][] count = new double[2][];
count[0] = new double[qCuts.length + 1];
count[1] = new double[qCuts.length + 1];
double oldQ = 0;
double oldQ2 = 0;
... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"static",
"double",
"compareChi2",
"(",
"TDigest",
"dist1",
",",
"TDigest",
"dist2",
",",
"double",
"[",
"]",
"qCuts",
")",
"{",
"double",
"[",
"]",
"[",
"]",
"count",
"=",
"new",
"double",
... | Use a log-likelihood ratio test to compare two distributions.
This is done by estimating counts in quantile ranges from each
distribution and then comparing those counts using a multinomial
test. The result should be asymptotically chi^2 distributed if
the data comes from the same distribution, but this isn't so
much u... | [
"Use",
"a",
"log",
"-",
"likelihood",
"ratio",
"test",
"to",
"compare",
"two",
"distributions",
".",
"This",
"is",
"done",
"by",
"estimating",
"counts",
"in",
"quantile",
"ranges",
"from",
"each",
"distribution",
"and",
"then",
"comparing",
"those",
"counts",
... | 0820b016fefc1f66fe3b089cec9b4ba220da4ef1 | https://github.com/tdunning/t-digest/blob/0820b016fefc1f66fe3b089cec9b4ba220da4ef1/core/src/main/java/com/tdunning/math/stats/Comparison.java#L48-L75 | train |
tdunning/t-digest | core/src/main/java/com/tdunning/math/stats/IntAVLTree.java | IntAVLTree.find | public int find() {
for (int node = root; node != NIL; ) {
final int cmp = compare(node);
if (cmp < 0) {
node = left(node);
} else if (cmp > 0) {
node = right(node);
} else {
return node;
}
}
... | java | public int find() {
for (int node = root; node != NIL; ) {
final int cmp = compare(node);
if (cmp < 0) {
node = left(node);
} else if (cmp > 0) {
node = right(node);
} else {
return node;
}
}
... | [
"public",
"int",
"find",
"(",
")",
"{",
"for",
"(",
"int",
"node",
"=",
"root",
";",
"node",
"!=",
"NIL",
";",
")",
"{",
"final",
"int",
"cmp",
"=",
"compare",
"(",
"node",
")",
";",
"if",
"(",
"cmp",
"<",
"0",
")",
"{",
"node",
"=",
"left",
... | Find a node in this tree. | [
"Find",
"a",
"node",
"in",
"this",
"tree",
"."
] | 0820b016fefc1f66fe3b089cec9b4ba220da4ef1 | https://github.com/tdunning/t-digest/blob/0820b016fefc1f66fe3b089cec9b4ba220da4ef1/core/src/main/java/com/tdunning/math/stats/IntAVLTree.java#L255-L267 | train |
tdunning/t-digest | core/src/main/java/com/tdunning/math/stats/IntAVLTree.java | IntAVLTree.remove | public void remove(int node) {
if (node == NIL) {
throw new IllegalArgumentException();
}
if (left(node) != NIL && right(node) != NIL) {
// inner node
final int next = next(node);
assert next != NIL;
swap(node, next);
}
... | java | public void remove(int node) {
if (node == NIL) {
throw new IllegalArgumentException();
}
if (left(node) != NIL && right(node) != NIL) {
// inner node
final int next = next(node);
assert next != NIL;
swap(node, next);
}
... | [
"public",
"void",
"remove",
"(",
"int",
"node",
")",
"{",
"if",
"(",
"node",
"==",
"NIL",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"if",
"(",
"left",
"(",
"node",
")",
"!=",
"NIL",
"&&",
"right",
"(",
"node",
")",
... | Remove the specified node from the tree. | [
"Remove",
"the",
"specified",
"node",
"from",
"the",
"tree",
"."
] | 0820b016fefc1f66fe3b089cec9b4ba220da4ef1 | https://github.com/tdunning/t-digest/blob/0820b016fefc1f66fe3b089cec9b4ba220da4ef1/core/src/main/java/com/tdunning/math/stats/IntAVLTree.java#L292-L339 | train |
citrusframework/citrus | modules/citrus-jms/src/main/java/com/consol/citrus/jms/message/JmsMessage.java | JmsMessage.getMessageId | public String getMessageId() {
Object messageId = getHeader(JmsMessageHeaders.MESSAGE_ID);
if (messageId != null) {
return messageId.toString();
}
return null;
} | java | public String getMessageId() {
Object messageId = getHeader(JmsMessageHeaders.MESSAGE_ID);
if (messageId != null) {
return messageId.toString();
}
return null;
} | [
"public",
"String",
"getMessageId",
"(",
")",
"{",
"Object",
"messageId",
"=",
"getHeader",
"(",
"JmsMessageHeaders",
".",
"MESSAGE_ID",
")",
";",
"if",
"(",
"messageId",
"!=",
"null",
")",
"{",
"return",
"messageId",
".",
"toString",
"(",
")",
";",
"}",
... | Gets the JMS messageId header.
@return | [
"Gets",
"the",
"JMS",
"messageId",
"header",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-jms/src/main/java/com/consol/citrus/jms/message/JmsMessage.java#L111-L119 | train |
citrusframework/citrus | modules/citrus-jms/src/main/java/com/consol/citrus/jms/message/JmsMessage.java | JmsMessage.getCorrelationId | public String getCorrelationId() {
Object correlationId = getHeader(JmsMessageHeaders.CORRELATION_ID);
if (correlationId != null) {
return correlationId.toString();
}
return null;
} | java | public String getCorrelationId() {
Object correlationId = getHeader(JmsMessageHeaders.CORRELATION_ID);
if (correlationId != null) {
return correlationId.toString();
}
return null;
} | [
"public",
"String",
"getCorrelationId",
"(",
")",
"{",
"Object",
"correlationId",
"=",
"getHeader",
"(",
"JmsMessageHeaders",
".",
"CORRELATION_ID",
")",
";",
"if",
"(",
"correlationId",
"!=",
"null",
")",
"{",
"return",
"correlationId",
".",
"toString",
"(",
... | Gets the JMS correlationId header.
@return | [
"Gets",
"the",
"JMS",
"correlationId",
"header",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-jms/src/main/java/com/consol/citrus/jms/message/JmsMessage.java#L139-L147 | train |
citrusframework/citrus | modules/citrus-jms/src/main/java/com/consol/citrus/jms/message/JmsMessage.java | JmsMessage.getReplyTo | public Destination getReplyTo() {
Object replyTo = getHeader(JmsMessageHeaders.REPLY_TO);
if (replyTo != null) {
return (Destination) replyTo;
}
return null;
} | java | public Destination getReplyTo() {
Object replyTo = getHeader(JmsMessageHeaders.REPLY_TO);
if (replyTo != null) {
return (Destination) replyTo;
}
return null;
} | [
"public",
"Destination",
"getReplyTo",
"(",
")",
"{",
"Object",
"replyTo",
"=",
"getHeader",
"(",
"JmsMessageHeaders",
".",
"REPLY_TO",
")",
";",
"if",
"(",
"replyTo",
"!=",
"null",
")",
"{",
"return",
"(",
"Destination",
")",
"replyTo",
";",
"}",
"return"... | Gets the JMS reply to header.
@return | [
"Gets",
"the",
"JMS",
"reply",
"to",
"header",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-jms/src/main/java/com/consol/citrus/jms/message/JmsMessage.java#L153-L161 | train |
citrusframework/citrus | modules/citrus-jms/src/main/java/com/consol/citrus/jms/message/JmsMessage.java | JmsMessage.getRedelivered | public String getRedelivered() {
Object redelivered = getHeader(JmsMessageHeaders.REDELIVERED);
if (redelivered != null) {
return redelivered.toString();
}
return null;
} | java | public String getRedelivered() {
Object redelivered = getHeader(JmsMessageHeaders.REDELIVERED);
if (redelivered != null) {
return redelivered.toString();
}
return null;
} | [
"public",
"String",
"getRedelivered",
"(",
")",
"{",
"Object",
"redelivered",
"=",
"getHeader",
"(",
"JmsMessageHeaders",
".",
"REDELIVERED",
")",
";",
"if",
"(",
"redelivered",
"!=",
"null",
")",
"{",
"return",
"redelivered",
".",
"toString",
"(",
")",
";",... | Gets the JMS redelivered header.
@return | [
"Gets",
"the",
"JMS",
"redelivered",
"header",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-jms/src/main/java/com/consol/citrus/jms/message/JmsMessage.java#L167-L175 | train |
citrusframework/citrus | modules/citrus-jms/src/main/java/com/consol/citrus/jms/message/JmsMessage.java | JmsMessage.getType | public String getType() {
Object type = getHeader(JmsMessageHeaders.TYPE);
if (type != null) {
return type.toString();
}
return null;
} | java | public String getType() {
Object type = getHeader(JmsMessageHeaders.TYPE);
if (type != null) {
return type.toString();
}
return null;
} | [
"public",
"String",
"getType",
"(",
")",
"{",
"Object",
"type",
"=",
"getHeader",
"(",
"JmsMessageHeaders",
".",
"TYPE",
")",
";",
"if",
"(",
"type",
"!=",
"null",
")",
"{",
"return",
"type",
".",
"toString",
"(",
")",
";",
"}",
"return",
"null",
";"... | Gets the JMS type header.
@return | [
"Gets",
"the",
"JMS",
"type",
"header",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-jms/src/main/java/com/consol/citrus/jms/message/JmsMessage.java#L181-L189 | train |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/validation/json/JsonTextMessageValidator.java | JsonTextMessageValidator.performSchemaValidation | private void performSchemaValidation(Message receivedMessage, JsonMessageValidationContext validationContext) {
log.debug("Starting Json schema validation ...");
ProcessingReport report = jsonSchemaValidation.validate(receivedMessage,
sche... | java | private void performSchemaValidation(Message receivedMessage, JsonMessageValidationContext validationContext) {
log.debug("Starting Json schema validation ...");
ProcessingReport report = jsonSchemaValidation.validate(receivedMessage,
sche... | [
"private",
"void",
"performSchemaValidation",
"(",
"Message",
"receivedMessage",
",",
"JsonMessageValidationContext",
"validationContext",
")",
"{",
"log",
".",
"debug",
"(",
"\"Starting Json schema validation ...\"",
")",
";",
"ProcessingReport",
"report",
"=",
"jsonSchema... | Performs the schema validation for the given message under consideration of the given validation context
@param receivedMessage The message to be validated
@param validationContext The validation context of the current test | [
"Performs",
"the",
"schema",
"validation",
"for",
"the",
"given",
"message",
"under",
"consideration",
"of",
"the",
"given",
"validation",
"context"
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/validation/json/JsonTextMessageValidator.java#L140-L154 | train |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/validation/json/JsonTextMessageValidator.java | JsonTextMessageValidator.constructErrorMessage | private String constructErrorMessage(ProcessingReport report) {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("Json validation failed: ");
report.forEach(processingMessage -> stringBuilder.append(processingMessage.getMessage()));
return stringBuilder.toString();... | java | private String constructErrorMessage(ProcessingReport report) {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("Json validation failed: ");
report.forEach(processingMessage -> stringBuilder.append(processingMessage.getMessage()));
return stringBuilder.toString();... | [
"private",
"String",
"constructErrorMessage",
"(",
"ProcessingReport",
"report",
")",
"{",
"StringBuilder",
"stringBuilder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"stringBuilder",
".",
"append",
"(",
"\"Json validation failed: \"",
")",
";",
"report",
".",
"fo... | Constructs the error message of a failed validation based on the processing report passed from
com.github.fge.jsonschema.core.report
@param report The report containing the error message
@return A string representation of all messages contained in the report | [
"Constructs",
"the",
"error",
"message",
"of",
"a",
"failed",
"validation",
"based",
"on",
"the",
"processing",
"report",
"passed",
"from",
"com",
".",
"github",
".",
"fge",
".",
"jsonschema",
".",
"core",
".",
"report"
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/validation/json/JsonTextMessageValidator.java#L348-L353 | train |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/message/MessageHeaderUtils.java | MessageHeaderUtils.isSpringInternalHeader | public static boolean isSpringInternalHeader(String headerName) {
// "springintegration_" makes Citrus work with Spring Integration 1.x release
if (headerName.startsWith("springintegration_")) {
return true;
} else if (headerName.equals(MessageHeaders.ID)) {
return true;
... | java | public static boolean isSpringInternalHeader(String headerName) {
// "springintegration_" makes Citrus work with Spring Integration 1.x release
if (headerName.startsWith("springintegration_")) {
return true;
} else if (headerName.equals(MessageHeaders.ID)) {
return true;
... | [
"public",
"static",
"boolean",
"isSpringInternalHeader",
"(",
"String",
"headerName",
")",
"{",
"// \"springintegration_\" makes Citrus work with Spring Integration 1.x release",
"if",
"(",
"headerName",
".",
"startsWith",
"(",
"\"springintegration_\"",
")",
")",
"{",
"return... | Check if given header name belongs to Spring Integration internal headers.
This is given if header name starts with internal header prefix or
matches one of Spring's internal header names.
@param headerName
@return | [
"Check",
"if",
"given",
"header",
"name",
"belongs",
"to",
"Spring",
"Integration",
"internal",
"headers",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/message/MessageHeaderUtils.java#L45-L80 | train |
citrusframework/citrus | modules/citrus-ws/src/main/java/com/consol/citrus/ws/config/xml/SoapAttachmentParser.java | SoapAttachmentParser.parseAttachment | public static SoapAttachment parseAttachment(Element attachmentElement) {
SoapAttachment soapAttachment = new SoapAttachment();
if (attachmentElement.hasAttribute("content-id")) {
soapAttachment.setContentId(attachmentElement.getAttribute("content-id"));
}
if (attachmentEle... | java | public static SoapAttachment parseAttachment(Element attachmentElement) {
SoapAttachment soapAttachment = new SoapAttachment();
if (attachmentElement.hasAttribute("content-id")) {
soapAttachment.setContentId(attachmentElement.getAttribute("content-id"));
}
if (attachmentEle... | [
"public",
"static",
"SoapAttachment",
"parseAttachment",
"(",
"Element",
"attachmentElement",
")",
"{",
"SoapAttachment",
"soapAttachment",
"=",
"new",
"SoapAttachment",
"(",
")",
";",
"if",
"(",
"attachmentElement",
".",
"hasAttribute",
"(",
"\"content-id\"",
")",
... | Parse the attachment element with all children and attributes.
@param attachmentElement | [
"Parse",
"the",
"attachment",
"element",
"with",
"all",
"children",
"and",
"attributes",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-ws/src/main/java/com/consol/citrus/ws/config/xml/SoapAttachmentParser.java#L40-L74 | train |
citrusframework/citrus | modules/citrus-jmx/src/main/java/com/consol/citrus/jmx/model/ManagedBeanDefinition.java | ManagedBeanDefinition.createObjectName | public ObjectName createObjectName() {
try {
if (StringUtils.hasText(objectName)) {
return new ObjectName(objectDomain + ":" + objectName);
}
if (type != null) {
if (StringUtils.hasText(objectDomain)) {
return new ObjectNam... | java | public ObjectName createObjectName() {
try {
if (StringUtils.hasText(objectName)) {
return new ObjectName(objectDomain + ":" + objectName);
}
if (type != null) {
if (StringUtils.hasText(objectDomain)) {
return new ObjectNam... | [
"public",
"ObjectName",
"createObjectName",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"StringUtils",
".",
"hasText",
"(",
"objectName",
")",
")",
"{",
"return",
"new",
"ObjectName",
"(",
"objectDomain",
"+",
"\":\"",
"+",
"objectName",
")",
";",
"}",
"if",
"... | Constructs proper object name either from given domain and name property or
by evaluating the mbean type class information.
@return | [
"Constructs",
"proper",
"object",
"name",
"either",
"from",
"given",
"domain",
"and",
"name",
"property",
"or",
"by",
"evaluating",
"the",
"mbean",
"type",
"class",
"information",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-jmx/src/main/java/com/consol/citrus/jmx/model/ManagedBeanDefinition.java#L51-L69 | train |
citrusframework/citrus | modules/citrus-jmx/src/main/java/com/consol/citrus/jmx/model/ManagedBeanDefinition.java | ManagedBeanDefinition.createMBeanInfo | public MBeanInfo createMBeanInfo() {
if (type != null) {
return new MBeanInfo(type.getName(), description, getAttributeInfo(), getConstructorInfo(), getOperationInfo(), getNotificationInfo());
} else {
return new MBeanInfo(name, description, getAttributeInfo(), getConstructorInfo... | java | public MBeanInfo createMBeanInfo() {
if (type != null) {
return new MBeanInfo(type.getName(), description, getAttributeInfo(), getConstructorInfo(), getOperationInfo(), getNotificationInfo());
} else {
return new MBeanInfo(name, description, getAttributeInfo(), getConstructorInfo... | [
"public",
"MBeanInfo",
"createMBeanInfo",
"(",
")",
"{",
"if",
"(",
"type",
"!=",
"null",
")",
"{",
"return",
"new",
"MBeanInfo",
"(",
"type",
".",
"getName",
"(",
")",
",",
"description",
",",
"getAttributeInfo",
"(",
")",
",",
"getConstructorInfo",
"(",
... | Create managed bean info with all constructors, operations, notifications and attributes.
@return | [
"Create",
"managed",
"bean",
"info",
"with",
"all",
"constructors",
"operations",
"notifications",
"and",
"attributes",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-jmx/src/main/java/com/consol/citrus/jmx/model/ManagedBeanDefinition.java#L75-L81 | train |
citrusframework/citrus | modules/citrus-jmx/src/main/java/com/consol/citrus/jmx/model/ManagedBeanDefinition.java | ManagedBeanDefinition.getOperationInfo | private MBeanOperationInfo[] getOperationInfo() {
final List<MBeanOperationInfo> infoList = new ArrayList<>();
if (type != null) {
ReflectionUtils.doWithMethods(type, new ReflectionUtils.MethodCallback() {
@Override
public void doWith(Method method) throws Il... | java | private MBeanOperationInfo[] getOperationInfo() {
final List<MBeanOperationInfo> infoList = new ArrayList<>();
if (type != null) {
ReflectionUtils.doWithMethods(type, new ReflectionUtils.MethodCallback() {
@Override
public void doWith(Method method) throws Il... | [
"private",
"MBeanOperationInfo",
"[",
"]",
"getOperationInfo",
"(",
")",
"{",
"final",
"List",
"<",
"MBeanOperationInfo",
">",
"infoList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"if",
"(",
"type",
"!=",
"null",
")",
"{",
"ReflectionUtils",
".",
"doW... | Create this managed bean operations info.
@return | [
"Create",
"this",
"managed",
"bean",
"operations",
"info",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-jmx/src/main/java/com/consol/citrus/jmx/model/ManagedBeanDefinition.java#L95-L128 | train |
citrusframework/citrus | modules/citrus-jmx/src/main/java/com/consol/citrus/jmx/model/ManagedBeanDefinition.java | ManagedBeanDefinition.getConstructorInfo | private MBeanConstructorInfo[] getConstructorInfo() {
final List<MBeanConstructorInfo> infoList = new ArrayList<>();
if (type != null) {
for (Constructor constructor : type.getConstructors()) {
infoList.add(new MBeanConstructorInfo(constructor.toGenericString(), constructor)... | java | private MBeanConstructorInfo[] getConstructorInfo() {
final List<MBeanConstructorInfo> infoList = new ArrayList<>();
if (type != null) {
for (Constructor constructor : type.getConstructors()) {
infoList.add(new MBeanConstructorInfo(constructor.toGenericString(), constructor)... | [
"private",
"MBeanConstructorInfo",
"[",
"]",
"getConstructorInfo",
"(",
")",
"{",
"final",
"List",
"<",
"MBeanConstructorInfo",
">",
"infoList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"if",
"(",
"type",
"!=",
"null",
")",
"{",
"for",
"(",
"Construct... | Create this managed bean constructor info.
@return | [
"Create",
"this",
"managed",
"bean",
"constructor",
"info",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-jmx/src/main/java/com/consol/citrus/jmx/model/ManagedBeanDefinition.java#L134-L144 | train |
citrusframework/citrus | modules/citrus-jmx/src/main/java/com/consol/citrus/jmx/model/ManagedBeanDefinition.java | ManagedBeanDefinition.getAttributeInfo | private MBeanAttributeInfo[] getAttributeInfo() {
final List<MBeanAttributeInfo> infoList = new ArrayList<>();
if (type != null) {
final List<String> attributes = new ArrayList<>();
if (type.isInterface()) {
ReflectionUtils.doWithMethods(type, new ReflectionUtil... | java | private MBeanAttributeInfo[] getAttributeInfo() {
final List<MBeanAttributeInfo> infoList = new ArrayList<>();
if (type != null) {
final List<String> attributes = new ArrayList<>();
if (type.isInterface()) {
ReflectionUtils.doWithMethods(type, new ReflectionUtil... | [
"private",
"MBeanAttributeInfo",
"[",
"]",
"getAttributeInfo",
"(",
")",
"{",
"final",
"List",
"<",
"MBeanAttributeInfo",
">",
"infoList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"if",
"(",
"type",
"!=",
"null",
")",
"{",
"final",
"List",
"<",
"Str... | Create this managed bean attributes info.
@return | [
"Create",
"this",
"managed",
"bean",
"attributes",
"info",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-jmx/src/main/java/com/consol/citrus/jmx/model/ManagedBeanDefinition.java#L150-L202 | train |
citrusframework/citrus | modules/citrus-http/src/main/java/com/consol/citrus/http/servlet/GzipHttpServletResponseWrapper.java | GzipHttpServletResponseWrapper.finish | public void finish() throws IOException {
if (printWriter != null) {
printWriter.close();
}
if (outputStream != null) {
outputStream.close();
}
} | java | public void finish() throws IOException {
if (printWriter != null) {
printWriter.close();
}
if (outputStream != null) {
outputStream.close();
}
} | [
"public",
"void",
"finish",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"printWriter",
"!=",
"null",
")",
"{",
"printWriter",
".",
"close",
"(",
")",
";",
"}",
"if",
"(",
"outputStream",
"!=",
"null",
")",
"{",
"outputStream",
".",
"close",
"(",... | Finish response stream by closing.
@throws IOException | [
"Finish",
"response",
"stream",
"by",
"closing",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-http/src/main/java/com/consol/citrus/http/servlet/GzipHttpServletResponseWrapper.java#L56-L64 | train |
citrusframework/citrus | modules/citrus-websocket/src/main/java/com/consol/citrus/websocket/handler/WebSocketUrlHandlerMapping.java | WebSocketUrlHandlerMapping.postRegisterUrlHandlers | public void postRegisterUrlHandlers(Map<String, Object> wsHandlers) {
registerHandlers(wsHandlers);
for (Object handler : wsHandlers.values()) {
if (handler instanceof Lifecycle) {
((Lifecycle) handler).start();
}
}
} | java | public void postRegisterUrlHandlers(Map<String, Object> wsHandlers) {
registerHandlers(wsHandlers);
for (Object handler : wsHandlers.values()) {
if (handler instanceof Lifecycle) {
((Lifecycle) handler).start();
}
}
} | [
"public",
"void",
"postRegisterUrlHandlers",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"wsHandlers",
")",
"{",
"registerHandlers",
"(",
"wsHandlers",
")",
";",
"for",
"(",
"Object",
"handler",
":",
"wsHandlers",
".",
"values",
"(",
")",
")",
"{",
"if"... | Workaround for registering the WebSocket request handlers, after the spring context has been
initialised.
@param wsHandlers | [
"Workaround",
"for",
"registering",
"the",
"WebSocket",
"request",
"handlers",
"after",
"the",
"spring",
"context",
"has",
"been",
"initialised",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-websocket/src/main/java/com/consol/citrus/websocket/handler/WebSocketUrlHandlerMapping.java#L36-L44 | train |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/config/xml/AbstractMessageActionParser.java | AbstractMessageActionParser.constructMessageBuilder | public AbstractMessageContentBuilder constructMessageBuilder(Element messageElement) {
AbstractMessageContentBuilder messageBuilder = null;
if (messageElement != null) {
messageBuilder = parsePayloadTemplateBuilder(messageElement);
if (messageBuilder == null... | java | public AbstractMessageContentBuilder constructMessageBuilder(Element messageElement) {
AbstractMessageContentBuilder messageBuilder = null;
if (messageElement != null) {
messageBuilder = parsePayloadTemplateBuilder(messageElement);
if (messageBuilder == null... | [
"public",
"AbstractMessageContentBuilder",
"constructMessageBuilder",
"(",
"Element",
"messageElement",
")",
"{",
"AbstractMessageContentBuilder",
"messageBuilder",
"=",
"null",
";",
"if",
"(",
"messageElement",
"!=",
"null",
")",
"{",
"messageBuilder",
"=",
"parsePayload... | Static parse method taking care of basic message element parsing.
@param messageElement | [
"Static",
"parse",
"method",
"taking",
"care",
"of",
"basic",
"message",
"element",
"parsing",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/config/xml/AbstractMessageActionParser.java#L51-L71 | train |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/config/xml/AbstractMessageActionParser.java | AbstractMessageActionParser.parsePayloadTemplateBuilder | private PayloadTemplateMessageBuilder parsePayloadTemplateBuilder(Element messageElement) {
PayloadTemplateMessageBuilder messageBuilder;
messageBuilder = parsePayloadElement(messageElement);
Element xmlDataElement = DomUtils.getChildElementByTagName(messageElement, "data");
... | java | private PayloadTemplateMessageBuilder parsePayloadTemplateBuilder(Element messageElement) {
PayloadTemplateMessageBuilder messageBuilder;
messageBuilder = parsePayloadElement(messageElement);
Element xmlDataElement = DomUtils.getChildElementByTagName(messageElement, "data");
... | [
"private",
"PayloadTemplateMessageBuilder",
"parsePayloadTemplateBuilder",
"(",
"Element",
"messageElement",
")",
"{",
"PayloadTemplateMessageBuilder",
"messageBuilder",
";",
"messageBuilder",
"=",
"parsePayloadElement",
"(",
"messageElement",
")",
";",
"Element",
"xmlDataEleme... | Parses message payload template information given in message element.
@param messageElement | [
"Parses",
"message",
"payload",
"template",
"information",
"given",
"in",
"message",
"element",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/config/xml/AbstractMessageActionParser.java#L115-L162 | train |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/config/xml/AbstractMessageActionParser.java | AbstractMessageActionParser.parseHeaderElements | protected void parseHeaderElements(Element actionElement, AbstractMessageContentBuilder messageBuilder, List<ValidationContext> validationContexts) {
Element headerElement = DomUtils.getChildElementByTagName(actionElement, "header");
Map<String, Object> messageHeaders = new LinkedHashMap<>();
i... | java | protected void parseHeaderElements(Element actionElement, AbstractMessageContentBuilder messageBuilder, List<ValidationContext> validationContexts) {
Element headerElement = DomUtils.getChildElementByTagName(actionElement, "header");
Map<String, Object> messageHeaders = new LinkedHashMap<>();
i... | [
"protected",
"void",
"parseHeaderElements",
"(",
"Element",
"actionElement",
",",
"AbstractMessageContentBuilder",
"messageBuilder",
",",
"List",
"<",
"ValidationContext",
">",
"validationContexts",
")",
"{",
"Element",
"headerElement",
"=",
"DomUtils",
".",
"getChildElem... | Parse message header elements in action and add headers to
message content builder.
@param actionElement the action DOM element.
@param messageBuilder the message content builder.
@param validationContexts list of validation contexts. | [
"Parse",
"message",
"header",
"elements",
"in",
"action",
"and",
"add",
"headers",
"to",
"message",
"content",
"builder",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/config/xml/AbstractMessageActionParser.java#L199-L248 | train |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/config/xml/AbstractMessageActionParser.java | AbstractMessageActionParser.parseExtractHeaderElements | protected void parseExtractHeaderElements(Element element, List<VariableExtractor> variableExtractors) {
Element extractElement = DomUtils.getChildElementByTagName(element, "extract");
Map<String, String> extractHeaderValues = new HashMap<>();
if (extractElement != null) {
List<?> he... | java | protected void parseExtractHeaderElements(Element element, List<VariableExtractor> variableExtractors) {
Element extractElement = DomUtils.getChildElementByTagName(element, "extract");
Map<String, String> extractHeaderValues = new HashMap<>();
if (extractElement != null) {
List<?> he... | [
"protected",
"void",
"parseExtractHeaderElements",
"(",
"Element",
"element",
",",
"List",
"<",
"VariableExtractor",
">",
"variableExtractors",
")",
"{",
"Element",
"extractElement",
"=",
"DomUtils",
".",
"getChildElementByTagName",
"(",
"element",
",",
"\"extract\"",
... | Parses header extract information.
@param element the root action element.
@param variableExtractors the variable extractors to add new extractors to. | [
"Parses",
"header",
"extract",
"information",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/config/xml/AbstractMessageActionParser.java#L255-L272 | train |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/validation/script/TemplateBasedScriptBuilder.java | TemplateBasedScriptBuilder.build | public String build() {
StringBuilder scriptBuilder = new StringBuilder();
StringBuilder scriptBody = new StringBuilder();
String importStmt = "import ";
try {
if (scriptCode.contains(importStmt)) {
BufferedReader reader = new BufferedReader(new Strin... | java | public String build() {
StringBuilder scriptBuilder = new StringBuilder();
StringBuilder scriptBody = new StringBuilder();
String importStmt = "import ";
try {
if (scriptCode.contains(importStmt)) {
BufferedReader reader = new BufferedReader(new Strin... | [
"public",
"String",
"build",
"(",
")",
"{",
"StringBuilder",
"scriptBuilder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"StringBuilder",
"scriptBody",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"String",
"importStmt",
"=",
"\"import \"",
";",
"try",
"{",
... | Builds the final script. | [
"Builds",
"the",
"final",
"script",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/validation/script/TemplateBasedScriptBuilder.java#L60-L90 | train |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/validation/script/TemplateBasedScriptBuilder.java | TemplateBasedScriptBuilder.fromTemplateResource | public static TemplateBasedScriptBuilder fromTemplateResource(Resource scriptTemplateResource) {
try {
return new TemplateBasedScriptBuilder(FileUtils.readToString(scriptTemplateResource.getInputStream()));
} catch (IOException e) {
throw new CitrusRuntimeException("Error loading... | java | public static TemplateBasedScriptBuilder fromTemplateResource(Resource scriptTemplateResource) {
try {
return new TemplateBasedScriptBuilder(FileUtils.readToString(scriptTemplateResource.getInputStream()));
} catch (IOException e) {
throw new CitrusRuntimeException("Error loading... | [
"public",
"static",
"TemplateBasedScriptBuilder",
"fromTemplateResource",
"(",
"Resource",
"scriptTemplateResource",
")",
"{",
"try",
"{",
"return",
"new",
"TemplateBasedScriptBuilder",
"(",
"FileUtils",
".",
"readToString",
"(",
"scriptTemplateResource",
".",
"getInputStre... | Static construction method returning a fully qualified instance of this builder.
@param scriptTemplateResource external file resource holding script template code.
@return instance of this builder. | [
"Static",
"construction",
"method",
"returning",
"a",
"fully",
"qualified",
"instance",
"of",
"this",
"builder",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/validation/script/TemplateBasedScriptBuilder.java#L117-L123 | train |
citrusframework/citrus | modules/citrus-http/src/main/java/com/consol/citrus/http/controller/HttpMessageController.java | HttpMessageController.handleRequestInternal | private ResponseEntity<?> handleRequestInternal(HttpMethod method, HttpEntity<?> requestEntity) {
HttpMessage request = endpointConfiguration.getMessageConverter().convertInbound(requestEntity, endpointConfiguration, null);
HttpServletRequest servletRequest = ((ServletRequestAttributes) RequestContextH... | java | private ResponseEntity<?> handleRequestInternal(HttpMethod method, HttpEntity<?> requestEntity) {
HttpMessage request = endpointConfiguration.getMessageConverter().convertInbound(requestEntity, endpointConfiguration, null);
HttpServletRequest servletRequest = ((ServletRequestAttributes) RequestContextH... | [
"private",
"ResponseEntity",
"<",
"?",
">",
"handleRequestInternal",
"(",
"HttpMethod",
"method",
",",
"HttpEntity",
"<",
"?",
">",
"requestEntity",
")",
"{",
"HttpMessage",
"request",
"=",
"endpointConfiguration",
".",
"getMessageConverter",
"(",
")",
".",
"conve... | Handles requests with endpoint adapter implementation. Previously sets Http request method as header parameter.
@param method
@param requestEntity
@return | [
"Handles",
"requests",
"with",
"endpoint",
"adapter",
"implementation",
".",
"Previously",
"sets",
"Http",
"request",
"method",
"as",
"header",
"parameter",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-http/src/main/java/com/consol/citrus/http/controller/HttpMessageController.java#L110-L175 | train |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/validation/builder/AbstractMessageContentBuilder.java | AbstractMessageContentBuilder.buildMessageContent | @Override
public Message buildMessageContent(
final TestContext context,
final String messageType,
final MessageDirection direction) {
final Object payload = buildMessagePayload(context, messageType);
try {
Message message = new DefaultMessage(payload... | java | @Override
public Message buildMessageContent(
final TestContext context,
final String messageType,
final MessageDirection direction) {
final Object payload = buildMessagePayload(context, messageType);
try {
Message message = new DefaultMessage(payload... | [
"@",
"Override",
"public",
"Message",
"buildMessageContent",
"(",
"final",
"TestContext",
"context",
",",
"final",
"String",
"messageType",
",",
"final",
"MessageDirection",
"direction",
")",
"{",
"final",
"Object",
"payload",
"=",
"buildMessagePayload",
"(",
"conte... | Constructs the control message with headers and payload coming from
subclass implementation. | [
"Constructs",
"the",
"control",
"message",
"with",
"headers",
"and",
"payload",
"coming",
"from",
"subclass",
"implementation",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/validation/builder/AbstractMessageContentBuilder.java#L68-L110 | train |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/validation/builder/AbstractMessageContentBuilder.java | AbstractMessageContentBuilder.buildMessageHeaders | public Map<String, Object> buildMessageHeaders(final TestContext context, final String messageType) {
try {
final Map<String, Object> headers = context.resolveDynamicValuesInMap(messageHeaders);
headers.put(MessageHeaders.MESSAGE_TYPE, messageType);
for (final Map.Entry<Stri... | java | public Map<String, Object> buildMessageHeaders(final TestContext context, final String messageType) {
try {
final Map<String, Object> headers = context.resolveDynamicValuesInMap(messageHeaders);
headers.put(MessageHeaders.MESSAGE_TYPE, messageType);
for (final Map.Entry<Stri... | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"buildMessageHeaders",
"(",
"final",
"TestContext",
"context",
",",
"final",
"String",
"messageType",
")",
"{",
"try",
"{",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"headers",
"=",
"context",
".... | Build message headers.
@param context The test context of the message
@param messageType The message type of the Message
@return A Map containing all headers as key value pairs | [
"Build",
"message",
"headers",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/validation/builder/AbstractMessageContentBuilder.java#L126-L149 | train |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/validation/builder/AbstractMessageContentBuilder.java | AbstractMessageContentBuilder.buildMessageHeaderData | public List<String> buildMessageHeaderData(final TestContext context) {
final List<String> headerDataList = new ArrayList<>();
for (final String headerResourcePath : headerResources) {
try {
headerDataList.add(
context.replaceDynamicContentInString(
... | java | public List<String> buildMessageHeaderData(final TestContext context) {
final List<String> headerDataList = new ArrayList<>();
for (final String headerResourcePath : headerResources) {
try {
headerDataList.add(
context.replaceDynamicContentInString(
... | [
"public",
"List",
"<",
"String",
">",
"buildMessageHeaderData",
"(",
"final",
"TestContext",
"context",
")",
"{",
"final",
"List",
"<",
"String",
">",
"headerDataList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"final",
"String",
"headerResou... | Build message header data.
@param context
@return | [
"Build",
"message",
"header",
"data",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/validation/builder/AbstractMessageContentBuilder.java#L156-L175 | train |
citrusframework/citrus | modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SoapServerFaultResponseActionBuilder.java | SoapServerFaultResponseActionBuilder.attachment | public SoapServerFaultResponseActionBuilder attachment(String contentId, String contentType, String content) {
SoapAttachment attachment = new SoapAttachment();
attachment.setContentId(contentId);
attachment.setContentType(contentType);
attachment.setContent(content);
getAction(... | java | public SoapServerFaultResponseActionBuilder attachment(String contentId, String contentType, String content) {
SoapAttachment attachment = new SoapAttachment();
attachment.setContentId(contentId);
attachment.setContentType(contentType);
attachment.setContent(content);
getAction(... | [
"public",
"SoapServerFaultResponseActionBuilder",
"attachment",
"(",
"String",
"contentId",
",",
"String",
"contentType",
",",
"String",
"content",
")",
"{",
"SoapAttachment",
"attachment",
"=",
"new",
"SoapAttachment",
"(",
")",
";",
"attachment",
".",
"setContentId"... | Sets the attachment with string content.
@param contentId
@param contentType
@param content
@return | [
"Sets",
"the",
"attachment",
"with",
"string",
"content",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SoapServerFaultResponseActionBuilder.java#L66-L74 | train |
citrusframework/citrus | modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SoapServerFaultResponseActionBuilder.java | SoapServerFaultResponseActionBuilder.charset | public SoapServerFaultResponseActionBuilder charset(String charsetName) {
if (!getAction().getAttachments().isEmpty()) {
getAction().getAttachments().get(getAction().getAttachments().size() - 1).setCharsetName(charsetName);
}
return this;
} | java | public SoapServerFaultResponseActionBuilder charset(String charsetName) {
if (!getAction().getAttachments().isEmpty()) {
getAction().getAttachments().get(getAction().getAttachments().size() - 1).setCharsetName(charsetName);
}
return this;
} | [
"public",
"SoapServerFaultResponseActionBuilder",
"charset",
"(",
"String",
"charsetName",
")",
"{",
"if",
"(",
"!",
"getAction",
"(",
")",
".",
"getAttachments",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"getAction",
"(",
")",
".",
"getAttachments",
"("... | Sets the charset name for this send action builder's attachment.
@param charsetName
@return | [
"Sets",
"the",
"charset",
"name",
"for",
"this",
"send",
"action",
"builder",
"s",
"attachment",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SoapServerFaultResponseActionBuilder.java#L116-L121 | train |
citrusframework/citrus | modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SoapServerFaultResponseActionBuilder.java | SoapServerFaultResponseActionBuilder.faultDetailResource | public SoapServerFaultResponseActionBuilder faultDetailResource(Resource resource, Charset charset) {
try {
getAction().getFaultDetails().add(FileUtils.readToString(resource, charset));
} catch (IOException e) {
throw new CitrusRuntimeException("Failed to read fault detail resour... | java | public SoapServerFaultResponseActionBuilder faultDetailResource(Resource resource, Charset charset) {
try {
getAction().getFaultDetails().add(FileUtils.readToString(resource, charset));
} catch (IOException e) {
throw new CitrusRuntimeException("Failed to read fault detail resour... | [
"public",
"SoapServerFaultResponseActionBuilder",
"faultDetailResource",
"(",
"Resource",
"resource",
",",
"Charset",
"charset",
")",
"{",
"try",
"{",
"getAction",
"(",
")",
".",
"getFaultDetails",
"(",
")",
".",
"add",
"(",
"FileUtils",
".",
"readToString",
"(",
... | Adds a fault detail from file resource.
@param resource
@param charset
@return | [
"Adds",
"a",
"fault",
"detail",
"from",
"file",
"resource",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SoapServerFaultResponseActionBuilder.java#L218-L225 | train |
citrusframework/citrus | modules/citrus-arquillian/src/main/java/com/consol/citrus/arquillian/configuration/CitrusConfiguration.java | CitrusConfiguration.from | public static CitrusConfiguration from(Properties extensionProperties) {
CitrusConfiguration configuration = new CitrusConfiguration(extensionProperties);
configuration.setCitrusVersion(getProperty(extensionProperties, "citrusVersion"));
if (extensionProperties.containsKey("autoPackage")) {
... | java | public static CitrusConfiguration from(Properties extensionProperties) {
CitrusConfiguration configuration = new CitrusConfiguration(extensionProperties);
configuration.setCitrusVersion(getProperty(extensionProperties, "citrusVersion"));
if (extensionProperties.containsKey("autoPackage")) {
... | [
"public",
"static",
"CitrusConfiguration",
"from",
"(",
"Properties",
"extensionProperties",
")",
"{",
"CitrusConfiguration",
"configuration",
"=",
"new",
"CitrusConfiguration",
"(",
"extensionProperties",
")",
";",
"configuration",
".",
"setCitrusVersion",
"(",
"getPrope... | Constructs Citrus configuration instance from given property set.
@param extensionProperties
@return | [
"Constructs",
"Citrus",
"configuration",
"instance",
"from",
"given",
"property",
"set",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-arquillian/src/main/java/com/consol/citrus/arquillian/configuration/CitrusConfiguration.java#L75-L105 | train |
citrusframework/citrus | modules/citrus-arquillian/src/main/java/com/consol/citrus/arquillian/configuration/CitrusConfiguration.java | CitrusConfiguration.getProperty | private static String getProperty(Properties extensionProperties, String propertyName) {
if (extensionProperties.containsKey(propertyName)) {
Object value = extensionProperties.get(propertyName);
if (value != null) {
return value.toString();
}
}
... | java | private static String getProperty(Properties extensionProperties, String propertyName) {
if (extensionProperties.containsKey(propertyName)) {
Object value = extensionProperties.get(propertyName);
if (value != null) {
return value.toString();
}
}
... | [
"private",
"static",
"String",
"getProperty",
"(",
"Properties",
"extensionProperties",
",",
"String",
"propertyName",
")",
"{",
"if",
"(",
"extensionProperties",
".",
"containsKey",
"(",
"propertyName",
")",
")",
"{",
"Object",
"value",
"=",
"extensionProperties",
... | Try to read property from property set. When not set or null value return null else
return String representation of value object.
@param extensionProperties
@param propertyName
@return | [
"Try",
"to",
"read",
"property",
"from",
"property",
"set",
".",
"When",
"not",
"set",
"or",
"null",
"value",
"return",
"null",
"else",
"return",
"String",
"representation",
"of",
"value",
"object",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-arquillian/src/main/java/com/consol/citrus/arquillian/configuration/CitrusConfiguration.java#L114-L123 | train |
citrusframework/citrus | modules/citrus-arquillian/src/main/java/com/consol/citrus/arquillian/configuration/CitrusConfiguration.java | CitrusConfiguration.readPropertiesFromDescriptor | private static Properties readPropertiesFromDescriptor(ArquillianDescriptor descriptor) {
for (ExtensionDef extension : descriptor.getExtensions()) {
if (CitrusExtensionConstants.CITRUS_EXTENSION_QUALIFIER.equals(extension.getExtensionName())) {
Properties properties = new Properties... | java | private static Properties readPropertiesFromDescriptor(ArquillianDescriptor descriptor) {
for (ExtensionDef extension : descriptor.getExtensions()) {
if (CitrusExtensionConstants.CITRUS_EXTENSION_QUALIFIER.equals(extension.getExtensionName())) {
Properties properties = new Properties... | [
"private",
"static",
"Properties",
"readPropertiesFromDescriptor",
"(",
"ArquillianDescriptor",
"descriptor",
")",
"{",
"for",
"(",
"ExtensionDef",
"extension",
":",
"descriptor",
".",
"getExtensions",
"(",
")",
")",
"{",
"if",
"(",
"CitrusExtensionConstants",
".",
... | Find Citrus extension configuration in descriptor and read properties.
@param descriptor
@return | [
"Find",
"Citrus",
"extension",
"configuration",
"in",
"descriptor",
"and",
"read",
"properties",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-arquillian/src/main/java/com/consol/citrus/arquillian/configuration/CitrusConfiguration.java#L130-L140 | train |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/xml/schema/XsdSchemaCollection.java | XsdSchemaCollection.loadSchemaResources | protected Resource loadSchemaResources() {
PathMatchingResourcePatternResolver resourcePatternResolver = new PathMatchingResourcePatternResolver();
for (String location : schemas) {
try {
Resource[] findings = resourcePatternResolver.getResources(location);
f... | java | protected Resource loadSchemaResources() {
PathMatchingResourcePatternResolver resourcePatternResolver = new PathMatchingResourcePatternResolver();
for (String location : schemas) {
try {
Resource[] findings = resourcePatternResolver.getResources(location);
f... | [
"protected",
"Resource",
"loadSchemaResources",
"(",
")",
"{",
"PathMatchingResourcePatternResolver",
"resourcePatternResolver",
"=",
"new",
"PathMatchingResourcePatternResolver",
"(",
")",
";",
"for",
"(",
"String",
"location",
":",
"schemas",
")",
"{",
"try",
"{",
"... | Loads all schema resource files from schema locations. | [
"Loads",
"all",
"schema",
"resource",
"files",
"from",
"schema",
"locations",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/xml/schema/XsdSchemaCollection.java#L40-L57 | train |
citrusframework/citrus | modules/citrus-websocket/src/main/java/com/consol/citrus/websocket/message/WebSocketMessage.java | WebSocketMessage.isLast | public boolean isLast() {
Object isLast = getHeader(WebSocketMessageHeaders.WEB_SOCKET_IS_LAST);
if (isLast != null) {
if (isLast instanceof String) {
return Boolean.valueOf(isLast.toString());
} else {
return (Boolean) isLast;
}
... | java | public boolean isLast() {
Object isLast = getHeader(WebSocketMessageHeaders.WEB_SOCKET_IS_LAST);
if (isLast != null) {
if (isLast instanceof String) {
return Boolean.valueOf(isLast.toString());
} else {
return (Boolean) isLast;
}
... | [
"public",
"boolean",
"isLast",
"(",
")",
"{",
"Object",
"isLast",
"=",
"getHeader",
"(",
"WebSocketMessageHeaders",
".",
"WEB_SOCKET_IS_LAST",
")",
";",
"if",
"(",
"isLast",
"!=",
"null",
")",
"{",
"if",
"(",
"isLast",
"instanceof",
"String",
")",
"{",
"re... | Gets the isLast flag from message headers.
@return | [
"Gets",
"the",
"isLast",
"flag",
"from",
"message",
"headers",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-websocket/src/main/java/com/consol/citrus/websocket/message/WebSocketMessage.java#L78-L90 | train |
citrusframework/citrus | modules/citrus-jdbc/src/main/java/com/consol/citrus/jdbc/message/JdbcMessage.java | JdbcMessage.getOperationResult | private OperationResult getOperationResult() {
if (operationResult == null) {
this.operationResult = (OperationResult) marshaller.unmarshal(new StringSource(getPayload(String.class)));
}
return operationResult;
} | java | private OperationResult getOperationResult() {
if (operationResult == null) {
this.operationResult = (OperationResult) marshaller.unmarshal(new StringSource(getPayload(String.class)));
}
return operationResult;
} | [
"private",
"OperationResult",
"getOperationResult",
"(",
")",
"{",
"if",
"(",
"operationResult",
"==",
"null",
")",
"{",
"this",
".",
"operationResult",
"=",
"(",
"OperationResult",
")",
"marshaller",
".",
"unmarshal",
"(",
"new",
"StringSource",
"(",
"getPayloa... | Gets the operation result if any or tries to unmarshal String payload representation to an operation result model.
@return | [
"Gets",
"the",
"operation",
"result",
"if",
"any",
"or",
"tries",
"to",
"unmarshal",
"String",
"payload",
"representation",
"to",
"an",
"operation",
"result",
"model",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-jdbc/src/main/java/com/consol/citrus/jdbc/message/JdbcMessage.java#L219-L225 | train |
citrusframework/citrus | modules/citrus-jdbc/src/main/java/com/consol/citrus/jdbc/message/JdbcMessage.java | JdbcMessage.getOperation | private Operation getOperation() {
if (operation == null) {
this.operation = (Operation) marshaller.unmarshal(new StringSource(getPayload(String.class)));
}
return operation;
} | java | private Operation getOperation() {
if (operation == null) {
this.operation = (Operation) marshaller.unmarshal(new StringSource(getPayload(String.class)));
}
return operation;
} | [
"private",
"Operation",
"getOperation",
"(",
")",
"{",
"if",
"(",
"operation",
"==",
"null",
")",
"{",
"this",
".",
"operation",
"=",
"(",
"Operation",
")",
"marshaller",
".",
"unmarshal",
"(",
"new",
"StringSource",
"(",
"getPayload",
"(",
"String",
".",
... | Gets the operation if any or tries to unmarshal String payload representation to an operation model.
@return | [
"Gets",
"the",
"operation",
"if",
"any",
"or",
"tries",
"to",
"unmarshal",
"String",
"payload",
"representation",
"to",
"an",
"operation",
"model",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-jdbc/src/main/java/com/consol/citrus/jdbc/message/JdbcMessage.java#L231-L237 | train |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/channel/selector/AbstractMessageSelector.java | AbstractMessageSelector.getPayloadAsString | String getPayloadAsString(Message<?> message) {
if (message.getPayload() instanceof com.consol.citrus.message.Message) {
return ((com.consol.citrus.message.Message) message.getPayload()).getPayload(String.class);
} else {
return message.getPayload().toString();
}
} | java | String getPayloadAsString(Message<?> message) {
if (message.getPayload() instanceof com.consol.citrus.message.Message) {
return ((com.consol.citrus.message.Message) message.getPayload()).getPayload(String.class);
} else {
return message.getPayload().toString();
}
} | [
"String",
"getPayloadAsString",
"(",
"Message",
"<",
"?",
">",
"message",
")",
"{",
"if",
"(",
"message",
".",
"getPayload",
"(",
")",
"instanceof",
"com",
".",
"consol",
".",
"citrus",
".",
"message",
".",
"Message",
")",
"{",
"return",
"(",
"(",
"com... | Reads message payload as String either from message object directly or from nested Citrus message representation.
@param message
@return | [
"Reads",
"message",
"payload",
"as",
"String",
"either",
"from",
"message",
"object",
"directly",
"or",
"from",
"nested",
"Citrus",
"message",
"representation",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/channel/selector/AbstractMessageSelector.java#L55-L61 | train |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/channel/selector/AbstractMessageSelector.java | AbstractMessageSelector.evaluate | protected boolean evaluate(String value) {
if (ValidationMatcherUtils.isValidationMatcherExpression(matchingValue)) {
try {
ValidationMatcherUtils.resolveValidationMatcher(selectKey, value, matchingValue, context);
return true;
} catch (ValidationException... | java | protected boolean evaluate(String value) {
if (ValidationMatcherUtils.isValidationMatcherExpression(matchingValue)) {
try {
ValidationMatcherUtils.resolveValidationMatcher(selectKey, value, matchingValue, context);
return true;
} catch (ValidationException... | [
"protected",
"boolean",
"evaluate",
"(",
"String",
"value",
")",
"{",
"if",
"(",
"ValidationMatcherUtils",
".",
"isValidationMatcherExpression",
"(",
"matchingValue",
")",
")",
"{",
"try",
"{",
"ValidationMatcherUtils",
".",
"resolveValidationMatcher",
"(",
"selectKey... | Evaluates given value to match this selectors matching condition. Automatically supports validation matcher expressions.
@param value
@return | [
"Evaluates",
"given",
"value",
"to",
"match",
"this",
"selectors",
"matching",
"condition",
".",
"Automatically",
"supports",
"validation",
"matcher",
"expressions",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/channel/selector/AbstractMessageSelector.java#L68-L79 | train |
citrusframework/citrus | modules/citrus-ftp/src/main/java/com/consol/citrus/ftp/client/SftpClient.java | SftpClient.createDir | protected FtpMessage createDir(CommandType ftpCommand) {
try {
sftp.mkdir(ftpCommand.getArguments());
return FtpMessage.result(FTPReply.PATHNAME_CREATED, "Pathname created", true);
} catch (SftpException e) {
throw new CitrusRuntimeException("Failed to execute ftp com... | java | protected FtpMessage createDir(CommandType ftpCommand) {
try {
sftp.mkdir(ftpCommand.getArguments());
return FtpMessage.result(FTPReply.PATHNAME_CREATED, "Pathname created", true);
} catch (SftpException e) {
throw new CitrusRuntimeException("Failed to execute ftp com... | [
"protected",
"FtpMessage",
"createDir",
"(",
"CommandType",
"ftpCommand",
")",
"{",
"try",
"{",
"sftp",
".",
"mkdir",
"(",
"ftpCommand",
".",
"getArguments",
"(",
")",
")",
";",
"return",
"FtpMessage",
".",
"result",
"(",
"FTPReply",
".",
"PATHNAME_CREATED",
... | Execute mkDir command and create new directory.
@param ftpCommand
@return | [
"Execute",
"mkDir",
"command",
"and",
"create",
"new",
"directory",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-ftp/src/main/java/com/consol/citrus/ftp/client/SftpClient.java#L97-L104 | train |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/xml/XmlConfigurer.java | XmlConfigurer.createLSParser | public LSParser createLSParser() {
LSParser parser = domImpl.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, null);
configureParser(parser);
return parser;
} | java | public LSParser createLSParser() {
LSParser parser = domImpl.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, null);
configureParser(parser);
return parser;
} | [
"public",
"LSParser",
"createLSParser",
"(",
")",
"{",
"LSParser",
"parser",
"=",
"domImpl",
".",
"createLSParser",
"(",
"DOMImplementationLS",
".",
"MODE_SYNCHRONOUS",
",",
"null",
")",
";",
"configureParser",
"(",
"parser",
")",
";",
"return",
"parser",
";",
... | Creates basic LSParser instance and sets common
properties and configuration parameters.
@return | [
"Creates",
"basic",
"LSParser",
"instance",
"and",
"sets",
"common",
"properties",
"and",
"configuration",
"parameters",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/xml/XmlConfigurer.java#L88-L93 | train |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/xml/XmlConfigurer.java | XmlConfigurer.configureParser | protected void configureParser(LSParser parser) {
for (Map.Entry<String, Object> setting : parseSettings.entrySet()) {
setParserConfigParameter(parser, setting.getKey(), setting.getValue());
}
} | java | protected void configureParser(LSParser parser) {
for (Map.Entry<String, Object> setting : parseSettings.entrySet()) {
setParserConfigParameter(parser, setting.getKey(), setting.getValue());
}
} | [
"protected",
"void",
"configureParser",
"(",
"LSParser",
"parser",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"Object",
">",
"setting",
":",
"parseSettings",
".",
"entrySet",
"(",
")",
")",
"{",
"setParserConfigParameter",
"(",
"parser",
... | Set parser configuration based on this configurers settings.
@param parser | [
"Set",
"parser",
"configuration",
"based",
"on",
"this",
"configurers",
"settings",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/xml/XmlConfigurer.java#L99-L103 | train |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/xml/XmlConfigurer.java | XmlConfigurer.configureSerializer | protected void configureSerializer(LSSerializer serializer) {
for (Map.Entry<String, Object> setting : serializeSettings.entrySet()) {
setSerializerConfigParameter(serializer, setting.getKey(), setting.getValue());
}
} | java | protected void configureSerializer(LSSerializer serializer) {
for (Map.Entry<String, Object> setting : serializeSettings.entrySet()) {
setSerializerConfigParameter(serializer, setting.getKey(), setting.getValue());
}
} | [
"protected",
"void",
"configureSerializer",
"(",
"LSSerializer",
"serializer",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"Object",
">",
"setting",
":",
"serializeSettings",
".",
"entrySet",
"(",
")",
")",
"{",
"setSerializerConfigParameter",... | Set serializer configuration based on this configurers settings.
@param serializer | [
"Set",
"serializer",
"configuration",
"based",
"on",
"this",
"configurers",
"settings",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/xml/XmlConfigurer.java#L121-L125 | train |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/xml/XmlConfigurer.java | XmlConfigurer.setDefaultParseSettings | private void setDefaultParseSettings() {
if (!parseSettings.containsKey(CDATA_SECTIONS)) {
parseSettings.put(CDATA_SECTIONS, true);
}
if (!parseSettings.containsKey(SPLIT_CDATA_SECTIONS)) {
parseSettings.put(SPLIT_CDATA_SECTIONS, false);
}
if (!parseSett... | java | private void setDefaultParseSettings() {
if (!parseSettings.containsKey(CDATA_SECTIONS)) {
parseSettings.put(CDATA_SECTIONS, true);
}
if (!parseSettings.containsKey(SPLIT_CDATA_SECTIONS)) {
parseSettings.put(SPLIT_CDATA_SECTIONS, false);
}
if (!parseSett... | [
"private",
"void",
"setDefaultParseSettings",
"(",
")",
"{",
"if",
"(",
"!",
"parseSettings",
".",
"containsKey",
"(",
"CDATA_SECTIONS",
")",
")",
"{",
"parseSettings",
".",
"put",
"(",
"CDATA_SECTIONS",
",",
"true",
")",
";",
"}",
"if",
"(",
"!",
"parseSe... | Sets the default parse settings. | [
"Sets",
"the",
"default",
"parse",
"settings",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/xml/XmlConfigurer.java#L155-L175 | train |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/xml/XmlConfigurer.java | XmlConfigurer.setDefaultSerializeSettings | private void setDefaultSerializeSettings() {
if (!serializeSettings.containsKey(ELEMENT_CONTENT_WHITESPACE)) {
serializeSettings.put(ELEMENT_CONTENT_WHITESPACE, true);
}
if (!serializeSettings.containsKey(SPLIT_CDATA_SECTIONS)) {
serializeSettings.put(SPLIT_CDATA_SECTION... | java | private void setDefaultSerializeSettings() {
if (!serializeSettings.containsKey(ELEMENT_CONTENT_WHITESPACE)) {
serializeSettings.put(ELEMENT_CONTENT_WHITESPACE, true);
}
if (!serializeSettings.containsKey(SPLIT_CDATA_SECTIONS)) {
serializeSettings.put(SPLIT_CDATA_SECTION... | [
"private",
"void",
"setDefaultSerializeSettings",
"(",
")",
"{",
"if",
"(",
"!",
"serializeSettings",
".",
"containsKey",
"(",
"ELEMENT_CONTENT_WHITESPACE",
")",
")",
"{",
"serializeSettings",
".",
"put",
"(",
"ELEMENT_CONTENT_WHITESPACE",
",",
"true",
")",
";",
"... | Sets the default serialize settings. | [
"Sets",
"the",
"default",
"serialize",
"settings",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/xml/XmlConfigurer.java#L180-L196 | train |
citrusframework/citrus | modules/citrus-mail/src/main/java/com/consol/citrus/mail/model/BodyPart.java | BodyPart.addPart | public void addPart(AttachmentPart part) {
if (attachments == null) {
attachments = new BodyPart.Attachments();
}
this.attachments.add(part);
} | java | public void addPart(AttachmentPart part) {
if (attachments == null) {
attachments = new BodyPart.Attachments();
}
this.attachments.add(part);
} | [
"public",
"void",
"addPart",
"(",
"AttachmentPart",
"part",
")",
"{",
"if",
"(",
"attachments",
"==",
"null",
")",
"{",
"attachments",
"=",
"new",
"BodyPart",
".",
"Attachments",
"(",
")",
";",
"}",
"this",
".",
"attachments",
".",
"add",
"(",
"part",
... | Adds new attachment part.
@param part | [
"Adds",
"new",
"attachment",
"part",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-mail/src/main/java/com/consol/citrus/mail/model/BodyPart.java#L69-L75 | train |
citrusframework/citrus | modules/citrus-rmi/src/main/java/com/consol/citrus/rmi/endpoint/RmiEndpointUtils.java | RmiEndpointUtils.getBinding | public static String getBinding(String resourcePath) {
if (resourcePath.contains("/")) {
return resourcePath.substring(resourcePath.indexOf('/') + 1);
}
return null;
} | java | public static String getBinding(String resourcePath) {
if (resourcePath.contains("/")) {
return resourcePath.substring(resourcePath.indexOf('/') + 1);
}
return null;
} | [
"public",
"static",
"String",
"getBinding",
"(",
"String",
"resourcePath",
")",
"{",
"if",
"(",
"resourcePath",
".",
"contains",
"(",
"\"/\"",
")",
")",
"{",
"return",
"resourcePath",
".",
"substring",
"(",
"resourcePath",
".",
"indexOf",
"(",
"'",
"'",
")... | Extract service binding information from endpoint resource path. This is usualle the path after the port specification.
@param resourcePath
@return | [
"Extract",
"service",
"binding",
"information",
"from",
"endpoint",
"resource",
"path",
".",
"This",
"is",
"usualle",
"the",
"path",
"after",
"the",
"port",
"specification",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-rmi/src/main/java/com/consol/citrus/rmi/endpoint/RmiEndpointUtils.java#L37-L43 | train |
citrusframework/citrus | modules/citrus-rmi/src/main/java/com/consol/citrus/rmi/endpoint/RmiEndpointUtils.java | RmiEndpointUtils.getHost | public static String getHost(String resourcePath) {
String hostSpec;
if (resourcePath.contains(":")) {
hostSpec = resourcePath.split(":")[0];
} else {
hostSpec = resourcePath;
}
if (hostSpec.contains("/")) {
hostSpec = hostSpec.substring(0, ho... | java | public static String getHost(String resourcePath) {
String hostSpec;
if (resourcePath.contains(":")) {
hostSpec = resourcePath.split(":")[0];
} else {
hostSpec = resourcePath;
}
if (hostSpec.contains("/")) {
hostSpec = hostSpec.substring(0, ho... | [
"public",
"static",
"String",
"getHost",
"(",
"String",
"resourcePath",
")",
"{",
"String",
"hostSpec",
";",
"if",
"(",
"resourcePath",
".",
"contains",
"(",
"\":\"",
")",
")",
"{",
"hostSpec",
"=",
"resourcePath",
".",
"split",
"(",
"\":\"",
")",
"[",
"... | Extract host name from resource path.
@param resourcePath
@return | [
"Extract",
"host",
"name",
"from",
"resource",
"path",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-rmi/src/main/java/com/consol/citrus/rmi/endpoint/RmiEndpointUtils.java#L70-L83 | train |
citrusframework/citrus | modules/citrus-ws/src/main/java/com/consol/citrus/ws/message/SoapAttachment.java | SoapAttachment.from | public static SoapAttachment from(Attachment attachment) {
SoapAttachment soapAttachment = new SoapAttachment();
String contentId = attachment.getContentId();
if (contentId.startsWith("<") && contentId.endsWith(">")) {
contentId = contentId.substring(1, contentId.length() - 1);
... | java | public static SoapAttachment from(Attachment attachment) {
SoapAttachment soapAttachment = new SoapAttachment();
String contentId = attachment.getContentId();
if (contentId.startsWith("<") && contentId.endsWith(">")) {
contentId = contentId.substring(1, contentId.length() - 1);
... | [
"public",
"static",
"SoapAttachment",
"from",
"(",
"Attachment",
"attachment",
")",
"{",
"SoapAttachment",
"soapAttachment",
"=",
"new",
"SoapAttachment",
"(",
")",
";",
"String",
"contentId",
"=",
"attachment",
".",
"getContentId",
"(",
")",
";",
"if",
"(",
"... | Static construction method from Spring mime attachment.
@param attachment
@return | [
"Static",
"construction",
"method",
"from",
"Spring",
"mime",
"attachment",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-ws/src/main/java/com/consol/citrus/ws/message/SoapAttachment.java#L87-L111 | train |
citrusframework/citrus | modules/citrus-ws/src/main/java/com/consol/citrus/ws/message/SoapAttachment.java | SoapAttachment.getContent | public String getContent() {
if (content != null) {
return context != null ? context.replaceDynamicContentInString(content) : content;
} else if (StringUtils.hasText(getContentResourcePath()) && getContentType().startsWith("text")) {
try {
String fileContent = Fil... | java | public String getContent() {
if (content != null) {
return context != null ? context.replaceDynamicContentInString(content) : content;
} else if (StringUtils.hasText(getContentResourcePath()) && getContentType().startsWith("text")) {
try {
String fileContent = Fil... | [
"public",
"String",
"getContent",
"(",
")",
"{",
"if",
"(",
"content",
"!=",
"null",
")",
"{",
"return",
"context",
"!=",
"null",
"?",
"context",
".",
"replaceDynamicContentInString",
"(",
"content",
")",
":",
"content",
";",
"}",
"else",
"if",
"(",
"Str... | Get the content body.
@return the content | [
"Get",
"the",
"content",
"body",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-ws/src/main/java/com/consol/citrus/ws/message/SoapAttachment.java#L189-L214 | train |
citrusframework/citrus | modules/citrus-ws/src/main/java/com/consol/citrus/ws/message/SoapAttachment.java | SoapAttachment.getContentResourcePath | public String getContentResourcePath() {
if (contentResourcePath != null && context != null) {
return context.replaceDynamicContentInString(contentResourcePath);
} else {
return contentResourcePath;
}
} | java | public String getContentResourcePath() {
if (contentResourcePath != null && context != null) {
return context.replaceDynamicContentInString(contentResourcePath);
} else {
return contentResourcePath;
}
} | [
"public",
"String",
"getContentResourcePath",
"(",
")",
"{",
"if",
"(",
"contentResourcePath",
"!=",
"null",
"&&",
"context",
"!=",
"null",
")",
"{",
"return",
"context",
".",
"replaceDynamicContentInString",
"(",
"contentResourcePath",
")",
";",
"}",
"else",
"{... | Get the content file resource path.
@return the content resource path | [
"Get",
"the",
"content",
"file",
"resource",
"path",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-ws/src/main/java/com/consol/citrus/ws/message/SoapAttachment.java#L228-L234 | train |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/variable/MessageHeaderVariableExtractor.java | MessageHeaderVariableExtractor.extractVariables | public void extractVariables(Message message, TestContext context) {
if (CollectionUtils.isEmpty(headerMappings)) { return; }
for (Entry<String, String> entry : headerMappings.entrySet()) {
String headerElementName = entry.getKey();
String targetVariableName = entry.getValue();
... | java | public void extractVariables(Message message, TestContext context) {
if (CollectionUtils.isEmpty(headerMappings)) { return; }
for (Entry<String, String> entry : headerMappings.entrySet()) {
String headerElementName = entry.getKey();
String targetVariableName = entry.getValue();
... | [
"public",
"void",
"extractVariables",
"(",
"Message",
"message",
",",
"TestContext",
"context",
")",
"{",
"if",
"(",
"CollectionUtils",
".",
"isEmpty",
"(",
"headerMappings",
")",
")",
"{",
"return",
";",
"}",
"for",
"(",
"Entry",
"<",
"String",
",",
"Stri... | Reads header information and saves new test variables. | [
"Reads",
"header",
"information",
"and",
"saves",
"new",
"test",
"variables",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/variable/MessageHeaderVariableExtractor.java#L41-L54 | train |
citrusframework/citrus | modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/KubernetesActionBuilder.java | KubernetesActionBuilder.command | public <T extends KubernetesCommand> T command(T command) {
action.setCommand(command);
return command;
} | java | public <T extends KubernetesCommand> T command(T command) {
action.setCommand(command);
return command;
} | [
"public",
"<",
"T",
"extends",
"KubernetesCommand",
">",
"T",
"command",
"(",
"T",
"command",
")",
"{",
"action",
".",
"setCommand",
"(",
"command",
")",
";",
"return",
"command",
";",
"}"
] | Use a kubernetes command. | [
"Use",
"a",
"kubernetes",
"command",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/KubernetesActionBuilder.java#L59-L62 | train |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/actions/ReceiveMessageAction.java | ReceiveMessageAction.receive | private Message receive(TestContext context) {
Endpoint messageEndpoint = getOrCreateEndpoint(context);
return receiveTimeout > 0 ? messageEndpoint.createConsumer().receive(context, receiveTimeout) :
messageEndpoint.createConsumer().receive(context, messageEndpoint.getEndpointConfigurati... | java | private Message receive(TestContext context) {
Endpoint messageEndpoint = getOrCreateEndpoint(context);
return receiveTimeout > 0 ? messageEndpoint.createConsumer().receive(context, receiveTimeout) :
messageEndpoint.createConsumer().receive(context, messageEndpoint.getEndpointConfigurati... | [
"private",
"Message",
"receive",
"(",
"TestContext",
"context",
")",
"{",
"Endpoint",
"messageEndpoint",
"=",
"getOrCreateEndpoint",
"(",
"context",
")",
";",
"return",
"receiveTimeout",
">",
"0",
"?",
"messageEndpoint",
".",
"createConsumer",
"(",
")",
".",
"re... | Receives the message with respective message receiver implementation.
@return | [
"Receives",
"the",
"message",
"with",
"respective",
"message",
"receiver",
"implementation",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/actions/ReceiveMessageAction.java#L138-L142 | train |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/actions/ReceiveMessageAction.java | ReceiveMessageAction.receiveSelected | private Message receiveSelected(TestContext context, String selectorString) {
if (log.isDebugEnabled()) {
log.debug("Setting message selector: '" + selectorString + "'");
}
Endpoint messageEndpoint = getOrCreateEndpoint(context);
Consumer consumer = messageEndpoint.createCon... | java | private Message receiveSelected(TestContext context, String selectorString) {
if (log.isDebugEnabled()) {
log.debug("Setting message selector: '" + selectorString + "'");
}
Endpoint messageEndpoint = getOrCreateEndpoint(context);
Consumer consumer = messageEndpoint.createCon... | [
"private",
"Message",
"receiveSelected",
"(",
"TestContext",
"context",
",",
"String",
"selectorString",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Setting message selector: '\"",
"+",
"selectorString",
"+... | Receives the message with the respective message receiver implementation
also using a message selector.
@param context the test context.
@param selectorString the message selector string.
@return | [
"Receives",
"the",
"message",
"with",
"the",
"respective",
"message",
"receiver",
"implementation",
"also",
"using",
"a",
"message",
"selector",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/actions/ReceiveMessageAction.java#L151-L172 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.