id int32 0 165k | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
112,600 | validator/validator | src/nu/validator/gnu/xml/aelfred2/XmlParser.java | XmlParser.parseAttlistDecl | private void parseAttlistDecl() throws Exception {
String elementName;
requireWhitespace();
elementName = readNmtoken(true);
boolean white = tryWhitespace();
while (!tryRead('>')) {
if (!white) {
fatal("whitespace required before attribute definition"... | java | private void parseAttlistDecl() throws Exception {
String elementName;
requireWhitespace();
elementName = readNmtoken(true);
boolean white = tryWhitespace();
while (!tryRead('>')) {
if (!white) {
fatal("whitespace required before attribute definition"... | [
"private",
"void",
"parseAttlistDecl",
"(",
")",
"throws",
"Exception",
"{",
"String",
"elementName",
";",
"requireWhitespace",
"(",
")",
";",
"elementName",
"=",
"readNmtoken",
"(",
"true",
")",
";",
"boolean",
"white",
"=",
"tryWhitespace",
"(",
")",
";",
... | Parse an attribute list declaration.
<pre>
[52] AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>'
</pre>
<p>
NOTE: the '<!ATTLIST' has already been read. | [
"Parse",
"an",
"attribute",
"list",
"declaration",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L1759-L1772 |
112,601 | validator/validator | src/nu/validator/gnu/xml/aelfred2/XmlParser.java | XmlParser.parseAttDef | private void parseAttDef(String elementName) throws Exception {
String name;
String type;
String enumer = null;
// Read the attribute name.
name = readNmtoken(true);
// Read the attribute type.
requireWhitespace();
type = readAttType();
// Get t... | java | private void parseAttDef(String elementName) throws Exception {
String name;
String type;
String enumer = null;
// Read the attribute name.
name = readNmtoken(true);
// Read the attribute type.
requireWhitespace();
type = readAttType();
// Get t... | [
"private",
"void",
"parseAttDef",
"(",
"String",
"elementName",
")",
"throws",
"Exception",
"{",
"String",
"name",
";",
"String",
"type",
";",
"String",
"enumer",
"=",
"null",
";",
"// Read the attribute name.",
"name",
"=",
"readNmtoken",
"(",
"true",
")",
";... | Parse a single attribute definition.
<pre>
[53] AttDef ::= S Name S AttType S DefaultDecl
</pre> | [
"Parse",
"a",
"single",
"attribute",
"definition",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L1781-L1807 |
112,602 | validator/validator | src/nu/validator/gnu/xml/aelfred2/XmlParser.java | XmlParser.readAttType | private String readAttType() throws Exception {
if (tryRead('(')) {
parseEnumeration(false);
return "ENUMERATION";
} else {
String typeString = readNmtoken(true);
if (handler.stringInterning) {
if ("NOTATION" == typeString) {
... | java | private String readAttType() throws Exception {
if (tryRead('(')) {
parseEnumeration(false);
return "ENUMERATION";
} else {
String typeString = readNmtoken(true);
if (handler.stringInterning) {
if ("NOTATION" == typeString) {
... | [
"private",
"String",
"readAttType",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"tryRead",
"(",
"'",
"'",
")",
")",
"{",
"parseEnumeration",
"(",
"false",
")",
";",
"return",
"\"ENUMERATION\"",
";",
"}",
"else",
"{",
"String",
"typeString",
"=",
"re... | Parse the attribute type.
<pre>
[54] AttType ::= StringType | TokenizedType | EnumeratedType
[55] StringType ::= 'CDATA'
[56] TokenizedType ::= 'ID' | 'IDREF' | 'IDREFS' | 'ENTITY'
| 'ENTITIES' | 'NMTOKEN' | 'NMTOKENS'
[57] EnumeratedType ::= NotationType | Enumeration
</pre> | [
"Parse",
"the",
"attribute",
"type",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L1820-L1854 |
112,603 | validator/validator | src/nu/validator/gnu/xml/aelfred2/XmlParser.java | XmlParser.parseEnumeration | private void parseEnumeration(boolean isNames) throws Exception {
dataBufferAppend('(');
// Read the first token.
skipWhitespace();
dataBufferAppend(readNmtoken(isNames));
// Read the remaining tokens.
skipWhitespace();
while (!tryRead(')')) {
require... | java | private void parseEnumeration(boolean isNames) throws Exception {
dataBufferAppend('(');
// Read the first token.
skipWhitespace();
dataBufferAppend(readNmtoken(isNames));
// Read the remaining tokens.
skipWhitespace();
while (!tryRead(')')) {
require... | [
"private",
"void",
"parseEnumeration",
"(",
"boolean",
"isNames",
")",
"throws",
"Exception",
"{",
"dataBufferAppend",
"(",
"'",
"'",
")",
";",
"// Read the first token.",
"skipWhitespace",
"(",
")",
";",
"dataBufferAppend",
"(",
"readNmtoken",
"(",
"isNames",
")"... | Parse an enumeration.
<pre>
[59] Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')'
</pre>
<p>
NOTE: the '(' has already been read. | [
"Parse",
"an",
"enumeration",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L1866-L1882 |
112,604 | validator/validator | src/nu/validator/gnu/xml/aelfred2/XmlParser.java | XmlParser.parseDefault | private void parseDefault(String elementName, String name, String type,
String enumer) throws Exception {
int valueType = ATTRIBUTE_DEFAULT_SPECIFIED;
String value = null;
int flags = LIT_ATTRIBUTE;
boolean saved = expandPE;
String defaultType = null;
// LIT_... | java | private void parseDefault(String elementName, String name, String type,
String enumer) throws Exception {
int valueType = ATTRIBUTE_DEFAULT_SPECIFIED;
String value = null;
int flags = LIT_ATTRIBUTE;
boolean saved = expandPE;
String defaultType = null;
// LIT_... | [
"private",
"void",
"parseDefault",
"(",
"String",
"elementName",
",",
"String",
"name",
",",
"String",
"type",
",",
"String",
"enumer",
")",
"throws",
"Exception",
"{",
"int",
"valueType",
"=",
"ATTRIBUTE_DEFAULT_SPECIFIED",
";",
"String",
"value",
"=",
"null",
... | Parse the default value for an attribute.
<pre>
[60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED'
| (('#FIXED' S)? AttValue)
</pre> | [
"Parse",
"the",
"default",
"value",
"for",
"an",
"attribute",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L1910-L1973 |
112,605 | validator/validator | src/nu/validator/gnu/xml/aelfred2/XmlParser.java | XmlParser.parseConditionalSect | private void parseConditionalSect(char[] saved) throws Exception {
skipWhitespace();
if (tryRead("INCLUDE")) {
skipWhitespace();
require('[');
// VC: Proper Conditional Section/PE Nesting
if (readBuffer != saved) {
handler.verror("Illegal C... | java | private void parseConditionalSect(char[] saved) throws Exception {
skipWhitespace();
if (tryRead("INCLUDE")) {
skipWhitespace();
require('[');
// VC: Proper Conditional Section/PE Nesting
if (readBuffer != saved) {
handler.verror("Illegal C... | [
"private",
"void",
"parseConditionalSect",
"(",
"char",
"[",
"]",
"saved",
")",
"throws",
"Exception",
"{",
"skipWhitespace",
"(",
")",
";",
"if",
"(",
"tryRead",
"(",
"\"INCLUDE\"",
")",
")",
"{",
"skipWhitespace",
"(",
")",
";",
"require",
"(",
"'",
"'... | Parse a conditional section.
<pre>
[61] conditionalSect ::= includeSect || ignoreSect
[62] includeSect ::= '<![' S? 'INCLUDE' S? '['
extSubsetDecl ']]>'
[63] ignoreSect ::= '<![' S? 'IGNORE' S? '['
ignoreSectContents* ']]>'
[64] ignoreSectContents ::= Ignore
('<![' ignoreSectContents* ']]>' Ignore )*... | [
"Parse",
"a",
"conditional",
"section",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L1992-L2033 |
112,606 | validator/validator | src/nu/validator/gnu/xml/aelfred2/XmlParser.java | XmlParser.parseCharRef | private void parseCharRef(boolean doFlush) throws SAXException, IOException {
int value = 0;
char c;
if (tryRead('x')) {
loop1: while (true) {
c = readCh();
if (c == ';') {
break loop1;
} else {
... | java | private void parseCharRef(boolean doFlush) throws SAXException, IOException {
int value = 0;
char c;
if (tryRead('x')) {
loop1: while (true) {
c = readCh();
if (c == ';') {
break loop1;
} else {
... | [
"private",
"void",
"parseCharRef",
"(",
"boolean",
"doFlush",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"int",
"value",
"=",
"0",
";",
"char",
"c",
";",
"if",
"(",
"tryRead",
"(",
"'",
"'",
")",
")",
"{",
"loop1",
":",
"while",
"(",
"tr... | Read and interpret a character reference.
<pre>
[66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';'
</pre>
<p>
NOTE: the '&#' has already been read. | [
"Read",
"and",
"interpret",
"a",
"character",
"reference",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L2122-L2194 |
112,607 | validator/validator | src/nu/validator/gnu/xml/aelfred2/XmlParser.java | XmlParser.parseEntityRef | private void parseEntityRef(boolean externalAllowed) throws SAXException,
IOException {
String name;
name = readNmtoken(true);
require(';');
switch (getEntityType(name)) {
case ENTITY_UNDECLARED:
// NOTE: XML REC describes amazingly convoluted han... | java | private void parseEntityRef(boolean externalAllowed) throws SAXException,
IOException {
String name;
name = readNmtoken(true);
require(';');
switch (getEntityType(name)) {
case ENTITY_UNDECLARED:
// NOTE: XML REC describes amazingly convoluted han... | [
"private",
"void",
"parseEntityRef",
"(",
"boolean",
"externalAllowed",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"String",
"name",
";",
"name",
"=",
"readNmtoken",
"(",
"true",
")",
";",
"require",
"(",
"'",
"'",
")",
";",
"switch",
"(",
"ge... | Parse and expand an entity reference.
<pre>
[68] EntityRef ::= '&' Name ';'
</pre>
<p>
NOTE: the '&' has already been read.
@param externalAllowed
External entities are allowed here. | [
"Parse",
"and",
"expand",
"an",
"entity",
"reference",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L2209-L2297 |
112,608 | validator/validator | src/nu/validator/gnu/xml/aelfred2/XmlParser.java | XmlParser.parsePEReference | private void parsePEReference() throws SAXException, IOException {
String name;
name = "%" + readNmtoken(true);
require(';');
switch (getEntityType(name)) {
case ENTITY_UNDECLARED:
// VC: Entity Declared
handler.verror("reference to undeclared... | java | private void parsePEReference() throws SAXException, IOException {
String name;
name = "%" + readNmtoken(true);
require(';');
switch (getEntityType(name)) {
case ENTITY_UNDECLARED:
// VC: Entity Declared
handler.verror("reference to undeclared... | [
"private",
"void",
"parsePEReference",
"(",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"String",
"name",
";",
"name",
"=",
"\"%\"",
"+",
"readNmtoken",
"(",
"true",
")",
";",
"require",
"(",
"'",
"'",
")",
";",
"switch",
"(",
"getEntityType",
... | Parse and expand a parameter entity reference.
<pre>
[69] PEReference ::= '%' Name ';'
</pre>
<p>
NOTE: the '%' has already been read. | [
"Parse",
"and",
"expand",
"a",
"parameter",
"entity",
"reference",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L2309-L2340 |
112,609 | validator/validator | src/nu/validator/gnu/xml/aelfred2/XmlParser.java | XmlParser.parseEntityDecl | private void parseEntityDecl() throws Exception {
boolean peFlag = false;
int flags = 0;
// Check for a parameter entity.
expandPE = false;
requireWhitespace();
if (tryRead('%')) {
peFlag = true;
requireWhitespace();
}
expandPE = t... | java | private void parseEntityDecl() throws Exception {
boolean peFlag = false;
int flags = 0;
// Check for a parameter entity.
expandPE = false;
requireWhitespace();
if (tryRead('%')) {
peFlag = true;
requireWhitespace();
}
expandPE = t... | [
"private",
"void",
"parseEntityDecl",
"(",
")",
"throws",
"Exception",
"{",
"boolean",
"peFlag",
"=",
"false",
";",
"int",
"flags",
"=",
"0",
";",
"// Check for a parameter entity.",
"expandPE",
"=",
"false",
";",
"requireWhitespace",
"(",
")",
";",
"if",
"(",... | Parse an entity declaration.
<pre>
[70] EntityDecl ::= GEDecl | PEDecl
[71] GEDecl ::= '<!ENTITY' S Name S EntityDef S? '>'
[72] PEDecl ::= '<!ENTITY' S '%' S Name S PEDef S? '>'
[73] EntityDef ::= EntityValue | (ExternalID NDataDecl?)
[74] PEDef ::= EntityValue | ExternalID
[75] ExternalID ::= 'SYSTEM' S ... | [
"Parse",
"an",
"entity",
"declaration",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L2359-L2423 |
112,610 | validator/validator | src/nu/validator/gnu/xml/aelfred2/XmlParser.java | XmlParser.parseNotationDecl | private void parseNotationDecl() throws Exception {
String nname;
ExternalIdentifiers ids;
requireWhitespace();
nname = readNmtoken(true);
// NE08
if (nname.indexOf(':') >= 0) {
fatal("Illegal character(':') in notation name ", nname, null);
}
... | java | private void parseNotationDecl() throws Exception {
String nname;
ExternalIdentifiers ids;
requireWhitespace();
nname = readNmtoken(true);
// NE08
if (nname.indexOf(':') >= 0) {
fatal("Illegal character(':') in notation name ", nname, null);
}
... | [
"private",
"void",
"parseNotationDecl",
"(",
")",
"throws",
"Exception",
"{",
"String",
"nname",
";",
"ExternalIdentifiers",
"ids",
";",
"requireWhitespace",
"(",
")",
";",
"nname",
"=",
"readNmtoken",
"(",
"true",
")",
";",
"// NE08",
"if",
"(",
"nname",
".... | Parse a notation declaration.
<pre>
[82] NotationDecl ::= '<!NOTATION' S Name S
(ExternalID | PublicID) S? '>'
[83] PublicID ::= 'PUBLIC' S PubidLiteral
</pre>
<P>
NOTE: the '<!NOTATION' has already been read. | [
"Parse",
"a",
"notation",
"declaration",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L2437-L2457 |
112,611 | validator/validator | src/nu/validator/gnu/xml/aelfred2/XmlParser.java | XmlParser.parseCharData | private void parseCharData() throws Exception {
char c;
int state = 0;
boolean pureWhite = false;
// assert (dataBufferPos == 0);
// are we expecting pure whitespace? it might be dirty...
if ((currentElementContent == CONTENT_ELEMENTS)
&& !isDirtyCurrent... | java | private void parseCharData() throws Exception {
char c;
int state = 0;
boolean pureWhite = false;
// assert (dataBufferPos == 0);
// are we expecting pure whitespace? it might be dirty...
if ((currentElementContent == CONTENT_ELEMENTS)
&& !isDirtyCurrent... | [
"private",
"void",
"parseCharData",
"(",
")",
"throws",
"Exception",
"{",
"char",
"c",
";",
"int",
"state",
"=",
"0",
";",
"boolean",
"pureWhite",
"=",
"false",
";",
"// assert (dataBufferPos == 0);",
"// are we expecting pure whitespace? it might be dirty...",
"if",
... | Parse character data.
<pre>
[14] CharData ::= [ˆ<&]* - ([ˆ<&]* ']]>' [ˆ<&]*)
</pre> | [
"Parse",
"character",
"data",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L2466-L2559 |
112,612 | validator/validator | src/nu/validator/gnu/xml/aelfred2/XmlParser.java | XmlParser.requireWhitespace | private void requireWhitespace() throws SAXException, IOException {
char c = readCh();
if (isWhitespace(c)) {
skipWhitespace();
} else {
fatal("whitespace required", c, null);
}
} | java | private void requireWhitespace() throws SAXException, IOException {
char c = readCh();
if (isWhitespace(c)) {
skipWhitespace();
} else {
fatal("whitespace required", c, null);
}
} | [
"private",
"void",
"requireWhitespace",
"(",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"char",
"c",
"=",
"readCh",
"(",
")",
";",
"if",
"(",
"isWhitespace",
"(",
"c",
")",
")",
"{",
"skipWhitespace",
"(",
")",
";",
"}",
"else",
"{",
"fata... | Require whitespace characters. | [
"Require",
"whitespace",
"characters",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L2608-L2615 |
112,613 | validator/validator | src/nu/validator/gnu/xml/aelfred2/XmlParser.java | XmlParser.skipWhitespace | private void skipWhitespace() throws SAXException, IOException {
// OK, do it the slow way.
char c = readCh();
while (isWhitespace(c)) {
c = readCh();
}
unread(c);
} | java | private void skipWhitespace() throws SAXException, IOException {
// OK, do it the slow way.
char c = readCh();
while (isWhitespace(c)) {
c = readCh();
}
unread(c);
} | [
"private",
"void",
"skipWhitespace",
"(",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"// OK, do it the slow way.",
"char",
"c",
"=",
"readCh",
"(",
")",
";",
"while",
"(",
"isWhitespace",
"(",
"c",
")",
")",
"{",
"c",
"=",
"readCh",
"(",
")",
... | Skip whitespace characters.
<pre>
[3] S ::= (#x20 | #x9 | #xd | #xa)+
</pre> | [
"Skip",
"whitespace",
"characters",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L2624-L2631 |
112,614 | validator/validator | src/nu/validator/gnu/xml/aelfred2/XmlParser.java | XmlParser.readExternalIds | private ExternalIdentifiers readExternalIds(boolean inNotation,
boolean isSubset) throws Exception {
char c;
ExternalIdentifiers ids = new ExternalIdentifiers();
int flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF;
if (tryRead("PUBLIC")) {
requireWhi... | java | private ExternalIdentifiers readExternalIds(boolean inNotation,
boolean isSubset) throws Exception {
char c;
ExternalIdentifiers ids = new ExternalIdentifiers();
int flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF;
if (tryRead("PUBLIC")) {
requireWhi... | [
"private",
"ExternalIdentifiers",
"readExternalIds",
"(",
"boolean",
"inNotation",
",",
"boolean",
"isSubset",
")",
"throws",
"Exception",
"{",
"char",
"c",
";",
"ExternalIdentifiers",
"ids",
"=",
"new",
"ExternalIdentifiers",
"(",
")",
";",
"int",
"flags",
"=",
... | Try reading external identifiers. A system identifier is not required for
notations.
@param inNotation
Are we parsing a notation decl?
@param isSubset
Parsing external subset decl (may be omitted)?
@return A three-member String array containing the identifiers, or nulls.
Order: public, system, baseURI. | [
"Try",
"reading",
"external",
"identifiers",
".",
"A",
"system",
"identifier",
"is",
"not",
"required",
"for",
"notations",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L2832-L2885 |
112,615 | validator/validator | src/nu/validator/gnu/xml/aelfred2/XmlParser.java | XmlParser.isWhitespace | private boolean isWhitespace(char c) {
if (c > 0x20) {
return false;
}
if ((c == 0x20) || (c == 0x0a) || (c == 0x09) || (c == 0x0d)) {
return true;
}
return false; // illegal ...
} | java | private boolean isWhitespace(char c) {
if (c > 0x20) {
return false;
}
if ((c == 0x20) || (c == 0x0a) || (c == 0x09) || (c == 0x0d)) {
return true;
}
return false; // illegal ...
} | [
"private",
"boolean",
"isWhitespace",
"(",
"char",
"c",
")",
"{",
"if",
"(",
"c",
">",
"0x20",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"(",
"c",
"==",
"0x20",
")",
"||",
"(",
"c",
"==",
"0x0a",
")",
"||",
"(",
"c",
"==",
"0x09",
")"... | Test if a character is whitespace.
<pre>
[3] S ::= (#x20 | #x9 | #xd | #xa)+
</pre>
@param c
The character to test.
@return true if the character is whitespace. | [
"Test",
"if",
"a",
"character",
"is",
"whitespace",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L2898-L2906 |
112,616 | validator/validator | src/nu/validator/gnu/xml/aelfred2/XmlParser.java | XmlParser.dataBufferAppend | private void dataBufferAppend(char c) {
// Expand buffer if necessary.
if (dataBufferPos >= dataBuffer.length) {
dataBuffer = (char[]) extendArray(dataBuffer, dataBuffer.length,
dataBufferPos);
}
dataBuffer[dataBufferPos++] = c;
} | java | private void dataBufferAppend(char c) {
// Expand buffer if necessary.
if (dataBufferPos >= dataBuffer.length) {
dataBuffer = (char[]) extendArray(dataBuffer, dataBuffer.length,
dataBufferPos);
}
dataBuffer[dataBufferPos++] = c;
} | [
"private",
"void",
"dataBufferAppend",
"(",
"char",
"c",
")",
"{",
"// Expand buffer if necessary.",
"if",
"(",
"dataBufferPos",
">=",
"dataBuffer",
".",
"length",
")",
"{",
"dataBuffer",
"=",
"(",
"char",
"[",
"]",
")",
"extendArray",
"(",
"dataBuffer",
",",
... | Add a character to the data buffer. | [
"Add",
"a",
"character",
"to",
"the",
"data",
"buffer",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L2915-L2922 |
112,617 | validator/validator | src/nu/validator/gnu/xml/aelfred2/XmlParser.java | XmlParser.dataBufferNormalize | private void dataBufferNormalize() {
int i = 0;
int j = 0;
int end = dataBufferPos;
// Skip spaces at the start.
while ((j < end) && (dataBuffer[j] == ' ')) {
j++;
}
// Skip whitespace at the end.
while ((end > j) && (dataBuffer[end - 1] == '... | java | private void dataBufferNormalize() {
int i = 0;
int j = 0;
int end = dataBufferPos;
// Skip spaces at the start.
while ((j < end) && (dataBuffer[j] == ' ')) {
j++;
}
// Skip whitespace at the end.
while ((end > j) && (dataBuffer[end - 1] == '... | [
"private",
"void",
"dataBufferNormalize",
"(",
")",
"{",
"int",
"i",
"=",
"0",
";",
"int",
"j",
"=",
"0",
";",
"int",
"end",
"=",
"dataBufferPos",
";",
"// Skip spaces at the start.",
"while",
"(",
"(",
"j",
"<",
"end",
")",
"&&",
"(",
"dataBuffer",
"[... | Normalise space characters in the data buffer. | [
"Normalise",
"space",
"characters",
"in",
"the",
"data",
"buffer",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L2945-L2980 |
112,618 | validator/validator | src/nu/validator/gnu/xml/aelfred2/XmlParser.java | XmlParser.dataBufferFlush | private void dataBufferFlush() throws SAXException {
int saveLine = line;
int saveColumn = column;
line = linePrev;
column = columnPrev;
if ((currentElementContent == CONTENT_ELEMENTS) && (dataBufferPos > 0)
&& !inCDATA) {
// We can't just trust the bu... | java | private void dataBufferFlush() throws SAXException {
int saveLine = line;
int saveColumn = column;
line = linePrev;
column = columnPrev;
if ((currentElementContent == CONTENT_ELEMENTS) && (dataBufferPos > 0)
&& !inCDATA) {
// We can't just trust the bu... | [
"private",
"void",
"dataBufferFlush",
"(",
")",
"throws",
"SAXException",
"{",
"int",
"saveLine",
"=",
"line",
";",
"int",
"saveColumn",
"=",
"column",
";",
"line",
"=",
"linePrev",
";",
"column",
"=",
"columnPrev",
";",
"if",
"(",
"(",
"currentElementConten... | Flush the contents of the data buffer to the handler, as appropriate, and
reset the buffer for new input. | [
"Flush",
"the",
"contents",
"of",
"the",
"data",
"buffer",
"to",
"the",
"handler",
"as",
"appropriate",
"and",
"reset",
"the",
"buffer",
"for",
"new",
"input",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L2995-L3020 |
112,619 | validator/validator | src/nu/validator/gnu/xml/aelfred2/XmlParser.java | XmlParser.require | private void require(char delim) throws SAXException, IOException {
char c = readCh();
if (c != delim) {
fatal("required character", c, Character.valueOf(delim).toString());
}
} | java | private void require(char delim) throws SAXException, IOException {
char c = readCh();
if (c != delim) {
fatal("required character", c, Character.valueOf(delim).toString());
}
} | [
"private",
"void",
"require",
"(",
"char",
"delim",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"char",
"c",
"=",
"readCh",
"(",
")",
";",
"if",
"(",
"c",
"!=",
"delim",
")",
"{",
"fatal",
"(",
"\"required character\"",
",",
"c",
",",
"Char... | Require a character to appear, or throw an exception. | [
"Require",
"a",
"character",
"to",
"appear",
"or",
"throw",
"an",
"exception",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L3049-L3055 |
112,620 | validator/validator | src/nu/validator/gnu/xml/aelfred2/XmlParser.java | XmlParser.extendArray | private Object extendArray(Object array, int currentSize, int requiredSize) {
if (requiredSize < currentSize) {
return array;
} else {
Object newArray = null;
int newSize = currentSize * 2;
if (newSize <= requiredSize) {
newSize = required... | java | private Object extendArray(Object array, int currentSize, int requiredSize) {
if (requiredSize < currentSize) {
return array;
} else {
Object newArray = null;
int newSize = currentSize * 2;
if (newSize <= requiredSize) {
newSize = required... | [
"private",
"Object",
"extendArray",
"(",
"Object",
"array",
",",
"int",
"currentSize",
",",
"int",
"requiredSize",
")",
"{",
"if",
"(",
"requiredSize",
"<",
"currentSize",
")",
"{",
"return",
"array",
";",
"}",
"else",
"{",
"Object",
"newArray",
"=",
"null... | Ensure the capacity of an array, allocating a new one if necessary.
Usually extends only for name hash collisions. | [
"Ensure",
"the",
"capacity",
"of",
"an",
"array",
"allocating",
"a",
"new",
"one",
"if",
"necessary",
".",
"Usually",
"extends",
"only",
"for",
"name",
"hash",
"collisions",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L3139-L3885 |
112,621 | validator/validator | src/nu/validator/gnu/xml/aelfred2/XmlParser.java | XmlParser.filterCR | private void filterCR(boolean moreData) {
int i, j;
readBufferOverflow = -1;
loop: for (i = j = readBufferPos; j < readBufferLength; i++, j++) {
switch (readBuffer[j]) {
case '\r':
if (j == readBufferLength - 1) {
if (more... | java | private void filterCR(boolean moreData) {
int i, j;
readBufferOverflow = -1;
loop: for (i = j = readBufferPos; j < readBufferLength; i++, j++) {
switch (readBuffer[j]) {
case '\r':
if (j == readBufferLength - 1) {
if (more... | [
"private",
"void",
"filterCR",
"(",
"boolean",
"moreData",
")",
"{",
"int",
"i",
",",
"j",
";",
"readBufferOverflow",
"=",
"-",
"1",
";",
"loop",
":",
"for",
"(",
"i",
"=",
"j",
"=",
"readBufferPos",
";",
"j",
"<",
"readBufferLength",
";",
"i",
"++",... | Filter carriage returns in the read buffer. CRLF becomes LF; CR becomes
LF.
@param moreData
true iff more data might come from the same source
@see #readDataChunk
@see #readBuffer
@see #readBufferOverflow | [
"Filter",
"carriage",
"returns",
"in",
"the",
"read",
"buffer",
".",
"CRLF",
"becomes",
"LF",
";",
"CR",
"becomes",
"LF",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L4527-L4557 |
112,622 | validator/validator | src/nu/validator/gnu/xml/aelfred2/XmlParser.java | XmlParser.initializeVariables | private void initializeVariables() throws SAXException {
prev = '\u0000';
// First line
line = 0;
column = 1;
linePrev = 0;
columnPrev = 1;
nextCharOnNewLine = true;
// Set up the buffers for data and names
dataBufferPos = 0;
dataBuffer = ... | java | private void initializeVariables() throws SAXException {
prev = '\u0000';
// First line
line = 0;
column = 1;
linePrev = 0;
columnPrev = 1;
nextCharOnNewLine = true;
// Set up the buffers for data and names
dataBufferPos = 0;
dataBuffer = ... | [
"private",
"void",
"initializeVariables",
"(",
")",
"throws",
"SAXException",
"{",
"prev",
"=",
"'",
"'",
";",
"// First line",
"line",
"=",
"0",
";",
"column",
"=",
"1",
";",
"linePrev",
"=",
"0",
";",
"columnPrev",
"=",
"1",
";",
"nextCharOnNewLine",
"... | Re-initialize the variables for each parse.
@throws SAXException | [
"Re",
"-",
"initialize",
"the",
"variables",
"for",
"each",
"parse",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L4595-L4654 |
112,623 | validator/validator | src/nu/validator/checker/NormalizationChecker.java | NormalizationChecker.characters | @SuppressWarnings("deprecation")
@Override
public void characters(char[] ch, int start, int length)
throws SAXException {
if (alreadyComplainedAboutThisRun) {
return;
}
if (atStartOfRun) {
char c = ch[start];
if (pos == 1) {
... | java | @SuppressWarnings("deprecation")
@Override
public void characters(char[] ch, int start, int length)
throws SAXException {
if (alreadyComplainedAboutThisRun) {
return;
}
if (atStartOfRun) {
char c = ch[start];
if (pos == 1) {
... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"@",
"Override",
"public",
"void",
"characters",
"(",
"char",
"[",
"]",
"ch",
",",
"int",
"start",
",",
"int",
"length",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"alreadyComplainedAboutThisRun",
")",
... | In the normal mode, this method has the usual SAX semantics. In the
source text mode, this method is used for reporting the source text.
@see nu.validator.checker.Checker#characters(char[], int, int) | [
"In",
"the",
"normal",
"mode",
"this",
"method",
"has",
"the",
"usual",
"SAX",
"semantics",
".",
"In",
"the",
"source",
"text",
"mode",
"this",
"method",
"is",
"used",
"for",
"reporting",
"the",
"source",
"text",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/checker/NormalizationChecker.java#L208-L272 |
112,624 | validator/validator | src/nu/validator/checker/NormalizationChecker.java | NormalizationChecker.appendToBuf | private void appendToBuf(char[] ch, int start, int end) {
if (start == end) {
return;
}
int neededBufLen = pos + (end - start);
if (neededBufLen > buf.length) {
char[] newBuf = new char[neededBufLen];
System.arraycopy(buf, 0, newBuf, 0, pos);
... | java | private void appendToBuf(char[] ch, int start, int end) {
if (start == end) {
return;
}
int neededBufLen = pos + (end - start);
if (neededBufLen > buf.length) {
char[] newBuf = new char[neededBufLen];
System.arraycopy(buf, 0, newBuf, 0, pos);
... | [
"private",
"void",
"appendToBuf",
"(",
"char",
"[",
"]",
"ch",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"if",
"(",
"start",
"==",
"end",
")",
"{",
"return",
";",
"}",
"int",
"neededBufLen",
"=",
"pos",
"+",
"(",
"end",
"-",
"start",
")",... | Appends a slice of an UTF-16 code unit array to the internal
buffer.
@param ch the array from which to copy
@param start the index of the first element that is copied
@param end the index of the first element that is not copied | [
"Appends",
"a",
"slice",
"of",
"an",
"UTF",
"-",
"16",
"code",
"unit",
"array",
"to",
"the",
"internal",
"buffer",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/checker/NormalizationChecker.java#L297-L312 |
112,625 | validator/validator | src/nu/validator/gnu/xml/aelfred2/SAXDriver.java | SAXDriver.verror | void verror(String message) throws SAXException {
SAXParseException err;
err = new SAXParseException(message, this);
errorHandler.error(err);
} | java | void verror(String message) throws SAXException {
SAXParseException err;
err = new SAXParseException(message, this);
errorHandler.error(err);
} | [
"void",
"verror",
"(",
"String",
"message",
")",
"throws",
"SAXException",
"{",
"SAXParseException",
"err",
";",
"err",
"=",
"new",
"SAXParseException",
"(",
"message",
",",
"this",
")",
";",
"errorHandler",
".",
"error",
"(",
"err",
")",
";",
"}"
] | make layered SAX2 DTD validation more conformant | [
"make",
"layered",
"SAX2",
"DTD",
"validation",
"more",
"conformant"
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/SAXDriver.java#L1111-L1116 |
112,626 | validator/validator | src/nu/validator/xml/PrudentHttpEntityResolver.java | PrudentHttpEntityResolver.setParams | public static void setParams(int connectionTimeout, int socketTimeout,
int maxRequests) {
PrudentHttpEntityResolver.maxRequests = maxRequests;
PoolingHttpClientConnectionManager phcConnMgr;
Registry<ConnectionSocketFactory> registry = //
RegistryBuilder.<ConnectionSocketFacto... | java | public static void setParams(int connectionTimeout, int socketTimeout,
int maxRequests) {
PrudentHttpEntityResolver.maxRequests = maxRequests;
PoolingHttpClientConnectionManager phcConnMgr;
Registry<ConnectionSocketFactory> registry = //
RegistryBuilder.<ConnectionSocketFacto... | [
"public",
"static",
"void",
"setParams",
"(",
"int",
"connectionTimeout",
",",
"int",
"socketTimeout",
",",
"int",
"maxRequests",
")",
"{",
"PrudentHttpEntityResolver",
".",
"maxRequests",
"=",
"maxRequests",
";",
"PoolingHttpClientConnectionManager",
"phcConnMgr",
";",... | Sets the timeouts of the HTTP client.
@param connectionTimeout
timeout until connection established in milliseconds. Zero
means no timeout.
@param socketTimeout
timeout for waiting for data in milliseconds. Zero means no
timeout.
@param maxRequests
maximum number of connections to a particular host | [
"Sets",
"the",
"timeouts",
"of",
"the",
"HTTP",
"client",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/xml/PrudentHttpEntityResolver.java#L128-L181 |
112,627 | validator/validator | src/nu/validator/checker/table/Cell.java | Cell.errOnHorizontalOverlap | public void errOnHorizontalOverlap(Cell laterCell) throws SAXException {
if (!((laterCell.right <= left) || (right <= laterCell.left))) {
this.err("Table cell is overlapped by later table cell.");
laterCell.err("Table cell overlaps an earlier table cell.");
}
} | java | public void errOnHorizontalOverlap(Cell laterCell) throws SAXException {
if (!((laterCell.right <= left) || (right <= laterCell.left))) {
this.err("Table cell is overlapped by later table cell.");
laterCell.err("Table cell overlaps an earlier table cell.");
}
} | [
"public",
"void",
"errOnHorizontalOverlap",
"(",
"Cell",
"laterCell",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"!",
"(",
"(",
"laterCell",
".",
"right",
"<=",
"left",
")",
"||",
"(",
"right",
"<=",
"laterCell",
".",
"left",
")",
")",
")",
"{",
"t... | Emit errors if this cell and the argument overlap horizontally.
@param laterCell another cell
@throws SAXException if the <code>ErrorHandler</code> throws | [
"Emit",
"errors",
"if",
"this",
"cell",
"and",
"the",
"argument",
"overlap",
"horizontally",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/checker/table/Cell.java#L167-L172 |
112,628 | validator/validator | src/nu/validator/checker/Checker.java | Checker.warn | public void warn(String message) throws SAXException {
if (errorHandler != null) {
SAXParseException spe = new SAXParseException(message, locator);
errorHandler.warning(spe);
}
} | java | public void warn(String message) throws SAXException {
if (errorHandler != null) {
SAXParseException spe = new SAXParseException(message, locator);
errorHandler.warning(spe);
}
} | [
"public",
"void",
"warn",
"(",
"String",
"message",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"errorHandler",
"!=",
"null",
")",
"{",
"SAXParseException",
"spe",
"=",
"new",
"SAXParseException",
"(",
"message",
",",
"locator",
")",
";",
"errorHandler",
... | Emit a warning. The locator is used.
@param message the warning message
@throws SAXException if something goes wrong | [
"Emit",
"a",
"warning",
".",
"The",
"locator",
"is",
"used",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/checker/Checker.java#L67-L72 |
112,629 | validator/validator | src/nu/validator/checker/Checker.java | Checker.warn | public void warn(String message, Locator overrideLocator) throws SAXException {
if (errorHandler != null) {
SAXParseException spe = new SAXParseException(message, overrideLocator);
errorHandler.warning(spe);
}
} | java | public void warn(String message, Locator overrideLocator) throws SAXException {
if (errorHandler != null) {
SAXParseException spe = new SAXParseException(message, overrideLocator);
errorHandler.warning(spe);
}
} | [
"public",
"void",
"warn",
"(",
"String",
"message",
",",
"Locator",
"overrideLocator",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"errorHandler",
"!=",
"null",
")",
"{",
"SAXParseException",
"spe",
"=",
"new",
"SAXParseException",
"(",
"message",
",",
"ove... | Emit a warning with specified locator.
@param message the warning message
@throws SAXException if something goes wrong | [
"Emit",
"a",
"warning",
"with",
"specified",
"locator",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/checker/Checker.java#L80-L85 |
112,630 | validator/validator | src/nu/validator/checker/Checker.java | Checker.err | public void err(String message, Locator overrideLocator) throws SAXException {
if (errorHandler != null) {
SAXParseException spe = new SAXParseException(message, overrideLocator);
errorHandler.error(spe);
}
} | java | public void err(String message, Locator overrideLocator) throws SAXException {
if (errorHandler != null) {
SAXParseException spe = new SAXParseException(message, overrideLocator);
errorHandler.error(spe);
}
} | [
"public",
"void",
"err",
"(",
"String",
"message",
",",
"Locator",
"overrideLocator",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"errorHandler",
"!=",
"null",
")",
"{",
"SAXParseException",
"spe",
"=",
"new",
"SAXParseException",
"(",
"message",
",",
"over... | Emit an error with specified locator.
@param message the error message
@throws SAXException if something goes wrong | [
"Emit",
"an",
"error",
"with",
"specified",
"locator",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/checker/Checker.java#L93-L98 |
112,631 | validator/validator | src/nu/validator/checker/Checker.java | Checker.err | public void err(String message) throws SAXException {
if (errorHandler != null) {
SAXParseException spe = new SAXParseException(message, locator);
errorHandler.error(spe);
}
} | java | public void err(String message) throws SAXException {
if (errorHandler != null) {
SAXParseException spe = new SAXParseException(message, locator);
errorHandler.error(spe);
}
} | [
"public",
"void",
"err",
"(",
"String",
"message",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"errorHandler",
"!=",
"null",
")",
"{",
"SAXParseException",
"spe",
"=",
"new",
"SAXParseException",
"(",
"message",
",",
"locator",
")",
";",
"errorHandler",
"... | Emit an error. The locator is used.
@param message the error message
@throws SAXException if something goes wrong | [
"Emit",
"an",
"error",
".",
"The",
"locator",
"is",
"used",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/checker/Checker.java#L106-L111 |
112,632 | validator/validator | src/nu/validator/client/EmbeddedValidator.java | EmbeddedValidator.validate | public String validate(Path path) throws IOException, SAXException {
try (OneOffValidator validator = new OneOffValidator(asciiQuotes, detectLanguages, forceHTML, lineOffset, loadEntities, noStream, outputFormat, schemaUrl)) {
return validator.validate(path);
}
} | java | public String validate(Path path) throws IOException, SAXException {
try (OneOffValidator validator = new OneOffValidator(asciiQuotes, detectLanguages, forceHTML, lineOffset, loadEntities, noStream, outputFormat, schemaUrl)) {
return validator.validate(path);
}
} | [
"public",
"String",
"validate",
"(",
"Path",
"path",
")",
"throws",
"IOException",
",",
"SAXException",
"{",
"try",
"(",
"OneOffValidator",
"validator",
"=",
"new",
"OneOffValidator",
"(",
"asciiQuotes",
",",
"detectLanguages",
",",
"forceHTML",
",",
"lineOffset",... | Validate the file at the given path
@param path
a valid {@link Path} to a readable file
@return validation output {@link String}
@throws IllegalStateException
@throws IOException
@throws SAXException | [
"Validate",
"the",
"file",
"at",
"the",
"given",
"path"
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/client/EmbeddedValidator.java#L81-L85 |
112,633 | validator/validator | src/nu/validator/client/EmbeddedValidator.java | EmbeddedValidator.validate | public String validate(InputStream in) throws IOException, SAXException {
try (OneOffValidator validator = new OneOffValidator(asciiQuotes, detectLanguages, forceHTML, lineOffset, loadEntities, noStream, outputFormat, schemaUrl)) {
return validator.validate(in);
}
} | java | public String validate(InputStream in) throws IOException, SAXException {
try (OneOffValidator validator = new OneOffValidator(asciiQuotes, detectLanguages, forceHTML, lineOffset, loadEntities, noStream, outputFormat, schemaUrl)) {
return validator.validate(in);
}
} | [
"public",
"String",
"validate",
"(",
"InputStream",
"in",
")",
"throws",
"IOException",
",",
"SAXException",
"{",
"try",
"(",
"OneOffValidator",
"validator",
"=",
"new",
"OneOffValidator",
"(",
"asciiQuotes",
",",
"detectLanguages",
",",
"forceHTML",
",",
"lineOff... | Validate the input source
@param in
a valid {@link InputStream} to a readable file
@return validation output {@link String}
@throws IllegalStateException
@throws IOException
@throws SAXException | [
"Validate",
"the",
"input",
"source"
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/client/EmbeddedValidator.java#L97-L101 |
112,634 | validator/validator | src/nu/validator/checker/table/TableChecker.java | TableChecker.pop | private void pop() throws SAXException {
if (current == null) {
throw new IllegalStateException("Bug!");
}
current.end();
if (stack.isEmpty()) {
current = null;
} else {
current = stack.removeLast();
}
} | java | private void pop() throws SAXException {
if (current == null) {
throw new IllegalStateException("Bug!");
}
current.end();
if (stack.isEmpty()) {
current = null;
} else {
current = stack.removeLast();
}
} | [
"private",
"void",
"pop",
"(",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"current",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Bug!\"",
")",
";",
"}",
"current",
".",
"end",
"(",
")",
";",
"if",
"(",
"stack",
".",
"... | Ends the current table, discards it and pops the top of the
stack to be the new current table.
@throws SAXException if ending the table throws | [
"Ends",
"the",
"current",
"table",
"discards",
"it",
"and",
"pops",
"the",
"top",
"of",
"the",
"stack",
"to",
"be",
"the",
"new",
"current",
"table",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/checker/table/TableChecker.java#L80-L90 |
112,635 | validator/validator | src/nu/validator/checker/AttributeUtil.java | AttributeUtil.split | public static String[] split(String value) {
if (value == null || "".equals(value)) {
return EMPTY_STRING_ARRAY;
}
int len = value.length();
List<String> list = new LinkedList<>();
boolean collectingSpace = true;
int start = 0;
for (int i = 0; i < len;... | java | public static String[] split(String value) {
if (value == null || "".equals(value)) {
return EMPTY_STRING_ARRAY;
}
int len = value.length();
List<String> list = new LinkedList<>();
boolean collectingSpace = true;
int start = 0;
for (int i = 0; i < len;... | [
"public",
"static",
"String",
"[",
"]",
"split",
"(",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
"||",
"\"\"",
".",
"equals",
"(",
"value",
")",
")",
"{",
"return",
"EMPTY_STRING_ARRAY",
";",
"}",
"int",
"len",
"=",
"value",
".",
... | Splits the argument on white space.
@param value the attribute value
@return a string array with zero or more strings none of which
is the empty string and none of which contains white space characters. | [
"Splits",
"the",
"argument",
"on",
"white",
"space",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/checker/AttributeUtil.java#L102-L137 |
112,636 | spring-projects/spring-shell | spring-shell-core/src/main/java/org/springframework/shell/Shell.java | Shell.evaluate | public Object evaluate(Input input) {
if (noInput(input)) {
return NO_INPUT;
}
String line = input.words().stream().collect(Collectors.joining(" ")).trim();
String command = findLongestCommand(line);
List<String> words = input.words();
if (command != null) {
MethodTarget methodTarget = methodTargets... | java | public Object evaluate(Input input) {
if (noInput(input)) {
return NO_INPUT;
}
String line = input.words().stream().collect(Collectors.joining(" ")).trim();
String command = findLongestCommand(line);
List<String> words = input.words();
if (command != null) {
MethodTarget methodTarget = methodTargets... | [
"public",
"Object",
"evaluate",
"(",
"Input",
"input",
")",
"{",
"if",
"(",
"noInput",
"(",
"input",
")",
")",
"{",
"return",
"NO_INPUT",
";",
"}",
"String",
"line",
"=",
"input",
".",
"words",
"(",
")",
".",
"stream",
"(",
")",
".",
"collect",
"("... | Evaluate a single "line" of input from the user by trying to map words to a command and
arguments.
<p>
This method does not throw exceptions, it catches them and returns them as a regular
result
</p> | [
"Evaluate",
"a",
"single",
"line",
"of",
"input",
"from",
"the",
"user",
"by",
"trying",
"to",
"map",
"words",
"to",
"a",
"command",
"and",
"arguments",
"."
] | 23d99f45eb8f487e31a1f080c837061313bbfafa | https://github.com/spring-projects/spring-shell/blob/23d99f45eb8f487e31a1f080c837061313bbfafa/spring-shell-core/src/main/java/org/springframework/shell/Shell.java#L158-L202 |
112,637 | spring-projects/spring-shell | spring-shell-table/src/main/java/org/springframework/shell/table/TableBuilder.java | TableBuilder.addOutlineBorder | public TableBuilder addOutlineBorder(BorderStyle style) {
this.addBorder(0, 0, model.getRowCount(), model.getColumnCount(), OUTLINE, style);
return this;
} | java | public TableBuilder addOutlineBorder(BorderStyle style) {
this.addBorder(0, 0, model.getRowCount(), model.getColumnCount(), OUTLINE, style);
return this;
} | [
"public",
"TableBuilder",
"addOutlineBorder",
"(",
"BorderStyle",
"style",
")",
"{",
"this",
".",
"addBorder",
"(",
"0",
",",
"0",
",",
"model",
".",
"getRowCount",
"(",
")",
",",
"model",
".",
"getColumnCount",
"(",
")",
",",
"OUTLINE",
",",
"style",
")... | Set a border on the outline of the whole table.
@param style the style to apply
@return this, for method chaining | [
"Set",
"a",
"border",
"on",
"the",
"outline",
"of",
"the",
"whole",
"table",
"."
] | 23d99f45eb8f487e31a1f080c837061313bbfafa | https://github.com/spring-projects/spring-shell/blob/23d99f45eb8f487e31a1f080c837061313bbfafa/spring-shell-table/src/main/java/org/springframework/shell/table/TableBuilder.java#L117-L120 |
112,638 | spring-projects/spring-shell | spring-shell-table/src/main/java/org/springframework/shell/table/TableBuilder.java | TableBuilder.addHeaderBorder | public TableBuilder addHeaderBorder(BorderStyle style) {
this.addBorder(0, 0, 1, model.getColumnCount(), OUTLINE, style);
return addOutlineBorder(style);
} | java | public TableBuilder addHeaderBorder(BorderStyle style) {
this.addBorder(0, 0, 1, model.getColumnCount(), OUTLINE, style);
return addOutlineBorder(style);
} | [
"public",
"TableBuilder",
"addHeaderBorder",
"(",
"BorderStyle",
"style",
")",
"{",
"this",
".",
"addBorder",
"(",
"0",
",",
"0",
",",
"1",
",",
"model",
".",
"getColumnCount",
"(",
")",
",",
"OUTLINE",
",",
"style",
")",
";",
"return",
"addOutlineBorder",... | Set a border on the outline of the whole table, as well as around the first row.
@param style the style to apply
@return this, for method chaining | [
"Set",
"a",
"border",
"on",
"the",
"outline",
"of",
"the",
"whole",
"table",
"as",
"well",
"as",
"around",
"the",
"first",
"row",
"."
] | 23d99f45eb8f487e31a1f080c837061313bbfafa | https://github.com/spring-projects/spring-shell/blob/23d99f45eb8f487e31a1f080c837061313bbfafa/spring-shell-table/src/main/java/org/springframework/shell/table/TableBuilder.java#L127-L130 |
112,639 | spring-projects/spring-shell | spring-shell-table/src/main/java/org/springframework/shell/table/TableBuilder.java | TableBuilder.addFullBorder | public TableBuilder addFullBorder(BorderStyle style) {
this.addBorder(0, 0, model.getRowCount(), model.getColumnCount(), FULL, style);
return this;
} | java | public TableBuilder addFullBorder(BorderStyle style) {
this.addBorder(0, 0, model.getRowCount(), model.getColumnCount(), FULL, style);
return this;
} | [
"public",
"TableBuilder",
"addFullBorder",
"(",
"BorderStyle",
"style",
")",
"{",
"this",
".",
"addBorder",
"(",
"0",
",",
"0",
",",
"model",
".",
"getRowCount",
"(",
")",
",",
"model",
".",
"getColumnCount",
"(",
")",
",",
"FULL",
",",
"style",
")",
"... | Set a border around each and every cell of the table.
@param style the style to apply
@return this, for method chaining | [
"Set",
"a",
"border",
"around",
"each",
"and",
"every",
"cell",
"of",
"the",
"table",
"."
] | 23d99f45eb8f487e31a1f080c837061313bbfafa | https://github.com/spring-projects/spring-shell/blob/23d99f45eb8f487e31a1f080c837061313bbfafa/spring-shell-table/src/main/java/org/springframework/shell/table/TableBuilder.java#L138-L141 |
112,640 | spring-projects/spring-shell | spring-shell-table/src/main/java/org/springframework/shell/table/TableBuilder.java | TableBuilder.addHeaderAndVerticalsBorders | public TableBuilder addHeaderAndVerticalsBorders(BorderStyle style) {
this.addBorder(0, 0, 1, model.getColumnCount(), OUTLINE, style);
this.addBorder(0, 0, model.getRowCount(), model.getColumnCount(), OUTLINE | INNER_VERTICAL, style);
return this;
} | java | public TableBuilder addHeaderAndVerticalsBorders(BorderStyle style) {
this.addBorder(0, 0, 1, model.getColumnCount(), OUTLINE, style);
this.addBorder(0, 0, model.getRowCount(), model.getColumnCount(), OUTLINE | INNER_VERTICAL, style);
return this;
} | [
"public",
"TableBuilder",
"addHeaderAndVerticalsBorders",
"(",
"BorderStyle",
"style",
")",
"{",
"this",
".",
"addBorder",
"(",
"0",
",",
"0",
",",
"1",
",",
"model",
".",
"getColumnCount",
"(",
")",
",",
"OUTLINE",
",",
"style",
")",
";",
"this",
".",
"... | Set a border on the outline of the whole table, around the first row and draw vertical lines
around each column.
@param style the style to apply
@return this, for method chaining | [
"Set",
"a",
"border",
"on",
"the",
"outline",
"of",
"the",
"whole",
"table",
"around",
"the",
"first",
"row",
"and",
"draw",
"vertical",
"lines",
"around",
"each",
"column",
"."
] | 23d99f45eb8f487e31a1f080c837061313bbfafa | https://github.com/spring-projects/spring-shell/blob/23d99f45eb8f487e31a1f080c837061313bbfafa/spring-shell-table/src/main/java/org/springframework/shell/table/TableBuilder.java#L150-L154 |
112,641 | spring-projects/spring-shell | spring-shell-table/src/main/java/org/springframework/shell/table/TableBuilder.java | TableBuilder.addInnerBorder | public TableBuilder addInnerBorder(BorderStyle style) {
this.addBorder(0, 0, model.getRowCount(), model.getColumnCount(), INNER, style);
return this;
} | java | public TableBuilder addInnerBorder(BorderStyle style) {
this.addBorder(0, 0, model.getRowCount(), model.getColumnCount(), INNER, style);
return this;
} | [
"public",
"TableBuilder",
"addInnerBorder",
"(",
"BorderStyle",
"style",
")",
"{",
"this",
".",
"addBorder",
"(",
"0",
",",
"0",
",",
"model",
".",
"getRowCount",
"(",
")",
",",
"model",
".",
"getColumnCount",
"(",
")",
",",
"INNER",
",",
"style",
")",
... | Set a border on the inner verticals and horizontals of the table, but not on the outline.
@param style the style to apply
@return this, for method chaining | [
"Set",
"a",
"border",
"on",
"the",
"inner",
"verticals",
"and",
"horizontals",
"of",
"the",
"table",
"but",
"not",
"on",
"the",
"outline",
"."
] | 23d99f45eb8f487e31a1f080c837061313bbfafa | https://github.com/spring-projects/spring-shell/blob/23d99f45eb8f487e31a1f080c837061313bbfafa/spring-shell-table/src/main/java/org/springframework/shell/table/TableBuilder.java#L162-L165 |
112,642 | spring-projects/spring-shell | spring-shell-table/src/main/java/org/springframework/shell/table/Tables.java | Tables.configureKeyValueRendering | public static TableBuilder configureKeyValueRendering(TableBuilder builder, String delimiter) {
return builder.on(CellMatchers.ofType(Map.class))
.addFormatter(new MapFormatter(delimiter))
.addAligner(new KeyValueHorizontalAligner(delimiter.trim()))
.addSizer(new KeyValueSizeConstraints(delimiter))
.a... | java | public static TableBuilder configureKeyValueRendering(TableBuilder builder, String delimiter) {
return builder.on(CellMatchers.ofType(Map.class))
.addFormatter(new MapFormatter(delimiter))
.addAligner(new KeyValueHorizontalAligner(delimiter.trim()))
.addSizer(new KeyValueSizeConstraints(delimiter))
.a... | [
"public",
"static",
"TableBuilder",
"configureKeyValueRendering",
"(",
"TableBuilder",
"builder",
",",
"String",
"delimiter",
")",
"{",
"return",
"builder",
".",
"on",
"(",
"CellMatchers",
".",
"ofType",
"(",
"Map",
".",
"class",
")",
")",
".",
"addFormatter",
... | Install all the necessary formatters, aligners, etc for key-value rendering of Maps.
@param builder the builder to configure
@param delimiter the delimiter to apply between keys and values
@return buider for method chaining | [
"Install",
"all",
"the",
"necessary",
"formatters",
"aligners",
"etc",
"for",
"key",
"-",
"value",
"rendering",
"of",
"Maps",
"."
] | 23d99f45eb8f487e31a1f080c837061313bbfafa | https://github.com/spring-projects/spring-shell/blob/23d99f45eb8f487e31a1f080c837061313bbfafa/spring-shell-table/src/main/java/org/springframework/shell/table/Tables.java#L35-L41 |
112,643 | spring-projects/spring-shell | spring-shell-core/src/main/java/org/springframework/shell/jline/InteractiveShellApplicationRunner.java | InteractiveShellApplicationRunner.disable | public static void disable(ConfigurableEnvironment environment) {
environment.getPropertySources().addFirst(new MapPropertySource("interactive.override",
Collections.singletonMap(SPRING_SHELL_INTERACTIVE_ENABLED, "false")));
} | java | public static void disable(ConfigurableEnvironment environment) {
environment.getPropertySources().addFirst(new MapPropertySource("interactive.override",
Collections.singletonMap(SPRING_SHELL_INTERACTIVE_ENABLED, "false")));
} | [
"public",
"static",
"void",
"disable",
"(",
"ConfigurableEnvironment",
"environment",
")",
"{",
"environment",
".",
"getPropertySources",
"(",
")",
".",
"addFirst",
"(",
"new",
"MapPropertySource",
"(",
"\"interactive.override\"",
",",
"Collections",
".",
"singletonMa... | Helper method to dynamically disable this runner. | [
"Helper",
"method",
"to",
"dynamically",
"disable",
"this",
"runner",
"."
] | 23d99f45eb8f487e31a1f080c837061313bbfafa | https://github.com/spring-projects/spring-shell/blob/23d99f45eb8f487e31a1f080c837061313bbfafa/spring-shell-core/src/main/java/org/springframework/shell/jline/InteractiveShellApplicationRunner.java#L95-L98 |
112,644 | spring-projects/spring-shell | spring-shell-core/src/main/java/org/springframework/shell/Utils.java | Utils.unCamelify | public static String unCamelify(CharSequence original) {
StringBuilder result = new StringBuilder(original.length());
boolean wasLowercase = false;
for (int i = 0; i < original.length(); i++) {
char ch = original.charAt(i);
if (Character.isUpperCase(ch) && wasLowercase) {
result.append('-');
}
was... | java | public static String unCamelify(CharSequence original) {
StringBuilder result = new StringBuilder(original.length());
boolean wasLowercase = false;
for (int i = 0; i < original.length(); i++) {
char ch = original.charAt(i);
if (Character.isUpperCase(ch) && wasLowercase) {
result.append('-');
}
was... | [
"public",
"static",
"String",
"unCamelify",
"(",
"CharSequence",
"original",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
"original",
".",
"length",
"(",
")",
")",
";",
"boolean",
"wasLowercase",
"=",
"false",
";",
"for",
"(",
"int"... | Turn CamelCaseText into gnu-style-lowercase. | [
"Turn",
"CamelCaseText",
"into",
"gnu",
"-",
"style",
"-",
"lowercase",
"."
] | 23d99f45eb8f487e31a1f080c837061313bbfafa | https://github.com/spring-projects/spring-shell/blob/23d99f45eb8f487e31a1f080c837061313bbfafa/spring-shell-core/src/main/java/org/springframework/shell/Utils.java#L39-L51 |
112,645 | spring-projects/spring-shell | spring-shell-core/src/main/java/org/springframework/shell/Utils.java | Utils.createMethodParameter | public static MethodParameter createMethodParameter(Executable executable, int i) {
MethodParameter methodParameter;
if (executable instanceof Method) {
methodParameter = new MethodParameter((Method) executable, i);
} else if (executable instanceof Constructor){
methodParameter = new MethodParameter((Constr... | java | public static MethodParameter createMethodParameter(Executable executable, int i) {
MethodParameter methodParameter;
if (executable instanceof Method) {
methodParameter = new MethodParameter((Method) executable, i);
} else if (executable instanceof Constructor){
methodParameter = new MethodParameter((Constr... | [
"public",
"static",
"MethodParameter",
"createMethodParameter",
"(",
"Executable",
"executable",
",",
"int",
"i",
")",
"{",
"MethodParameter",
"methodParameter",
";",
"if",
"(",
"executable",
"instanceof",
"Method",
")",
"{",
"methodParameter",
"=",
"new",
"MethodPa... | Return a properly initialized MethodParameter for the given executable and index. | [
"Return",
"a",
"properly",
"initialized",
"MethodParameter",
"for",
"the",
"given",
"executable",
"and",
"index",
"."
] | 23d99f45eb8f487e31a1f080c837061313bbfafa | https://github.com/spring-projects/spring-shell/blob/23d99f45eb8f487e31a1f080c837061313bbfafa/spring-shell-core/src/main/java/org/springframework/shell/Utils.java#L68-L79 |
112,646 | kongchen/swagger-maven-plugin | src/main/java/com/github/kongchen/swagger/docgen/reader/JaxrsReader.java | JaxrsReader.hasCommonParameter | private boolean hasCommonParameter(Parameter parameter) {
Parameter commonParameter = swagger.getParameter(parameter.getName());
return commonParameter != null && parameter.getIn().equals(commonParameter.getIn());
} | java | private boolean hasCommonParameter(Parameter parameter) {
Parameter commonParameter = swagger.getParameter(parameter.getName());
return commonParameter != null && parameter.getIn().equals(commonParameter.getIn());
} | [
"private",
"boolean",
"hasCommonParameter",
"(",
"Parameter",
"parameter",
")",
"{",
"Parameter",
"commonParameter",
"=",
"swagger",
".",
"getParameter",
"(",
"parameter",
".",
"getName",
"(",
")",
")",
";",
"return",
"commonParameter",
"!=",
"null",
"&&",
"para... | Returns true when the swagger object already contains a common parameter
with the same name and type as the passed parameter.
@param parameter The parameter to check.
@return true if the swagger object already contains a common parameter with the same name and type | [
"Returns",
"true",
"when",
"the",
"swagger",
"object",
"already",
"contains",
"a",
"common",
"parameter",
"with",
"the",
"same",
"name",
"and",
"type",
"as",
"the",
"passed",
"parameter",
"."
] | 0709b035ef45e1cb13189cd7f949c52c10557747 | https://github.com/kongchen/swagger-maven-plugin/blob/0709b035ef45e1cb13189cd7f949c52c10557747/src/main/java/com/github/kongchen/swagger/docgen/reader/JaxrsReader.java#L204-L207 |
112,647 | kongchen/swagger-maven-plugin | src/main/java/com/github/kongchen/swagger/docgen/reader/AbstractReader.java | AbstractReader.getParameters | protected final List<Parameter> getParameters(Type type, List<Annotation> annotations) {
return getParameters(type, annotations, typesToSkip);
} | java | protected final List<Parameter> getParameters(Type type, List<Annotation> annotations) {
return getParameters(type, annotations, typesToSkip);
} | [
"protected",
"final",
"List",
"<",
"Parameter",
">",
"getParameters",
"(",
"Type",
"type",
",",
"List",
"<",
"Annotation",
">",
"annotations",
")",
"{",
"return",
"getParameters",
"(",
"type",
",",
"annotations",
",",
"typesToSkip",
")",
";",
"}"
] | this is final to enforce that only the implementation method below can be overridden, to avoid confusion | [
"this",
"is",
"final",
"to",
"enforce",
"that",
"only",
"the",
"implementation",
"method",
"below",
"can",
"be",
"overridden",
"to",
"avoid",
"confusion"
] | 0709b035ef45e1cb13189cd7f949c52c10557747 | https://github.com/kongchen/swagger-maven-plugin/blob/0709b035ef45e1cb13189cd7f949c52c10557747/src/main/java/com/github/kongchen/swagger/docgen/reader/AbstractReader.java#L310-L312 |
112,648 | kongchen/swagger-maven-plugin | src/main/java/com/github/kongchen/swagger/docgen/reader/AbstractReader.java | AbstractReader.getParameters | protected List<Parameter> getParameters(Type type, List<Annotation> annotations, Set<Type> typesToSkip) {
if (!hasValidAnnotations(annotations) || isApiParamHidden(annotations)) {
return Collections.emptyList();
}
Iterator<SwaggerExtension> chain = SwaggerExtensions.chain();
... | java | protected List<Parameter> getParameters(Type type, List<Annotation> annotations, Set<Type> typesToSkip) {
if (!hasValidAnnotations(annotations) || isApiParamHidden(annotations)) {
return Collections.emptyList();
}
Iterator<SwaggerExtension> chain = SwaggerExtensions.chain();
... | [
"protected",
"List",
"<",
"Parameter",
">",
"getParameters",
"(",
"Type",
"type",
",",
"List",
"<",
"Annotation",
">",
"annotations",
",",
"Set",
"<",
"Type",
">",
"typesToSkip",
")",
"{",
"if",
"(",
"!",
"hasValidAnnotations",
"(",
"annotations",
")",
"||... | this method exists so that outside callers can choose their own custom types to skip | [
"this",
"method",
"exists",
"so",
"that",
"outside",
"callers",
"can",
"choose",
"their",
"own",
"custom",
"types",
"to",
"skip"
] | 0709b035ef45e1cb13189cd7f949c52c10557747 | https://github.com/kongchen/swagger-maven-plugin/blob/0709b035ef45e1cb13189cd7f949c52c10557747/src/main/java/com/github/kongchen/swagger/docgen/reader/AbstractReader.java#L315-L347 |
112,649 | kongchen/swagger-maven-plugin | src/main/java/com/github/kongchen/swagger/docgen/util/SpringUtils.java | SpringUtils.getControllerResquestMapping | public static String[] getControllerResquestMapping(Class<?> controllerClazz) {
String[] controllerRequestMappingValues = {};
// Determine if we will use class-level requestmapping or dummy string
RequestMapping classRequestMapping = AnnotationUtils.findAnnotation(controllerClazz, RequestMapping.class);
if (classR... | java | public static String[] getControllerResquestMapping(Class<?> controllerClazz) {
String[] controllerRequestMappingValues = {};
// Determine if we will use class-level requestmapping or dummy string
RequestMapping classRequestMapping = AnnotationUtils.findAnnotation(controllerClazz, RequestMapping.class);
if (classR... | [
"public",
"static",
"String",
"[",
"]",
"getControllerResquestMapping",
"(",
"Class",
"<",
"?",
">",
"controllerClazz",
")",
"{",
"String",
"[",
"]",
"controllerRequestMappingValues",
"=",
"{",
"}",
";",
"// Determine if we will use class-level requestmapping or dummy str... | Extracts all routes from the annotated class
@param controllerClazz
Instrospected class
@return At least 1 route value (empty string) | [
"Extracts",
"all",
"routes",
"from",
"the",
"annotated",
"class"
] | 0709b035ef45e1cb13189cd7f949c52c10557747 | https://github.com/kongchen/swagger-maven-plugin/blob/0709b035ef45e1cb13189cd7f949c52c10557747/src/main/java/com/github/kongchen/swagger/docgen/util/SpringUtils.java#L19-L33 |
112,650 | kongchen/swagger-maven-plugin | src/main/java/com/github/kongchen/swagger/docgen/mavenplugin/ApiDocumentMojo.java | ApiDocumentMojo.validateConfiguration | private void validateConfiguration(ApiSource apiSource) throws GenerateException {
if (apiSource == null) {
throw new GenerateException("You do not configure any apiSource!");
} else if (apiSource.getInfo() == null) {
throw new GenerateException("`<info>` is required by Swagger S... | java | private void validateConfiguration(ApiSource apiSource) throws GenerateException {
if (apiSource == null) {
throw new GenerateException("You do not configure any apiSource!");
} else if (apiSource.getInfo() == null) {
throw new GenerateException("`<info>` is required by Swagger S... | [
"private",
"void",
"validateConfiguration",
"(",
"ApiSource",
"apiSource",
")",
"throws",
"GenerateException",
"{",
"if",
"(",
"apiSource",
"==",
"null",
")",
"{",
"throw",
"new",
"GenerateException",
"(",
"\"You do not configure any apiSource!\"",
")",
";",
"}",
"e... | validate configuration according to swagger spec and plugin requirement
@param apiSource
@throws GenerateException | [
"validate",
"configuration",
"according",
"to",
"swagger",
"spec",
"and",
"plugin",
"requirement"
] | 0709b035ef45e1cb13189cd7f949c52c10557747 | https://github.com/kongchen/swagger-maven-plugin/blob/0709b035ef45e1cb13189cd7f949c52c10557747/src/main/java/com/github/kongchen/swagger/docgen/mavenplugin/ApiDocumentMojo.java#L174-L196 |
112,651 | kongchen/swagger-maven-plugin | src/main/java/com/github/kongchen/swagger/docgen/AbstractDocumentSource.java | AbstractDocumentSource.loadSwaggerExtensions | private void loadSwaggerExtensions(ApiSource apiSource) throws GenerateException {
if (apiSource.getSwaggerExtensions() != null) {
List<SwaggerExtension> extensions = SwaggerExtensions.getExtensions();
extensions.addAll(resolveSwaggerExtensions());
}
} | java | private void loadSwaggerExtensions(ApiSource apiSource) throws GenerateException {
if (apiSource.getSwaggerExtensions() != null) {
List<SwaggerExtension> extensions = SwaggerExtensions.getExtensions();
extensions.addAll(resolveSwaggerExtensions());
}
} | [
"private",
"void",
"loadSwaggerExtensions",
"(",
"ApiSource",
"apiSource",
")",
"throws",
"GenerateException",
"{",
"if",
"(",
"apiSource",
".",
"getSwaggerExtensions",
"(",
")",
"!=",
"null",
")",
"{",
"List",
"<",
"SwaggerExtension",
">",
"extensions",
"=",
"S... | The reader may modify the extensions list, therefore add the additional swagger extensions
after the instantiation of the reader | [
"The",
"reader",
"may",
"modify",
"the",
"extensions",
"list",
"therefore",
"add",
"the",
"additional",
"swagger",
"extensions",
"after",
"the",
"instantiation",
"of",
"the",
"reader"
] | 0709b035ef45e1cb13189cd7f949c52c10557747 | https://github.com/kongchen/swagger-maven-plugin/blob/0709b035ef45e1cb13189cd7f949c52c10557747/src/main/java/com/github/kongchen/swagger/docgen/AbstractDocumentSource.java#L159-L164 |
112,652 | opencypher/openCypher | tools/grammar/src/main/java/org/opencypher/railroad/Diagram.java | Diagram.diagram | public static Diagram diagram( String name, Figure figure )
{
return new Diagram( requireNonNull( name, "name" ), FigureBuilder.root( requireNonNull( figure, "figure" ) ) );
} | java | public static Diagram diagram( String name, Figure figure )
{
return new Diagram( requireNonNull( name, "name" ), FigureBuilder.root( requireNonNull( figure, "figure" ) ) );
} | [
"public",
"static",
"Diagram",
"diagram",
"(",
"String",
"name",
",",
"Figure",
"figure",
")",
"{",
"return",
"new",
"Diagram",
"(",
"requireNonNull",
"(",
"name",
",",
"\"name\"",
")",
",",
"FigureBuilder",
".",
"root",
"(",
"requireNonNull",
"(",
"figure",... | Factory methods for constructing diagrams directly | [
"Factory",
"methods",
"for",
"constructing",
"diagrams",
"directly"
] | eb780caea625900ddbedd28a1eac9a5dbe09c5f0 | https://github.com/opencypher/openCypher/blob/eb780caea625900ddbedd28a1eac9a5dbe09c5f0/tools/grammar/src/main/java/org/opencypher/railroad/Diagram.java#L256-L259 |
112,653 | opencypher/openCypher | tools/grammar/src/main/java/org/opencypher/tools/Reflection.java | Reflection.defaultInvoker | public static MethodHandle defaultInvoker( Method method )
{
if ( !method.isDefault() )
{
throw new IllegalArgumentException( "Not a default method: " + method );
}
try
{
return LOOKUP.unreflectSpecial( method, method.getDeclaringClass() );
}
... | java | public static MethodHandle defaultInvoker( Method method )
{
if ( !method.isDefault() )
{
throw new IllegalArgumentException( "Not a default method: " + method );
}
try
{
return LOOKUP.unreflectSpecial( method, method.getDeclaringClass() );
}
... | [
"public",
"static",
"MethodHandle",
"defaultInvoker",
"(",
"Method",
"method",
")",
"{",
"if",
"(",
"!",
"method",
".",
"isDefault",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Not a default method: \"",
"+",
"method",
")",
";",
"}"... | Returns a method handle that invoke a default method of an interface.
@param method the (default) method to get a method handle for.
@return a method handle that invokes the specific default method. | [
"Returns",
"a",
"method",
"handle",
"that",
"invoke",
"a",
"default",
"method",
"of",
"an",
"interface",
"."
] | eb780caea625900ddbedd28a1eac9a5dbe09c5f0 | https://github.com/opencypher/openCypher/blob/eb780caea625900ddbedd28a1eac9a5dbe09c5f0/tools/grammar/src/main/java/org/opencypher/tools/Reflection.java#L181-L195 |
112,654 | opencypher/openCypher | tools/grammar/src/main/java/org/opencypher/tools/Reflection.java | Reflection.invoke | public static Object invoke( MethodHandle method, Object target )
{
try
{
return method.invokeWithArguments( target );
}
catch ( RuntimeException | Error e )
{
throw e;
}
catch ( Throwable e )
{
throw new RuntimeExce... | java | public static Object invoke( MethodHandle method, Object target )
{
try
{
return method.invokeWithArguments( target );
}
catch ( RuntimeException | Error e )
{
throw e;
}
catch ( Throwable e )
{
throw new RuntimeExce... | [
"public",
"static",
"Object",
"invoke",
"(",
"MethodHandle",
"method",
",",
"Object",
"target",
")",
"{",
"try",
"{",
"return",
"method",
".",
"invokeWithArguments",
"(",
"target",
")",
";",
"}",
"catch",
"(",
"RuntimeException",
"|",
"Error",
"e",
")",
"{... | Invoke the given method handle with the specified single argument. Handles the exceptions declared by
MethodHandle allowing this method to be used in a context where no checked exceptions may be thrown.
@param method the method handle to invoke.
@param target the argument to pass to the method.
@return the result of i... | [
"Invoke",
"the",
"given",
"method",
"handle",
"with",
"the",
"specified",
"single",
"argument",
".",
"Handles",
"the",
"exceptions",
"declared",
"by",
"MethodHandle",
"allowing",
"this",
"method",
"to",
"be",
"used",
"in",
"a",
"context",
"where",
"no",
"check... | eb780caea625900ddbedd28a1eac9a5dbe09c5f0 | https://github.com/opencypher/openCypher/blob/eb780caea625900ddbedd28a1eac9a5dbe09c5f0/tools/grammar/src/main/java/org/opencypher/tools/Reflection.java#L205-L219 |
112,655 | opencypher/openCypher | tools/grammar/src/main/java/org/opencypher/tools/xml/XmlFile.java | XmlFile.parse | public <T> T parse( XmlParser<T> parser )
throws ParserConfigurationException, SAXException, IOException
{
return resolver.parse( path, parser );
} | java | public <T> T parse( XmlParser<T> parser )
throws ParserConfigurationException, SAXException, IOException
{
return resolver.parse( path, parser );
} | [
"public",
"<",
"T",
">",
"T",
"parse",
"(",
"XmlParser",
"<",
"T",
">",
"parser",
")",
"throws",
"ParserConfigurationException",
",",
"SAXException",
",",
"IOException",
"{",
"return",
"resolver",
".",
"parse",
"(",
"path",
",",
"parser",
")",
";",
"}"
] | Parse this XML document with the given parser.
@param parser the parser to parse the document with.
@param <T> the type of the element produced by parsing the XML document.
@return the object parsed from the XML document.
@throws ParserConfigurationException if an XML (SAX) parser cannot be created.
@throws SAXExce... | [
"Parse",
"this",
"XML",
"document",
"with",
"the",
"given",
"parser",
"."
] | eb780caea625900ddbedd28a1eac9a5dbe09c5f0 | https://github.com/opencypher/openCypher/blob/eb780caea625900ddbedd28a1eac9a5dbe09c5f0/tools/grammar/src/main/java/org/opencypher/tools/xml/XmlFile.java#L61-L65 |
112,656 | opencypher/openCypher | tools/grammar/src/main/java/org/opencypher/tools/xml/XmlFile.java | XmlFile.parseOnce | public <T> Optional<T> parseOnce( XmlParser<? extends T> parser )
throws IOException, SAXException, ParserConfigurationException
{
return resolver.parsed( path ) ? Optional.empty() : Optional.of( parse( parser ) );
} | java | public <T> Optional<T> parseOnce( XmlParser<? extends T> parser )
throws IOException, SAXException, ParserConfigurationException
{
return resolver.parsed( path ) ? Optional.empty() : Optional.of( parse( parser ) );
} | [
"public",
"<",
"T",
">",
"Optional",
"<",
"T",
">",
"parseOnce",
"(",
"XmlParser",
"<",
"?",
"extends",
"T",
">",
"parser",
")",
"throws",
"IOException",
",",
"SAXException",
",",
"ParserConfigurationException",
"{",
"return",
"resolver",
".",
"parsed",
"(",... | Parse this XML document with the given parser if it has not already been parsed.
If this XML document has not been parsed already, it is parsed and the result returned. If it has been parsed it
is not parsed again, instead {@link Optional#empty() nothing} is returned.
@param parser the parser to parse the document wi... | [
"Parse",
"this",
"XML",
"document",
"with",
"the",
"given",
"parser",
"if",
"it",
"has",
"not",
"already",
"been",
"parsed",
"."
] | eb780caea625900ddbedd28a1eac9a5dbe09c5f0 | https://github.com/opencypher/openCypher/blob/eb780caea625900ddbedd28a1eac9a5dbe09c5f0/tools/grammar/src/main/java/org/opencypher/tools/xml/XmlFile.java#L81-L85 |
112,657 | opencypher/openCypher | tools/grammar/src/main/java/org/opencypher/grammar/Description.java | Description.findStart | private static int findStart( char[] buffer, int start, int end )
{
int pos, cp;
for ( pos = start; pos < end && isWhitespace( cp = codePointAt( buffer, pos ) ); pos += charCount( cp ) )
{
if ( cp == '\n' )
{
start = pos + 1;
}
}
... | java | private static int findStart( char[] buffer, int start, int end )
{
int pos, cp;
for ( pos = start; pos < end && isWhitespace( cp = codePointAt( buffer, pos ) ); pos += charCount( cp ) )
{
if ( cp == '\n' )
{
start = pos + 1;
}
}
... | [
"private",
"static",
"int",
"findStart",
"(",
"char",
"[",
"]",
"buffer",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"int",
"pos",
",",
"cp",
";",
"for",
"(",
"pos",
"=",
"start",
";",
"pos",
"<",
"end",
"&&",
"isWhitespace",
"(",
"cp",
"=... | Find the beginning of the first line that isn't all whitespace. | [
"Find",
"the",
"beginning",
"of",
"the",
"first",
"line",
"that",
"isn",
"t",
"all",
"whitespace",
"."
] | eb780caea625900ddbedd28a1eac9a5dbe09c5f0 | https://github.com/opencypher/openCypher/blob/eb780caea625900ddbedd28a1eac9a5dbe09c5f0/tools/grammar/src/main/java/org/opencypher/grammar/Description.java#L210-L221 |
112,658 | opencypher/openCypher | tools/grammar/src/main/java/org/opencypher/grammar/LiteralNode.java | LiteralNode.textLiteral | private static void textLiteral( Consumer<? super LiteralNode> add, String literal )
{
add.accept( literal( literal, false ) );
} | java | private static void textLiteral( Consumer<? super LiteralNode> add, String literal )
{
add.accept( literal( literal, false ) );
} | [
"private",
"static",
"void",
"textLiteral",
"(",
"Consumer",
"<",
"?",
"super",
"LiteralNode",
">",
"add",
",",
"String",
"literal",
")",
"{",
"add",
".",
"accept",
"(",
"literal",
"(",
"literal",
",",
"false",
")",
")",
";",
"}"
] | Creates a text literal, a case insensitive literal.
@param add the adder that adds the literal node to its parent node.
@param literal the literal string. | [
"Creates",
"a",
"text",
"literal",
"a",
"case",
"insensitive",
"literal",
"."
] | eb780caea625900ddbedd28a1eac9a5dbe09c5f0 | https://github.com/opencypher/openCypher/blob/eb780caea625900ddbedd28a1eac9a5dbe09c5f0/tools/grammar/src/main/java/org/opencypher/grammar/LiteralNode.java#L151-L154 |
112,659 | menacher/java-game-server | jetserver/src/main/java/org/menacheri/jetserver/concurrent/DataFlowVariable.java | DataFlowVariable.getVal | public Object getVal(long waitTime, TimeUnit timeUnit)
throws InterruptedException
{
if(latch.await(waitTime, timeUnit)){
return val;
}
else
{
return null;
}
} | java | public Object getVal(long waitTime, TimeUnit timeUnit)
throws InterruptedException
{
if(latch.await(waitTime, timeUnit)){
return val;
}
else
{
return null;
}
} | [
"public",
"Object",
"getVal",
"(",
"long",
"waitTime",
",",
"TimeUnit",
"timeUnit",
")",
"throws",
"InterruptedException",
"{",
"if",
"(",
"latch",
".",
"await",
"(",
"waitTime",
",",
"timeUnit",
")",
")",
"{",
"return",
"val",
";",
"}",
"else",
"{",
"re... | This method blocks for a specified amount of time to retrieve the value
bound in bind method.
@param waitTime
the amount of time to wait
@param timeUnit
the unit, milliseconds, seconds etc.
@return Returns the bound value or null if the time out has exceeded.
@throws InterruptedException | [
"This",
"method",
"blocks",
"for",
"a",
"specified",
"amount",
"of",
"time",
"to",
"retrieve",
"the",
"value",
"bound",
"in",
"bind",
"method",
"."
] | 668ca49e8bd1dac43add62378cf6c22a93125d48 | https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetserver/src/main/java/org/menacheri/jetserver/concurrent/DataFlowVariable.java#L65-L75 |
112,660 | menacher/java-game-server | jetclient/src/main/java/org/menacheri/jetclient/communication/NettyTCPMessageSender.java | NettyTCPMessageSender.closeAfterFlushingPendingWrites | public void closeAfterFlushingPendingWrites(Channel channel, Event event)
{
if (channel.isConnected())
{
channel.write(event).addListener(ChannelFutureListener.CLOSE);
}
else
{
System.err.println("Unable to write the Event :" + event
+ " to socket as channel is ot connected");
}
} | java | public void closeAfterFlushingPendingWrites(Channel channel, Event event)
{
if (channel.isConnected())
{
channel.write(event).addListener(ChannelFutureListener.CLOSE);
}
else
{
System.err.println("Unable to write the Event :" + event
+ " to socket as channel is ot connected");
}
} | [
"public",
"void",
"closeAfterFlushingPendingWrites",
"(",
"Channel",
"channel",
",",
"Event",
"event",
")",
"{",
"if",
"(",
"channel",
".",
"isConnected",
"(",
")",
")",
"{",
"channel",
".",
"write",
"(",
"event",
")",
".",
"addListener",
"(",
"ChannelFuture... | This method will write an event to the channel and then add a close
listener which will close it after the write has completed.
@param channel
@param event | [
"This",
"method",
"will",
"write",
"an",
"event",
"to",
"the",
"channel",
"and",
"then",
"add",
"a",
"close",
"listener",
"which",
"will",
"close",
"it",
"after",
"the",
"write",
"has",
"completed",
"."
] | 668ca49e8bd1dac43add62378cf6c22a93125d48 | https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetclient/src/main/java/org/menacheri/jetclient/communication/NettyTCPMessageSender.java#L78-L89 |
112,661 | menacher/java-game-server | jetserver/src/main/java/org/menacheri/jetserver/handlers/netty/JavaObjectToAMF3Encoder.java | JavaObjectToAMF3Encoder.convertBAOSToChannelBuffer | public ChannelBuffer convertBAOSToChannelBuffer(ByteArrayOutputStream baos)
{
if (null == baos)
return null;
return wrappedBuffer(baos.toByteArray());
} | java | public ChannelBuffer convertBAOSToChannelBuffer(ByteArrayOutputStream baos)
{
if (null == baos)
return null;
return wrappedBuffer(baos.toByteArray());
} | [
"public",
"ChannelBuffer",
"convertBAOSToChannelBuffer",
"(",
"ByteArrayOutputStream",
"baos",
")",
"{",
"if",
"(",
"null",
"==",
"baos",
")",
"return",
"null",
";",
"return",
"wrappedBuffer",
"(",
"baos",
".",
"toByteArray",
"(",
")",
")",
";",
"}"
] | Utility method to convert a byte array output stream object to a Netty
channel buffer. This method will created a "wrapped" buffer which will
not do any copy.
@param baos
The byte array output stream to convert.
@return Returns the ChannelBuffer object or null if input is null. | [
"Utility",
"method",
"to",
"convert",
"a",
"byte",
"array",
"output",
"stream",
"object",
"to",
"a",
"Netty",
"channel",
"buffer",
".",
"This",
"method",
"will",
"created",
"a",
"wrapped",
"buffer",
"which",
"will",
"not",
"do",
"any",
"copy",
"."
] | 668ca49e8bd1dac43add62378cf6c22a93125d48 | https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetserver/src/main/java/org/menacheri/jetserver/handlers/netty/JavaObjectToAMF3Encoder.java#L59-L65 |
112,662 | menacher/java-game-server | jetserver/src/main/java/org/menacheri/jetserver/convert/flex/AMFDeSerializer.java | AMFDeSerializer.fromAmf | @SuppressWarnings("unchecked")
public <T> T fromAmf(final ByteArrayInputStream amf)
throws ClassNotFoundException, IOException {
Amf3Input amf3Input = new Amf3Input(context);
amf3Input.setInputStream(amf);
// Read object does the actual work of conversion.
return (T) amf3Input.readObject();
} | java | @SuppressWarnings("unchecked")
public <T> T fromAmf(final ByteArrayInputStream amf)
throws ClassNotFoundException, IOException {
Amf3Input amf3Input = new Amf3Input(context);
amf3Input.setInputStream(amf);
// Read object does the actual work of conversion.
return (T) amf3Input.readObject();
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"fromAmf",
"(",
"final",
"ByteArrayInputStream",
"amf",
")",
"throws",
"ClassNotFoundException",
",",
"IOException",
"{",
"Amf3Input",
"amf3Input",
"=",
"new",
"Amf3Input",
"(",
"c... | This method takes an AMF3 object in byte array form and converts it to a
corresponding java object.
@param <T>
@param amf
The serialized AMF3 object as a byte array.
@return Returns the java object after conversion.
@throws ClassNotFoundException
@throws IOException | [
"This",
"method",
"takes",
"an",
"AMF3",
"object",
"in",
"byte",
"array",
"form",
"and",
"converts",
"it",
"to",
"a",
"corresponding",
"java",
"object",
"."
] | 668ca49e8bd1dac43add62378cf6c22a93125d48 | https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetserver/src/main/java/org/menacheri/jetserver/convert/flex/AMFDeSerializer.java#L39-L46 |
112,663 | menacher/java-game-server | jetclient/src/main/java/org/menacheri/jetclient/util/NettyUtils.java | NettyUtils.readString | public static String readString(ChannelBuffer buffer, Charset charset)
{
String readString = null;
if (null != buffer && buffer.readableBytes() > 2)
{
int length = buffer.readUnsignedShort();
readString = readString(buffer, length, charset);
}
return readString;
} | java | public static String readString(ChannelBuffer buffer, Charset charset)
{
String readString = null;
if (null != buffer && buffer.readableBytes() > 2)
{
int length = buffer.readUnsignedShort();
readString = readString(buffer, length, charset);
}
return readString;
} | [
"public",
"static",
"String",
"readString",
"(",
"ChannelBuffer",
"buffer",
",",
"Charset",
"charset",
")",
"{",
"String",
"readString",
"=",
"null",
";",
"if",
"(",
"null",
"!=",
"buffer",
"&&",
"buffer",
".",
"readableBytes",
"(",
")",
">",
"2",
")",
"... | This method will first read an unsigned short to find the length of the
string and then read the actual string based on the length. This method
will also reset the reader index to end of the string
@param buffer
The Netty buffer containing at least one unsigned short
followed by a string of similar length.
@param char... | [
"This",
"method",
"will",
"first",
"read",
"an",
"unsigned",
"short",
"to",
"find",
"the",
"length",
"of",
"the",
"string",
"and",
"then",
"read",
"the",
"actual",
"string",
"based",
"on",
"the",
"length",
".",
"This",
"method",
"will",
"also",
"reset",
... | 668ca49e8bd1dac43add62378cf6c22a93125d48 | https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetclient/src/main/java/org/menacheri/jetclient/util/NettyUtils.java#L130-L139 |
112,664 | menacher/java-game-server | jetclient/src/main/java/org/menacheri/jetclient/util/NettyUtils.java | NettyUtils.readString | public static String readString(ChannelBuffer buffer, int length,
Charset charset)
{
String str = null;
if (null == charset)
{
charset = CharsetUtil.UTF_8;
}
try
{
ChannelBuffer stringBuffer = buffer.readSlice(length);
str = stringBuffer.toString(charset);
}
catch (Exception e)
{
throw... | java | public static String readString(ChannelBuffer buffer, int length,
Charset charset)
{
String str = null;
if (null == charset)
{
charset = CharsetUtil.UTF_8;
}
try
{
ChannelBuffer stringBuffer = buffer.readSlice(length);
str = stringBuffer.toString(charset);
}
catch (Exception e)
{
throw... | [
"public",
"static",
"String",
"readString",
"(",
"ChannelBuffer",
"buffer",
",",
"int",
"length",
",",
"Charset",
"charset",
")",
"{",
"String",
"str",
"=",
"null",
";",
"if",
"(",
"null",
"==",
"charset",
")",
"{",
"charset",
"=",
"CharsetUtil",
".",
"U... | Read a string from a channel buffer with the specified length. It resets
the reader index of the buffer to the end of the string. Defaults to
UTF-8 encoding in case charset passed in is null
@param buffer
The Netty buffer containing the String.
@param length
The number of bytes in the String.
@param charset
The Charse... | [
"Read",
"a",
"string",
"from",
"a",
"channel",
"buffer",
"with",
"the",
"specified",
"length",
".",
"It",
"resets",
"the",
"reader",
"index",
"of",
"the",
"buffer",
"to",
"the",
"end",
"of",
"the",
"string",
".",
"Defaults",
"to",
"UTF",
"-",
"8",
"enc... | 668ca49e8bd1dac43add62378cf6c22a93125d48 | https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetclient/src/main/java/org/menacheri/jetclient/util/NettyUtils.java#L170-L188 |
112,665 | menacher/java-game-server | jetclient/src/main/java/org/menacheri/jetclient/util/NettyUtils.java | NettyUtils.writeString | public static ChannelBuffer writeString(String msg, Charset charset)
{
ChannelBuffer buffer = null;
try
{
ChannelBuffer stringBuffer = null;
if (null == charset)
{
charset = CharsetUtil.UTF_8;
}
stringBuffer = copiedBuffer(ByteOrder.BIG_ENDIAN, msg, charset);
int length = stringBuffer.read... | java | public static ChannelBuffer writeString(String msg, Charset charset)
{
ChannelBuffer buffer = null;
try
{
ChannelBuffer stringBuffer = null;
if (null == charset)
{
charset = CharsetUtil.UTF_8;
}
stringBuffer = copiedBuffer(ByteOrder.BIG_ENDIAN, msg, charset);
int length = stringBuffer.read... | [
"public",
"static",
"ChannelBuffer",
"writeString",
"(",
"String",
"msg",
",",
"Charset",
"charset",
")",
"{",
"ChannelBuffer",
"buffer",
"=",
"null",
";",
"try",
"{",
"ChannelBuffer",
"stringBuffer",
"=",
"null",
";",
"if",
"(",
"null",
"==",
"charset",
")"... | Creates a channel buffer of which the first 2 bytes contain the length of
the string in bytes and the remaining is the actual string in binary with
specified format. Defaults to UTF-8 encoding in case charset passed in is
null
@param msg
The string to be written.
@param charset
The Charset say 'UTF-8' in which the enc... | [
"Creates",
"a",
"channel",
"buffer",
"of",
"which",
"the",
"first",
"2",
"bytes",
"contain",
"the",
"length",
"of",
"the",
"string",
"in",
"bytes",
"and",
"the",
"remaining",
"is",
"the",
"actual",
"string",
"in",
"binary",
"with",
"specified",
"format",
"... | 668ca49e8bd1dac43add62378cf6c22a93125d48 | https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetclient/src/main/java/org/menacheri/jetclient/util/NettyUtils.java#L270-L291 |
112,666 | menacher/java-game-server | jetserver/src/main/java/org/menacheri/jetserver/server/netty/UDPChannelPipelineFactory.java | UDPChannelPipelineFactory.init | public void init()
{
pipeline = pipeline();
pipeline.addLast("messageBufferEventDecoder", messageBufferEventDecoder);
pipeline.addLast("upstream", upstream);
// Downstream handlers - Filter for data which flows from server to
// client. Note that the last handler added is actually the first
... | java | public void init()
{
pipeline = pipeline();
pipeline.addLast("messageBufferEventDecoder", messageBufferEventDecoder);
pipeline.addLast("upstream", upstream);
// Downstream handlers - Filter for data which flows from server to
// client. Note that the last handler added is actually the first
... | [
"public",
"void",
"init",
"(",
")",
"{",
"pipeline",
"=",
"pipeline",
"(",
")",
";",
"pipeline",
".",
"addLast",
"(",
"\"messageBufferEventDecoder\"",
",",
"messageBufferEventDecoder",
")",
";",
"pipeline",
".",
"addLast",
"(",
"\"upstream\"",
",",
"upstream",
... | This method creates a single pipeline object that will be shared for all
the channels. | [
"This",
"method",
"creates",
"a",
"single",
"pipeline",
"object",
"that",
"will",
"be",
"shared",
"for",
"all",
"the",
"channels",
"."
] | 668ca49e8bd1dac43add62378cf6c22a93125d48 | https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetserver/src/main/java/org/menacheri/jetserver/server/netty/UDPChannelPipelineFactory.java#L43-L54 |
112,667 | menacher/java-game-server | jetserver/src/main/java/org/menacheri/jetserver/concurrent/Fibers.java | Fibers.pooledFiber | public static Fiber pooledFiber(Lane<String,ExecutorService> lane)
{
if(null == lanePoolFactoryMap.get(lane))
{
lanePoolFactoryMap.putIfAbsent(lane, new PoolFiberFactory(lane.getUnderlyingLane()));
}
Fiber fiber = lanePoolFactoryMap.get(lane).create();
fiber.start();
return fiber;
} | java | public static Fiber pooledFiber(Lane<String,ExecutorService> lane)
{
if(null == lanePoolFactoryMap.get(lane))
{
lanePoolFactoryMap.putIfAbsent(lane, new PoolFiberFactory(lane.getUnderlyingLane()));
}
Fiber fiber = lanePoolFactoryMap.get(lane).create();
fiber.start();
return fiber;
} | [
"public",
"static",
"Fiber",
"pooledFiber",
"(",
"Lane",
"<",
"String",
",",
"ExecutorService",
">",
"lane",
")",
"{",
"if",
"(",
"null",
"==",
"lanePoolFactoryMap",
".",
"get",
"(",
"lane",
")",
")",
"{",
"lanePoolFactoryMap",
".",
"putIfAbsent",
"(",
"la... | Creates and starts a fiber and returns the created instance.
@return The created fiber. | [
"Creates",
"and",
"starts",
"a",
"fiber",
"and",
"returns",
"the",
"created",
"instance",
"."
] | 668ca49e8bd1dac43add62378cf6c22a93125d48 | https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetserver/src/main/java/org/menacheri/jetserver/concurrent/Fibers.java#L52-L62 |
112,668 | menacher/java-game-server | jetserver/src/main/java/org/menacheri/jetserver/convert/flex/AMFSerializer.java | AMFSerializer.toAmf | public <T> ByteArrayOutputStream toAmf(final T source) throws IOException
{
// Create and instance of the byte array output stream to write the AMF3
// object to.
final ByteArrayOutputStream bout = new ByteArrayOutputStream();
// Create the AMF3Output object and set its output stream.
final Amf3Output ... | java | public <T> ByteArrayOutputStream toAmf(final T source) throws IOException
{
// Create and instance of the byte array output stream to write the AMF3
// object to.
final ByteArrayOutputStream bout = new ByteArrayOutputStream();
// Create the AMF3Output object and set its output stream.
final Amf3Output ... | [
"public",
"<",
"T",
">",
"ByteArrayOutputStream",
"toAmf",
"(",
"final",
"T",
"source",
")",
"throws",
"IOException",
"{",
"// Create and instance of the byte array output stream to write the AMF3\r",
"// object to.\r",
"final",
"ByteArrayOutputStream",
"bout",
"=",
"new",
... | Method used to convert the java object to AMF3 format. This method in
turn delegates this conversion to the blazeds class AMF3 output.
@param <T>
@param source
This is the java object that is to be converted to AMF3.
@return Returns the byte array output stream which was created by
serializing a java object to AMF3.
@... | [
"Method",
"used",
"to",
"convert",
"the",
"java",
"object",
"to",
"AMF3",
"format",
".",
"This",
"method",
"in",
"turn",
"delegates",
"this",
"conversion",
"to",
"the",
"blazeds",
"class",
"AMF3",
"output",
"."
] | 668ca49e8bd1dac43add62378cf6c22a93125d48 | https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetserver/src/main/java/org/menacheri/jetserver/convert/flex/AMFSerializer.java#L46-L61 |
112,669 | menacher/java-game-server | jetserver/src/main/java/org/menacheri/jetserver/context/AppContext.java | AppContext.getBean | public static Object getBean(String beanName)
{
if (null == beanName)
{
return null;
}
return applicationContext.getBean(beanName);
} | java | public static Object getBean(String beanName)
{
if (null == beanName)
{
return null;
}
return applicationContext.getBean(beanName);
} | [
"public",
"static",
"Object",
"getBean",
"(",
"String",
"beanName",
")",
"{",
"if",
"(",
"null",
"==",
"beanName",
")",
"{",
"return",
"null",
";",
"}",
"return",
"applicationContext",
".",
"getBean",
"(",
"beanName",
")",
";",
"}"
] | This method is used to retrieve a bean by its name. Note that this may
result in new bean creation if the scope is set to "prototype" in the
bean configuration file.
@param beanName
The name of the bean as configured in the spring configuration
file.
@return The bean if it is existing or null. | [
"This",
"method",
"is",
"used",
"to",
"retrieve",
"a",
"bean",
"by",
"its",
"name",
".",
"Note",
"that",
"this",
"may",
"result",
"in",
"new",
"bean",
"creation",
"if",
"the",
"scope",
"is",
"set",
"to",
"prototype",
"in",
"the",
"bean",
"configuration",... | 668ca49e8bd1dac43add62378cf6c22a93125d48 | https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetserver/src/main/java/org/menacheri/jetserver/context/AppContext.java#L93-L100 |
112,670 | menacher/java-game-server | jetserver/src/main/java/org/menacheri/jetserver/util/NettyUtils.java | NettyUtils.clearPipeline | public static void clearPipeline(ChannelPipeline pipeline)
{
if(null == pipeline){
return;
}
try
{
int counter = 0;
while (pipeline.getFirst() != null)
{
pipeline.removeFirst();
counter++;
}
LOG.trace("Removed {} handlers from pipeline",counter);
}
catch (NoSuchElementExceptio... | java | public static void clearPipeline(ChannelPipeline pipeline)
{
if(null == pipeline){
return;
}
try
{
int counter = 0;
while (pipeline.getFirst() != null)
{
pipeline.removeFirst();
counter++;
}
LOG.trace("Removed {} handlers from pipeline",counter);
}
catch (NoSuchElementExceptio... | [
"public",
"static",
"void",
"clearPipeline",
"(",
"ChannelPipeline",
"pipeline",
")",
"{",
"if",
"(",
"null",
"==",
"pipeline",
")",
"{",
"return",
";",
"}",
"try",
"{",
"int",
"counter",
"=",
"0",
";",
"while",
"(",
"pipeline",
".",
"getFirst",
"(",
"... | A utility method to clear the netty pipeline of all handlers.
@param pipeline | [
"A",
"utility",
"method",
"to",
"clear",
"the",
"netty",
"pipeline",
"of",
"all",
"handlers",
"."
] | 668ca49e8bd1dac43add62378cf6c22a93125d48 | https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetserver/src/main/java/org/menacheri/jetserver/util/NettyUtils.java#L55-L75 |
112,671 | menacher/java-game-server | jetserver/src/main/java/org/menacheri/jetserver/util/NettyUtils.java | NettyUtils.readString | public static String readString(ChannelBuffer buffer, int length)
{
return readString(buffer, length, CharsetUtil.UTF_8);
// char[] chars = new char[length];
// for (int i = 0; i < length; i++)
// {
// chars[i] = buffer.readChar();
// }
// return new String(chars);
} | java | public static String readString(ChannelBuffer buffer, int length)
{
return readString(buffer, length, CharsetUtil.UTF_8);
// char[] chars = new char[length];
// for (int i = 0; i < length; i++)
// {
// chars[i] = buffer.readChar();
// }
// return new String(chars);
} | [
"public",
"static",
"String",
"readString",
"(",
"ChannelBuffer",
"buffer",
",",
"int",
"length",
")",
"{",
"return",
"readString",
"(",
"buffer",
",",
"length",
",",
"CharsetUtil",
".",
"UTF_8",
")",
";",
"//\t\tchar[] chars = new char[length];",
"//\t\tfor (int i ... | Read a string from a channel buffer with the specified length. It resets
the reader index of the buffer to the end of the string.
@param buffer
The Netty buffer containing the String.
@param length
The number of bytes in the String.
@return Returns the read string. | [
"Read",
"a",
"string",
"from",
"a",
"channel",
"buffer",
"with",
"the",
"specified",
"length",
".",
"It",
"resets",
"the",
"reader",
"index",
"of",
"the",
"buffer",
"to",
"the",
"end",
"of",
"the",
"string",
"."
] | 668ca49e8bd1dac43add62378cf6c22a93125d48 | https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetserver/src/main/java/org/menacheri/jetserver/util/NettyUtils.java#L183-L193 |
112,672 | menacher/java-game-server | jetserver/src/main/java/org/menacheri/jetserver/util/NettyUtils.java | NettyUtils.readSocketAddress | public static InetSocketAddress readSocketAddress(ChannelBuffer buffer)
{
String remoteHost = NettyUtils.readString(buffer);
int remotePort = 0;
if (buffer.readableBytes() >= 4)
{
remotePort = buffer.readInt();
}
else
{
return null;
}
InetSocketAddress remoteAddress = null;
if (null != remote... | java | public static InetSocketAddress readSocketAddress(ChannelBuffer buffer)
{
String remoteHost = NettyUtils.readString(buffer);
int remotePort = 0;
if (buffer.readableBytes() >= 4)
{
remotePort = buffer.readInt();
}
else
{
return null;
}
InetSocketAddress remoteAddress = null;
if (null != remote... | [
"public",
"static",
"InetSocketAddress",
"readSocketAddress",
"(",
"ChannelBuffer",
"buffer",
")",
"{",
"String",
"remoteHost",
"=",
"NettyUtils",
".",
"readString",
"(",
"buffer",
")",
";",
"int",
"remotePort",
"=",
"0",
";",
"if",
"(",
"buffer",
".",
"readab... | Read a socket address from a buffer. The socket address will be provided
as two strings containing host and port.
@param buffer
The buffer containing the host and port as string.
@return The InetSocketAddress object created from host and port or null
in case the strings are not there. | [
"Read",
"a",
"socket",
"address",
"from",
"a",
"buffer",
".",
"The",
"socket",
"address",
"will",
"be",
"provided",
"as",
"two",
"strings",
"containing",
"host",
"and",
"port",
"."
] | 668ca49e8bd1dac43add62378cf6c22a93125d48 | https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetserver/src/main/java/org/menacheri/jetserver/util/NettyUtils.java#L384-L402 |
112,673 | menacher/java-game-server | jetserver/src/main/java/org/menacheri/jetserver/app/impl/GameRoomSession.java | GameRoomSession.createAndAddEventHandlers | protected void createAndAddEventHandlers(PlayerSession playerSession)
{
// Create a network event listener for the player session.
EventHandler networkEventHandler = new NetworkEventListener(playerSession);
// Add the handler to the game room's EventDispatcher so that it will
// pass game room network events t... | java | protected void createAndAddEventHandlers(PlayerSession playerSession)
{
// Create a network event listener for the player session.
EventHandler networkEventHandler = new NetworkEventListener(playerSession);
// Add the handler to the game room's EventDispatcher so that it will
// pass game room network events t... | [
"protected",
"void",
"createAndAddEventHandlers",
"(",
"PlayerSession",
"playerSession",
")",
"{",
"// Create a network event listener for the player session.",
"EventHandler",
"networkEventHandler",
"=",
"new",
"NetworkEventListener",
"(",
"playerSession",
")",
";",
"// Add the ... | Method which will create and add event handlers of the player session to
the Game Room's EventDispatcher.
@param playerSession
The session for which the event handlers are created. | [
"Method",
"which",
"will",
"create",
"and",
"add",
"event",
"handlers",
"of",
"the",
"player",
"session",
"to",
"the",
"Game",
"Room",
"s",
"EventDispatcher",
"."
] | 668ca49e8bd1dac43add62378cf6c22a93125d48 | https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetserver/src/main/java/org/menacheri/jetserver/app/impl/GameRoomSession.java#L282-L292 |
112,674 | menacher/java-game-server | jetserver/src/main/java/org/menacheri/jetserver/event/impl/JetlangEventDispatcher.java | JetlangEventDispatcher.addANYHandler | protected void addANYHandler(final EventHandler eventHandler)
{
final int eventType = eventHandler.getEventType();
if (eventType != Events.ANY)
{
LOG.error("The incoming handler {} is not of type ANY",
eventHandler);
throw new IllegalArgumentException(
"The incoming handler is not of type ANY");
... | java | protected void addANYHandler(final EventHandler eventHandler)
{
final int eventType = eventHandler.getEventType();
if (eventType != Events.ANY)
{
LOG.error("The incoming handler {} is not of type ANY",
eventHandler);
throw new IllegalArgumentException(
"The incoming handler is not of type ANY");
... | [
"protected",
"void",
"addANYHandler",
"(",
"final",
"EventHandler",
"eventHandler",
")",
"{",
"final",
"int",
"eventType",
"=",
"eventHandler",
".",
"getEventType",
"(",
")",
";",
"if",
"(",
"eventType",
"!=",
"Events",
".",
"ANY",
")",
"{",
"LOG",
".",
"e... | Creates a batch subscription to the jetlang memory channel for the ANY
event handler. This method does not require synchronization since we are
using CopyOnWriteArrayList
@param eventHandler | [
"Creates",
"a",
"batch",
"subscription",
"to",
"the",
"jetlang",
"memory",
"channel",
"for",
"the",
"ANY",
"event",
"handler",
".",
"This",
"method",
"does",
"not",
"require",
"synchronization",
"since",
"we",
"are",
"using",
"CopyOnWriteArrayList"
] | 668ca49e8bd1dac43add62378cf6c22a93125d48 | https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetserver/src/main/java/org/menacheri/jetserver/event/impl/JetlangEventDispatcher.java#L136-L152 |
112,675 | menacher/java-game-server | jetclient/src/main/java/org/menacheri/jetclient/util/LoginHelper.java | LoginHelper.getLoginBuffer | public MessageBuffer<ChannelBuffer> getLoginBuffer(
InetSocketAddress localUDPAddress) throws Exception
{
ChannelBuffer loginBuffer;
ChannelBuffer credentials = NettyUtils.writeStrings(username, password,
connectionKey);
if (null != localUDPAddress)
{
ChannelBuffer udpAddressBuffer = NettyUtils
... | java | public MessageBuffer<ChannelBuffer> getLoginBuffer(
InetSocketAddress localUDPAddress) throws Exception
{
ChannelBuffer loginBuffer;
ChannelBuffer credentials = NettyUtils.writeStrings(username, password,
connectionKey);
if (null != localUDPAddress)
{
ChannelBuffer udpAddressBuffer = NettyUtils
... | [
"public",
"MessageBuffer",
"<",
"ChannelBuffer",
">",
"getLoginBuffer",
"(",
"InetSocketAddress",
"localUDPAddress",
")",
"throws",
"Exception",
"{",
"ChannelBuffer",
"loginBuffer",
";",
"ChannelBuffer",
"credentials",
"=",
"NettyUtils",
".",
"writeStrings",
"(",
"usern... | Creates the appropriate login buffer using username, password,
connectionkey and the local address to which the UDP channel is bound.
@param localUDPAddress
<b>optional</b> If passed in, then this address is passed on
to jetserver, so that it can associate this address with its
session.
@return Returns the ChannelBuff... | [
"Creates",
"the",
"appropriate",
"login",
"buffer",
"using",
"username",
"password",
"connectionkey",
"and",
"the",
"local",
"address",
"to",
"which",
"the",
"UDP",
"channel",
"is",
"bound",
"."
] | 668ca49e8bd1dac43add62378cf6c22a93125d48 | https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetclient/src/main/java/org/menacheri/jetclient/util/LoginHelper.java#L213-L231 |
112,676 | menacher/java-game-server | jetclient/src/main/java/org/menacheri/jetclient/util/LoginHelper.java | LoginHelper.getReconnectBuffer | public MessageBuffer<ChannelBuffer> getReconnectBuffer(String reconnectKey,
InetSocketAddress udpAddress)
{
ChannelBuffer reconnectBuffer = null;
ChannelBuffer buffer = NettyUtils.writeString(reconnectKey);
if (null != udpAddress)
{
reconnectBuffer = ChannelBuffers.wrappedBuffer(buffer,
NettyUtils.w... | java | public MessageBuffer<ChannelBuffer> getReconnectBuffer(String reconnectKey,
InetSocketAddress udpAddress)
{
ChannelBuffer reconnectBuffer = null;
ChannelBuffer buffer = NettyUtils.writeString(reconnectKey);
if (null != udpAddress)
{
reconnectBuffer = ChannelBuffers.wrappedBuffer(buffer,
NettyUtils.w... | [
"public",
"MessageBuffer",
"<",
"ChannelBuffer",
">",
"getReconnectBuffer",
"(",
"String",
"reconnectKey",
",",
"InetSocketAddress",
"udpAddress",
")",
"{",
"ChannelBuffer",
"reconnectBuffer",
"=",
"null",
";",
"ChannelBuffer",
"buffer",
"=",
"NettyUtils",
".",
"write... | Creates a wrapped netty buffer with reconnect key and udp address as its
payload.
@param reconnectKey
The key that was initially sent by server on game room join
success event will be sent back to server for reconnecting
@param udpAddress
If udp connection is required, then the new udpAddress need to
be sent.
@return ... | [
"Creates",
"a",
"wrapped",
"netty",
"buffer",
"with",
"reconnect",
"key",
"and",
"udp",
"address",
"as",
"its",
"payload",
"."
] | 668ca49e8bd1dac43add62378cf6c22a93125d48 | https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetclient/src/main/java/org/menacheri/jetclient/util/LoginHelper.java#L246-L261 |
112,677 | menacher/java-game-server | jetclient/src/main/java/org/menacheri/jetclient/app/impl/SessionFactory.java | SessionFactory.connectSession | public void connectSession(final Session session,
EventHandler... eventHandlers) throws InterruptedException,
Exception
{
InetSocketAddress udpAddress = null;
if (null != udpClient)
{
udpAddress = doUdpConnection(session);
}
if (null != eventHandlers)
{
for (EventHandler eventHandler : eventHa... | java | public void connectSession(final Session session,
EventHandler... eventHandlers) throws InterruptedException,
Exception
{
InetSocketAddress udpAddress = null;
if (null != udpClient)
{
udpAddress = doUdpConnection(session);
}
if (null != eventHandlers)
{
for (EventHandler eventHandler : eventHa... | [
"public",
"void",
"connectSession",
"(",
"final",
"Session",
"session",
",",
"EventHandler",
"...",
"eventHandlers",
")",
"throws",
"InterruptedException",
",",
"Exception",
"{",
"InetSocketAddress",
"udpAddress",
"=",
"null",
";",
"if",
"(",
"null",
"!=",
"udpCli... | Connects the session to remote jetserver. Depending on the connection
parameters provided to LoginHelper, it can connect both TCP and UDP
transports.
@param session
The session to be connected to remote jetserver.
@param eventHandlers
The handlers to be added to session.
@throws InterruptedException
@throws Exception | [
"Connects",
"the",
"session",
"to",
"remote",
"jetserver",
".",
"Depending",
"on",
"the",
"connection",
"parameters",
"provided",
"to",
"LoginHelper",
"it",
"can",
"connect",
"both",
"TCP",
"and",
"UDP",
"transports",
"."
] | 668ca49e8bd1dac43add62378cf6c22a93125d48 | https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetclient/src/main/java/org/menacheri/jetclient/app/impl/SessionFactory.java#L147-L173 |
112,678 | menacher/java-game-server | jetclient/src/main/java/org/menacheri/jetclient/app/impl/SessionFactory.java | SessionFactory.reconnectSession | public void reconnectSession(final Session session, String reconnectKey)
throws InterruptedException, Exception
{
session.getTcpMessageSender().close();
if (null != session.getUdpMessageSender())
session.getUdpMessageSender().close();
InetSocketAddress udpAddress = null;
if (null != udpClient)
{
ud... | java | public void reconnectSession(final Session session, String reconnectKey)
throws InterruptedException, Exception
{
session.getTcpMessageSender().close();
if (null != session.getUdpMessageSender())
session.getUdpMessageSender().close();
InetSocketAddress udpAddress = null;
if (null != udpClient)
{
ud... | [
"public",
"void",
"reconnectSession",
"(",
"final",
"Session",
"session",
",",
"String",
"reconnectKey",
")",
"throws",
"InterruptedException",
",",
"Exception",
"{",
"session",
".",
"getTcpMessageSender",
"(",
")",
".",
"close",
"(",
")",
";",
"if",
"(",
"nul... | Method used to reconnect existing session which probably got disconnected
due to some exception. It will first close existing tcp and udp
connections and then try re-connecting using the reconnect key from
server.
@param session
The session which needs to be re-connected.
@param reconnectKey
This is provided by the se... | [
"Method",
"used",
"to",
"reconnect",
"existing",
"session",
"which",
"probably",
"got",
"disconnected",
"due",
"to",
"some",
"exception",
".",
"It",
"will",
"first",
"close",
"existing",
"tcp",
"and",
"udp",
"connections",
"and",
"then",
"try",
"re",
"-",
"c... | 668ca49e8bd1dac43add62378cf6c22a93125d48 | https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetclient/src/main/java/org/menacheri/jetclient/app/impl/SessionFactory.java#L190-L208 |
112,679 | MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/utils/Assert.java | Assert.parametersNotNull | public static void parametersNotNull(final String names, final Object... objects) {
String msgPrefix = "At least one of the parameters";
if (objects != null) {
if (objects.length == 1) {
msgPrefix = "Parameter";
}
for (final Object object : objects) ... | java | public static void parametersNotNull(final String names, final Object... objects) {
String msgPrefix = "At least one of the parameters";
if (objects != null) {
if (objects.length == 1) {
msgPrefix = "Parameter";
}
for (final Object object : objects) ... | [
"public",
"static",
"void",
"parametersNotNull",
"(",
"final",
"String",
"names",
",",
"final",
"Object",
"...",
"objects",
")",
"{",
"String",
"msgPrefix",
"=",
"\"At least one of the parameters\"",
";",
"if",
"(",
"objects",
"!=",
"null",
")",
"{",
"if",
"("... | Validates that all the parameters are not null
@param names a comma separated String of parameter names
@param objects the proposed parameter values | [
"Validates",
"that",
"all",
"the",
"parameters",
"are",
"not",
"null"
] | 667c30bdc7c6f1d9f2e2eb8774835d6137b52d12 | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/utils/Assert.java#L27-L41 |
112,680 | MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/utils/Assert.java | Assert.parameterNotNull | public static void parameterNotNull(final String name, final Object reference) {
if (reference == null) {
raiseError(format("Parameter '%s' is not expected to be null.", name));
}
} | java | public static void parameterNotNull(final String name, final Object reference) {
if (reference == null) {
raiseError(format("Parameter '%s' is not expected to be null.", name));
}
} | [
"public",
"static",
"void",
"parameterNotNull",
"(",
"final",
"String",
"name",
",",
"final",
"Object",
"reference",
")",
"{",
"if",
"(",
"reference",
"==",
"null",
")",
"{",
"raiseError",
"(",
"format",
"(",
"\"Parameter '%s' is not expected to be null.\"",
",",
... | Validates that the parameter is not null
@param name the parameter name
@param reference the proposed parameter value | [
"Validates",
"that",
"the",
"parameter",
"is",
"not",
"null"
] | 667c30bdc7c6f1d9f2e2eb8774835d6137b52d12 | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/utils/Assert.java#L49-L53 |
112,681 | MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/utils/Assert.java | Assert.parameterNotEmpty | public static void parameterNotEmpty(final String name, final Iterable obj) {
if (!obj.iterator().hasNext()) {
raiseError(format("Parameter '%s' from type '%s' is expected to NOT be empty", name, obj.getClass().getName()));
}
} | java | public static void parameterNotEmpty(final String name, final Iterable obj) {
if (!obj.iterator().hasNext()) {
raiseError(format("Parameter '%s' from type '%s' is expected to NOT be empty", name, obj.getClass().getName()));
}
} | [
"public",
"static",
"void",
"parameterNotEmpty",
"(",
"final",
"String",
"name",
",",
"final",
"Iterable",
"obj",
")",
"{",
"if",
"(",
"!",
"obj",
".",
"iterator",
"(",
")",
".",
"hasNext",
"(",
")",
")",
"{",
"raiseError",
"(",
"format",
"(",
"\"Param... | Validates that the Iterable is not empty
@param name the parameter name
@param obj the proposed parameter value | [
"Validates",
"that",
"the",
"Iterable",
"is",
"not",
"empty"
] | 667c30bdc7c6f1d9f2e2eb8774835d6137b52d12 | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/utils/Assert.java#L61-L65 |
112,682 | MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/utils/Assert.java | Assert.parameterNotEmpty | public static void parameterNotEmpty(final String name, final String value) {
if (value != null && value.length() == 0) {
raiseError(format("Parameter '%s' is expected to NOT be empty.", name));
}
} | java | public static void parameterNotEmpty(final String name, final String value) {
if (value != null && value.length() == 0) {
raiseError(format("Parameter '%s' is expected to NOT be empty.", name));
}
} | [
"public",
"static",
"void",
"parameterNotEmpty",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
"&&",
"value",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"raiseError",
"(",
"format",
"(",... | Validates that the value is not empty
@param name the parameter name
@param value the proposed parameter value | [
"Validates",
"that",
"the",
"value",
"is",
"not",
"empty"
] | 667c30bdc7c6f1d9f2e2eb8774835d6137b52d12 | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/utils/Assert.java#L73-L77 |
112,683 | MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/utils/IterHelper.java | IterHelper.loopMap | @SuppressWarnings("unchecked")
public void loopMap(final Object x, final MapIterCallback<K, V> callback) {
if (x == null) {
return;
}
if (x instanceof Collection) {
throw new IllegalArgumentException("call loop instead");
}
if (x instanceof HashMap<?... | java | @SuppressWarnings("unchecked")
public void loopMap(final Object x, final MapIterCallback<K, V> callback) {
if (x == null) {
return;
}
if (x instanceof Collection) {
throw new IllegalArgumentException("call loop instead");
}
if (x instanceof HashMap<?... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"void",
"loopMap",
"(",
"final",
"Object",
"x",
",",
"final",
"MapIterCallback",
"<",
"K",
",",
"V",
">",
"callback",
")",
"{",
"if",
"(",
"x",
"==",
"null",
")",
"{",
"return",
";",
"}",
... | Process a Map
@param x the object to process
@param callback the callback | [
"Process",
"a",
"Map"
] | 667c30bdc7c6f1d9f2e2eb8774835d6137b52d12 | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/utils/IterHelper.java#L26-L61 |
112,684 | MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/UpdateOptions.java | UpdateOptions.copy | public UpdateOptions copy() {
return new UpdateOptions()
.bypassDocumentValidation(getBypassDocumentValidation())
.collation(getCollation())
.multi(isMulti())
.upsert(isUpsert())
.writeConcern(getWriteConcern());
} | java | public UpdateOptions copy() {
return new UpdateOptions()
.bypassDocumentValidation(getBypassDocumentValidation())
.collation(getCollation())
.multi(isMulti())
.upsert(isUpsert())
.writeConcern(getWriteConcern());
} | [
"public",
"UpdateOptions",
"copy",
"(",
")",
"{",
"return",
"new",
"UpdateOptions",
"(",
")",
".",
"bypassDocumentValidation",
"(",
"getBypassDocumentValidation",
"(",
")",
")",
".",
"collation",
"(",
"getCollation",
"(",
")",
")",
".",
"multi",
"(",
"isMulti"... | Create a copy of the options instance.
@return the copy | [
"Create",
"a",
"copy",
"of",
"the",
"options",
"instance",
"."
] | 667c30bdc7c6f1d9f2e2eb8774835d6137b52d12 | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/UpdateOptions.java#L50-L57 |
112,685 | MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/query/validation/GeoWithinOperationValidator.java | GeoWithinOperationValidator.isValueAValidGeoQuery | private static boolean isValueAValidGeoQuery(final Object value) {
if (value instanceof DBObject) {
String key = ((DBObject) value).keySet().iterator().next();
return key.equals("$box") || key.equals("$center") || key.equals("$centerSphere") || key.equals("$polygon");
}
r... | java | private static boolean isValueAValidGeoQuery(final Object value) {
if (value instanceof DBObject) {
String key = ((DBObject) value).keySet().iterator().next();
return key.equals("$box") || key.equals("$center") || key.equals("$centerSphere") || key.equals("$polygon");
}
r... | [
"private",
"static",
"boolean",
"isValueAValidGeoQuery",
"(",
"final",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"instanceof",
"DBObject",
")",
"{",
"String",
"key",
"=",
"(",
"(",
"DBObject",
")",
"value",
")",
".",
"keySet",
"(",
")",
".",
"iter... | this could be a lot more rigorous | [
"this",
"could",
"be",
"a",
"lot",
"more",
"rigorous"
] | 667c30bdc7c6f1d9f2e2eb8774835d6137b52d12 | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/query/validation/GeoWithinOperationValidator.java#L33-L39 |
112,686 | MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/mapping/validation/MappingValidator.java | MappingValidator.validate | @Deprecated
public void validate(final Mapper mapper, final MappedClass mappedClass) {
validate(mapper, singletonList(mappedClass));
} | java | @Deprecated
public void validate(final Mapper mapper, final MappedClass mappedClass) {
validate(mapper, singletonList(mappedClass));
} | [
"@",
"Deprecated",
"public",
"void",
"validate",
"(",
"final",
"Mapper",
"mapper",
",",
"final",
"MappedClass",
"mappedClass",
")",
"{",
"validate",
"(",
"mapper",
",",
"singletonList",
"(",
"mappedClass",
")",
")",
";",
"}"
] | Validates a MappedClass
@param mappedClass the MappedClass to validate
@param mapper the Mapper to use for validation | [
"Validates",
"a",
"MappedClass"
] | 667c30bdc7c6f1d9f2e2eb8774835d6137b52d12 | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/mapping/validation/MappingValidator.java#L64-L67 |
112,687 | MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/mapping/validation/MappingValidator.java | MappingValidator.validate | public void validate(final Mapper mapper, final List<MappedClass> classes) {
final Set<ConstraintViolation> ve = new TreeSet<ConstraintViolation>(new Comparator<ConstraintViolation>() {
@Override
public int compare(final ConstraintViolation o1, final ConstraintViolation o2) {
... | java | public void validate(final Mapper mapper, final List<MappedClass> classes) {
final Set<ConstraintViolation> ve = new TreeSet<ConstraintViolation>(new Comparator<ConstraintViolation>() {
@Override
public int compare(final ConstraintViolation o1, final ConstraintViolation o2) {
... | [
"public",
"void",
"validate",
"(",
"final",
"Mapper",
"mapper",
",",
"final",
"List",
"<",
"MappedClass",
">",
"classes",
")",
"{",
"final",
"Set",
"<",
"ConstraintViolation",
">",
"ve",
"=",
"new",
"TreeSet",
"<",
"ConstraintViolation",
">",
"(",
"new",
"... | Validates a List of MappedClasses
@param classes the MappedClasses to validate
@param mapper the Mapper to use for validation | [
"Validates",
"a",
"List",
"of",
"MappedClasses"
] | 667c30bdc7c6f1d9f2e2eb8774835d6137b52d12 | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/mapping/validation/MappingValidator.java#L75-L109 |
112,688 | MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/Morphia.java | Morphia.createDatastore | @SuppressWarnings("deprecation")
public Datastore createDatastore(final MongoClient mongoClient, final String dbName) {
return new DatastoreImpl(this, mongoClient, dbName);
} | java | @SuppressWarnings("deprecation")
public Datastore createDatastore(final MongoClient mongoClient, final String dbName) {
return new DatastoreImpl(this, mongoClient, dbName);
} | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"Datastore",
"createDatastore",
"(",
"final",
"MongoClient",
"mongoClient",
",",
"final",
"String",
"dbName",
")",
"{",
"return",
"new",
"DatastoreImpl",
"(",
"this",
",",
"mongoClient",
",",
"dbName"... | It is best to use a Mongo singleton instance here.
@param mongoClient the representations of the connection to a MongoDB instance
@param dbName the name of the database
@return a Datastore that you can use to interact with MongoDB | [
"It",
"is",
"best",
"to",
"use",
"a",
"Mongo",
"singleton",
"instance",
"here",
"."
] | 667c30bdc7c6f1d9f2e2eb8774835d6137b52d12 | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/Morphia.java#L88-L91 |
112,689 | MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/Morphia.java | Morphia.mapPackage | public synchronized Morphia mapPackage(final String packageName, final boolean ignoreInvalidClasses) {
try {
for (final Class clazz : ReflectionUtils.getClasses(getClass().getClassLoader(), packageName,
mapper.getOptions().isMapSubPackages())) {
try {
... | java | public synchronized Morphia mapPackage(final String packageName, final boolean ignoreInvalidClasses) {
try {
for (final Class clazz : ReflectionUtils.getClasses(getClass().getClassLoader(), packageName,
mapper.getOptions().isMapSubPackages())) {
try {
... | [
"public",
"synchronized",
"Morphia",
"mapPackage",
"(",
"final",
"String",
"packageName",
",",
"final",
"boolean",
"ignoreInvalidClasses",
")",
"{",
"try",
"{",
"for",
"(",
"final",
"Class",
"clazz",
":",
"ReflectionUtils",
".",
"getClasses",
"(",
"getClass",
"(... | Tries to map all classes in the package specified.
@param packageName the name of the package to process
@param ignoreInvalidClasses specifies whether to ignore classes in the package that cannot be mapped
@return the Morphia instance | [
"Tries",
"to",
"map",
"all",
"classes",
"in",
"the",
"package",
"specified",
"."
] | 667c30bdc7c6f1d9f2e2eb8774835d6137b52d12 | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/Morphia.java#L241-L264 |
112,690 | MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/Morphia.java | Morphia.toDBObject | public DBObject toDBObject(final Object entity) {
try {
return mapper.toDBObject(entity);
} catch (Exception e) {
throw new MappingException("Could not map entity to DBObject", e);
}
} | java | public DBObject toDBObject(final Object entity) {
try {
return mapper.toDBObject(entity);
} catch (Exception e) {
throw new MappingException("Could not map entity to DBObject", e);
}
} | [
"public",
"DBObject",
"toDBObject",
"(",
"final",
"Object",
"entity",
")",
"{",
"try",
"{",
"return",
"mapper",
".",
"toDBObject",
"(",
"entity",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"MappingException",
"(",
"\"Could not... | Converts an entity to a DBObject. This method is primarily an internal method. Reliance on this method may break your application
in
future releases.
@param entity the entity to convert
@return the DBObject | [
"Converts",
"an",
"entity",
"to",
"a",
"DBObject",
".",
"This",
"method",
"is",
"primarily",
"an",
"internal",
"method",
".",
"Reliance",
"on",
"this",
"method",
"may",
"break",
"your",
"application",
"in",
"future",
"releases",
"."
] | 667c30bdc7c6f1d9f2e2eb8774835d6137b52d12 | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/Morphia.java#L284-L290 |
112,691 | MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/MapReduceOptions.java | MapReduceOptions.map | public MapReduceOptions<T> map(final String map) {
Assert.parametersNotNull("map", map);
Assert.parameterNotEmpty("map", map);
this.map = map;
return this;
} | java | public MapReduceOptions<T> map(final String map) {
Assert.parametersNotNull("map", map);
Assert.parameterNotEmpty("map", map);
this.map = map;
return this;
} | [
"public",
"MapReduceOptions",
"<",
"T",
">",
"map",
"(",
"final",
"String",
"map",
")",
"{",
"Assert",
".",
"parametersNotNull",
"(",
"\"map\"",
",",
"map",
")",
";",
"Assert",
".",
"parameterNotEmpty",
"(",
"\"map\"",
",",
"map",
")",
";",
"this",
".",
... | Set the JavaScript function that associates or "maps" a value with a key and emits the key and value pair.
@param map the JavaScript function
@return this | [
"Set",
"the",
"JavaScript",
"function",
"that",
"associates",
"or",
"maps",
"a",
"value",
"with",
"a",
"key",
"and",
"emits",
"the",
"key",
"and",
"value",
"pair",
"."
] | 667c30bdc7c6f1d9f2e2eb8774835d6137b52d12 | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/MapReduceOptions.java#L122-L127 |
112,692 | MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/MapReduceOptions.java | MapReduceOptions.query | public MapReduceOptions<T> query(final Query query) {
Assert.parametersNotNull("query", query);
this.query = query;
return this;
} | java | public MapReduceOptions<T> query(final Query query) {
Assert.parametersNotNull("query", query);
this.query = query;
return this;
} | [
"public",
"MapReduceOptions",
"<",
"T",
">",
"query",
"(",
"final",
"Query",
"query",
")",
"{",
"Assert",
".",
"parametersNotNull",
"(",
"\"query\"",
",",
"query",
")",
";",
"this",
".",
"query",
"=",
"query",
";",
"return",
"this",
";",
"}"
] | Sets the query defining the input for the job. Must not be null.
@param query the query to use
@return this | [
"Sets",
"the",
"query",
"defining",
"the",
"input",
"for",
"the",
"job",
".",
"Must",
"not",
"be",
"null",
"."
] | 667c30bdc7c6f1d9f2e2eb8774835d6137b52d12 | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/MapReduceOptions.java#L191-L195 |
112,693 | MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/MapReduceOptions.java | MapReduceOptions.reduce | public MapReduceOptions<T> reduce(final String reduce) {
Assert.parametersNotNull("reduce", reduce);
Assert.parameterNotEmpty("reduce", reduce);
this.reduce = reduce;
return this;
} | java | public MapReduceOptions<T> reduce(final String reduce) {
Assert.parametersNotNull("reduce", reduce);
Assert.parameterNotEmpty("reduce", reduce);
this.reduce = reduce;
return this;
} | [
"public",
"MapReduceOptions",
"<",
"T",
">",
"reduce",
"(",
"final",
"String",
"reduce",
")",
"{",
"Assert",
".",
"parametersNotNull",
"(",
"\"reduce\"",
",",
"reduce",
")",
";",
"Assert",
".",
"parameterNotEmpty",
"(",
"\"reduce\"",
",",
"reduce",
")",
";",... | Sets the JavaScript function that "reduces" to a single object all the values associated with a particular key.
@param reduce the javascript function
@return this | [
"Sets",
"the",
"JavaScript",
"function",
"that",
"reduces",
"to",
"a",
"single",
"object",
"all",
"the",
"values",
"associated",
"with",
"a",
"particular",
"key",
"."
] | 667c30bdc7c6f1d9f2e2eb8774835d6137b52d12 | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/MapReduceOptions.java#L214-L219 |
112,694 | MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/utils/ReflectionUtils.java | ReflectionUtils.isIntegerType | public static boolean isIntegerType(final Class type) {
return Arrays.<Class>asList(Integer.class, int.class, Long.class, long.class, Short.class, short.class, Byte.class,
byte.class).contains(type);
} | java | public static boolean isIntegerType(final Class type) {
return Arrays.<Class>asList(Integer.class, int.class, Long.class, long.class, Short.class, short.class, Byte.class,
byte.class).contains(type);
} | [
"public",
"static",
"boolean",
"isIntegerType",
"(",
"final",
"Class",
"type",
")",
"{",
"return",
"Arrays",
".",
"<",
"Class",
">",
"asList",
"(",
"Integer",
".",
"class",
",",
"int",
".",
"class",
",",
"Long",
".",
"class",
",",
"long",
".",
"class",... | Checks if the class is an integer type, i.e., is numeric but not a floating point type.
@param type the class we want to check
@return true if the type is an integral type | [
"Checks",
"if",
"the",
"class",
"is",
"an",
"integer",
"type",
"i",
".",
"e",
".",
"is",
"numeric",
"but",
"not",
"a",
"floating",
"point",
"type",
"."
] | 667c30bdc7c6f1d9f2e2eb8774835d6137b52d12 | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/utils/ReflectionUtils.java#L156-L159 |
112,695 | MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/utils/ReflectionUtils.java | ReflectionUtils.isPropertyType | public static boolean isPropertyType(final Type type) {
if (type instanceof GenericArrayType) {
return isPropertyType(((GenericArrayType) type).getGenericComponentType());
}
if (type instanceof ParameterizedType) {
return isPropertyType(((ParameterizedType) type).getRawTy... | java | public static boolean isPropertyType(final Type type) {
if (type instanceof GenericArrayType) {
return isPropertyType(((GenericArrayType) type).getGenericComponentType());
}
if (type instanceof ParameterizedType) {
return isPropertyType(((ParameterizedType) type).getRawTy... | [
"public",
"static",
"boolean",
"isPropertyType",
"(",
"final",
"Type",
"type",
")",
"{",
"if",
"(",
"type",
"instanceof",
"GenericArrayType",
")",
"{",
"return",
"isPropertyType",
"(",
"(",
"(",
"GenericArrayType",
")",
"type",
")",
".",
"getGenericComponentType... | Check if the class supplied represents a valid property type.
@param type the class we want to check
@return true if the class represents a valid property type | [
"Check",
"if",
"the",
"class",
"supplied",
"represents",
"a",
"valid",
"property",
"type",
"."
] | 667c30bdc7c6f1d9f2e2eb8774835d6137b52d12 | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/utils/ReflectionUtils.java#L167-L175 |
112,696 | MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/utils/ReflectionUtils.java | ReflectionUtils.getParameterizedType | public static Type getParameterizedType(final Field field, final int index) {
if (field != null) {
if (field.getGenericType() instanceof ParameterizedType) {
final ParameterizedType type = (ParameterizedType) field.getGenericType();
if ((type.getActualTypeArguments() ... | java | public static Type getParameterizedType(final Field field, final int index) {
if (field != null) {
if (field.getGenericType() instanceof ParameterizedType) {
final ParameterizedType type = (ParameterizedType) field.getGenericType();
if ((type.getActualTypeArguments() ... | [
"public",
"static",
"Type",
"getParameterizedType",
"(",
"final",
"Field",
"field",
",",
"final",
"int",
"index",
")",
"{",
"if",
"(",
"field",
"!=",
"null",
")",
"{",
"if",
"(",
"field",
".",
"getGenericType",
"(",
")",
"instanceof",
"ParameterizedType",
... | Returns the parameterized type for a field
@param field the field to examine
@param index the location of the parameter to return
@return the type | [
"Returns",
"the",
"parameterized",
"type",
"for",
"a",
"field"
] | 667c30bdc7c6f1d9f2e2eb8774835d6137b52d12 | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/utils/ReflectionUtils.java#L234-L271 |
112,697 | MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/utils/ReflectionUtils.java | ReflectionUtils.getParameterizedClass | public static Class getParameterizedClass(final Class c, final int index) {
final TypeVariable[] typeVars = c.getTypeParameters();
if (typeVars.length > 0) {
final TypeVariable typeVariable = typeVars[index];
final Type[] bounds = typeVariable.getBounds();
final Type... | java | public static Class getParameterizedClass(final Class c, final int index) {
final TypeVariable[] typeVars = c.getTypeParameters();
if (typeVars.length > 0) {
final TypeVariable typeVariable = typeVars[index];
final Type[] bounds = typeVariable.getBounds();
final Type... | [
"public",
"static",
"Class",
"getParameterizedClass",
"(",
"final",
"Class",
"c",
",",
"final",
"int",
"index",
")",
"{",
"final",
"TypeVariable",
"[",
"]",
"typeVars",
"=",
"c",
".",
"getTypeParameters",
"(",
")",
";",
"if",
"(",
"typeVars",
".",
"length"... | Returns the parameterized type in the given position
@param c the class to examine
@param index the position of the type to return
@return the type | [
"Returns",
"the",
"parameterized",
"type",
"in",
"the",
"given",
"position"
] | 667c30bdc7c6f1d9f2e2eb8774835d6137b52d12 | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/utils/ReflectionUtils.java#L290-L320 |
112,698 | MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/utils/ReflectionUtils.java | ReflectionUtils.isFieldParameterizedWithClass | public static boolean isFieldParameterizedWithClass(final Field field, final Class c) {
if (field.getGenericType() instanceof ParameterizedType) {
final ParameterizedType genericType = (ParameterizedType) field.getGenericType();
for (final Type type : genericType.getActualTypeArguments()... | java | public static boolean isFieldParameterizedWithClass(final Field field, final Class c) {
if (field.getGenericType() instanceof ParameterizedType) {
final ParameterizedType genericType = (ParameterizedType) field.getGenericType();
for (final Type type : genericType.getActualTypeArguments()... | [
"public",
"static",
"boolean",
"isFieldParameterizedWithClass",
"(",
"final",
"Field",
"field",
",",
"final",
"Class",
"c",
")",
"{",
"if",
"(",
"field",
".",
"getGenericType",
"(",
")",
"instanceof",
"ParameterizedType",
")",
"{",
"final",
"ParameterizedType",
... | Check if a field is parameterized with a specific class.
@param field the field
@param c the class to check against
@return true if the field is parameterized and c is the class that parameterizes the field, or is an interface that the parameterized
class implements, else false
@deprecated this class is unused in ... | [
"Check",
"if",
"a",
"field",
"is",
"parameterized",
"with",
"a",
"specific",
"class",
"."
] | 667c30bdc7c6f1d9f2e2eb8774835d6137b52d12 | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/utils/ReflectionUtils.java#L331-L344 |
112,699 | MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/utils/ReflectionUtils.java | ReflectionUtils.isFieldParameterizedWithPropertyType | public static boolean isFieldParameterizedWithPropertyType(final Field field) {
if (field.getGenericType() instanceof ParameterizedType) {
final ParameterizedType genericType = (ParameterizedType) field.getGenericType();
for (final Type type : genericType.getActualTypeArguments()) {
... | java | public static boolean isFieldParameterizedWithPropertyType(final Field field) {
if (field.getGenericType() instanceof ParameterizedType) {
final ParameterizedType genericType = (ParameterizedType) field.getGenericType();
for (final Type type : genericType.getActualTypeArguments()) {
... | [
"public",
"static",
"boolean",
"isFieldParameterizedWithPropertyType",
"(",
"final",
"Field",
"field",
")",
"{",
"if",
"(",
"field",
".",
"getGenericType",
"(",
")",
"instanceof",
"ParameterizedType",
")",
"{",
"final",
"ParameterizedType",
"genericType",
"=",
"(",
... | Check if the field supplied is parameterized with a valid JCR property type.
@param field the field
@return true if the field is parameterized with a valid JCR property type, else false
@deprecated this class is unused in morphia and will be removed in a future release | [
"Check",
"if",
"the",
"field",
"supplied",
"is",
"parameterized",
"with",
"a",
"valid",
"JCR",
"property",
"type",
"."
] | 667c30bdc7c6f1d9f2e2eb8774835d6137b52d12 | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/utils/ReflectionUtils.java#L364-L374 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.