repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java | JsUtils.param | public static String param(JavaScriptObject js) {
Properties prop = js.cast();
String ret = "";
for (String k : prop.keys()) {
ret += ret.isEmpty() ? "" : "&";
JsCache o = prop.getArray(k).cast();
if (o != null) {
for (int i = 0, l = o.length(); i < l; i++) {
ret += i > 0... | java | public static String param(JavaScriptObject js) {
Properties prop = js.cast();
String ret = "";
for (String k : prop.keys()) {
ret += ret.isEmpty() ? "" : "&";
JsCache o = prop.getArray(k).cast();
if (o != null) {
for (int i = 0, l = o.length(); i < l; i++) {
ret += i > 0... | [
"public",
"static",
"String",
"param",
"(",
"JavaScriptObject",
"js",
")",
"{",
"Properties",
"prop",
"=",
"js",
".",
"cast",
"(",
")",
";",
"String",
"ret",
"=",
"\"\"",
";",
"for",
"(",
"String",
"k",
":",
"prop",
".",
"keys",
"(",
")",
")",
"{",... | Returns a QueryString representation of a JavascriptObject.
TODO: jquery implementation accepts a second parameter (traditional) | [
"Returns",
"a",
"QueryString",
"representation",
"of",
"a",
"JavascriptObject",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java#L642-L671 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/impl/DocumentStyleImplIE.java | DocumentStyleImplIE.setStyleProperty | @Override
public void setStyleProperty(Element e, String prop, String val) {
if ("opacity".equals(prop)) {
setOpacity(e, val);
} else {
super.setStyleProperty(e, prop, val);
}
} | java | @Override
public void setStyleProperty(Element e, String prop, String val) {
if ("opacity".equals(prop)) {
setOpacity(e, val);
} else {
super.setStyleProperty(e, prop, val);
}
} | [
"@",
"Override",
"public",
"void",
"setStyleProperty",
"(",
"Element",
"e",
",",
"String",
"prop",
",",
"String",
"val",
")",
"{",
"if",
"(",
"\"opacity\"",
".",
"equals",
"(",
"prop",
")",
")",
"{",
"setOpacity",
"(",
"e",
",",
"val",
")",
";",
"}",... | Set the value of a style property of an element.
IE needs a special workaround to handle opacity | [
"Set",
"the",
"value",
"of",
"a",
"style",
"property",
"of",
"an",
"element",
".",
"IE",
"needs",
"a",
"special",
"workaround",
"to",
"handle",
"opacity"
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/DocumentStyleImplIE.java#L76-L83 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/GQ.java | GQ.create | public static IsProperties create(String s, boolean fixJson) {
return getFactory().create(fixJson ? Properties.wrapPropertiesString(s) : s);
} | java | public static IsProperties create(String s, boolean fixJson) {
return getFactory().create(fixJson ? Properties.wrapPropertiesString(s) : s);
} | [
"public",
"static",
"IsProperties",
"create",
"(",
"String",
"s",
",",
"boolean",
"fixJson",
")",
"{",
"return",
"getFactory",
"(",
")",
".",
"create",
"(",
"fixJson",
"?",
"Properties",
".",
"wrapPropertiesString",
"(",
"s",
")",
":",
"s",
")",
";",
"}"... | Create an instance of IsProperties, a Properties JavaScriptObject in the client
side and a proxy object in the JVM.
If fixJson is set, we correct certain errors in the Json string. It is useful
for generating Properties using java strings, so as we can use a more relaxed
syntax. | [
"Create",
"an",
"instance",
"of",
"IsProperties",
"a",
"Properties",
"JavaScriptObject",
"in",
"the",
"client",
"side",
"and",
"a",
"proxy",
"object",
"in",
"the",
"JVM",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/GQ.java#L86-L88 | train |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBReflector.java | DynamoDBReflector.getCustomMarshalledValue | @SuppressWarnings({ "rawtypes", "unchecked" })
private <T> T getCustomMarshalledValue(T toReturn, Method getter, AttributeValue value) {
DynamoDBMarshalling annotation = getter.getAnnotation(DynamoDBMarshalling.class);
Class<? extends DynamoDBMarshaller<? extends Object>> marshallerClass = annotatio... | java | @SuppressWarnings({ "rawtypes", "unchecked" })
private <T> T getCustomMarshalledValue(T toReturn, Method getter, AttributeValue value) {
DynamoDBMarshalling annotation = getter.getAnnotation(DynamoDBMarshalling.class);
Class<? extends DynamoDBMarshaller<? extends Object>> marshallerClass = annotatio... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"private",
"<",
"T",
">",
"T",
"getCustomMarshalledValue",
"(",
"T",
"toReturn",
",",
"Method",
"getter",
",",
"AttributeValue",
"value",
")",
"{",
"DynamoDBMarshalling",
"annotat... | Marshalls the custom value given into the proper return type. | [
"Marshalls",
"the",
"custom",
"value",
"given",
"into",
"the",
"proper",
"return",
"type",
"."
] | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBReflector.java#L566-L581 | train |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBReflector.java | DynamoDBReflector.getCustomerMarshallerAttributeValue | @SuppressWarnings({ "rawtypes", "unchecked" })
private AttributeValue getCustomerMarshallerAttributeValue(Method getter, Object getterReturnResult) {
DynamoDBMarshalling annotation = getter.getAnnotation(DynamoDBMarshalling.class);
Class<? extends DynamoDBMarshaller<? extends Object>> marshallerClas... | java | @SuppressWarnings({ "rawtypes", "unchecked" })
private AttributeValue getCustomerMarshallerAttributeValue(Method getter, Object getterReturnResult) {
DynamoDBMarshalling annotation = getter.getAnnotation(DynamoDBMarshalling.class);
Class<? extends DynamoDBMarshaller<? extends Object>> marshallerClas... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"private",
"AttributeValue",
"getCustomerMarshallerAttributeValue",
"(",
"Method",
"getter",
",",
"Object",
"getterReturnResult",
")",
"{",
"DynamoDBMarshalling",
"annotation",
"=",
"gett... | Returns an attribute value for the getter method with a custom marshaller | [
"Returns",
"an",
"attribute",
"value",
"for",
"the",
"getter",
"method",
"with",
"a",
"custom",
"marshaller"
] | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBReflector.java#L586-L604 | train |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBReflector.java | DynamoDBReflector.parseBoolean | private boolean parseBoolean(String s) {
if ( "1".equals(s) ) {
return true;
} else if ( "0".equals(s) ) {
return false;
} else {
throw new IllegalArgumentException("Expected 1 or 0 for boolean value, was " + s);
}
} | java | private boolean parseBoolean(String s) {
if ( "1".equals(s) ) {
return true;
} else if ( "0".equals(s) ) {
return false;
} else {
throw new IllegalArgumentException("Expected 1 or 0 for boolean value, was " + s);
}
} | [
"private",
"boolean",
"parseBoolean",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"\"1\"",
".",
"equals",
"(",
"s",
")",
")",
"{",
"return",
"true",
";",
"}",
"else",
"if",
"(",
"\"0\"",
".",
"equals",
"(",
"s",
")",
")",
"{",
"return",
"false",
";"... | Attempts to parse the string given as a boolean and return its value.
Throws an exception if the value is anything other than 0 or 1. | [
"Attempts",
"to",
"parse",
"the",
"string",
"given",
"as",
"a",
"boolean",
"and",
"return",
"its",
"value",
".",
"Throws",
"an",
"exception",
"if",
"the",
"value",
"is",
"anything",
"other",
"than",
"0",
"or",
"1",
"."
] | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBReflector.java#L811-L819 | train |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBReflector.java | DynamoDBReflector.getVersionedArgumentMarshaller | ArgumentMarshaller getVersionedArgumentMarshaller(final Method getter, Object getterReturnResult) {
synchronized (versionArgumentMarshallerCache) {
if ( !versionArgumentMarshallerCache.containsKey(getter) ) {
ArgumentMarshaller marshaller = null;
final Class<?> ret... | java | ArgumentMarshaller getVersionedArgumentMarshaller(final Method getter, Object getterReturnResult) {
synchronized (versionArgumentMarshallerCache) {
if ( !versionArgumentMarshallerCache.containsKey(getter) ) {
ArgumentMarshaller marshaller = null;
final Class<?> ret... | [
"ArgumentMarshaller",
"getVersionedArgumentMarshaller",
"(",
"final",
"Method",
"getter",
",",
"Object",
"getterReturnResult",
")",
"{",
"synchronized",
"(",
"versionArgumentMarshallerCache",
")",
"{",
"if",
"(",
"!",
"versionArgumentMarshallerCache",
".",
"containsKey",
... | Returns a marshaller that knows how to provide an AttributeValue for the
getter method given. Also increments the value of the getterReturnResult
given. | [
"Returns",
"a",
"marshaller",
"that",
"knows",
"how",
"to",
"provide",
"an",
"AttributeValue",
"for",
"the",
"getter",
"method",
"given",
".",
"Also",
"increments",
"the",
"value",
"of",
"the",
"getterReturnResult",
"given",
"."
] | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBReflector.java#L907-L972 | train |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBReflector.java | DynamoDBReflector.getAutoGeneratedKeyArgumentMarshaller | ArgumentMarshaller getAutoGeneratedKeyArgumentMarshaller(final Method getter) {
synchronized (keyArgumentMarshallerCache) {
if ( !keyArgumentMarshallerCache.containsKey(getter) ) {
ArgumentMarshaller marshaller = null;
Class<?> returnType = getter.getReturnType();
... | java | ArgumentMarshaller getAutoGeneratedKeyArgumentMarshaller(final Method getter) {
synchronized (keyArgumentMarshallerCache) {
if ( !keyArgumentMarshallerCache.containsKey(getter) ) {
ArgumentMarshaller marshaller = null;
Class<?> returnType = getter.getReturnType();
... | [
"ArgumentMarshaller",
"getAutoGeneratedKeyArgumentMarshaller",
"(",
"final",
"Method",
"getter",
")",
"{",
"synchronized",
"(",
"keyArgumentMarshallerCache",
")",
"{",
"if",
"(",
"!",
"keyArgumentMarshallerCache",
".",
"containsKey",
"(",
"getter",
")",
")",
"{",
"Arg... | Returns a marshaller for the auto-generated key returned by the getter given. | [
"Returns",
"a",
"marshaller",
"for",
"the",
"auto",
"-",
"generated",
"key",
"returned",
"by",
"the",
"getter",
"given",
"."
] | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBReflector.java#L977-L1002 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/MousePlugin.java | MousePlugin.mouseDown | protected boolean mouseDown(Element element, GqEvent event) {
// test if an other plugin handle the mouseStart
if (isEventAlreadyHandled(event)) {
return false;
}
if (started) { // case where we missed a mouseup
mouseUp(element, event);
}
// calculate all interesting variables
... | java | protected boolean mouseDown(Element element, GqEvent event) {
// test if an other plugin handle the mouseStart
if (isEventAlreadyHandled(event)) {
return false;
}
if (started) { // case where we missed a mouseup
mouseUp(element, event);
}
// calculate all interesting variables
... | [
"protected",
"boolean",
"mouseDown",
"(",
"Element",
"element",
",",
"GqEvent",
"event",
")",
"{",
"// test if an other plugin handle the mouseStart",
"if",
"(",
"isEventAlreadyHandled",
"(",
"event",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"started... | Method called when mouse down occur on the element.
You should not override this method. Instead, override {@link #mouseStart(Element, GqEvent)}
method. | [
"Method",
"called",
"when",
"mouse",
"down",
"occur",
"on",
"the",
"element",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/MousePlugin.java#L119-L154 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/MousePlugin.java | MousePlugin.mouseMove | protected boolean mouseMove(Element element, GqEvent event) {
if (started) {
event.getOriginalEvent().preventDefault();
return mouseDrag(element, event);
}
if (delayConditionMet() && distanceConditionMet(event)) {
started = mouseStart(element, startEvent);
if (started) {
mo... | java | protected boolean mouseMove(Element element, GqEvent event) {
if (started) {
event.getOriginalEvent().preventDefault();
return mouseDrag(element, event);
}
if (delayConditionMet() && distanceConditionMet(event)) {
started = mouseStart(element, startEvent);
if (started) {
mo... | [
"protected",
"boolean",
"mouseMove",
"(",
"Element",
"element",
",",
"GqEvent",
"event",
")",
"{",
"if",
"(",
"started",
")",
"{",
"event",
".",
"getOriginalEvent",
"(",
")",
".",
"preventDefault",
"(",
")",
";",
"return",
"mouseDrag",
"(",
"element",
",",... | Method called on MouseMove event.
You should not override this method. Instead, override {@link #mouseMove(Element, GqEvent)}
method | [
"Method",
"called",
"on",
"MouseMove",
"event",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/MousePlugin.java#L168-L185 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/MousePlugin.java | MousePlugin.mouseUp | protected boolean mouseUp(Element element, GqEvent event) {
unbindOtherEvents();
if (started) {
started = false;
preventClickEvent = event.getCurrentEventTarget() == startEvent.getCurrentEventTarget();
mouseStop(element, event);
}
return true;
} | java | protected boolean mouseUp(Element element, GqEvent event) {
unbindOtherEvents();
if (started) {
started = false;
preventClickEvent = event.getCurrentEventTarget() == startEvent.getCurrentEventTarget();
mouseStop(element, event);
}
return true;
} | [
"protected",
"boolean",
"mouseUp",
"(",
"Element",
"element",
",",
"GqEvent",
"event",
")",
"{",
"unbindOtherEvents",
"(",
")",
";",
"if",
"(",
"started",
")",
"{",
"started",
"=",
"false",
";",
"preventClickEvent",
"=",
"event",
".",
"getCurrentEventTarget",
... | Method called when mouse is released..
You should not override this method. Instead, override {@link #mouseStop(Element, GqEvent)}
method. | [
"Method",
"called",
"when",
"mouse",
"is",
"released",
".."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/MousePlugin.java#L204-L214 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsniBundleGenerator.java | JsniBundleGenerator.getContent | private String getContent(TreeLogger logger, String path, String src)
throws UnableToCompleteException {
HttpURLConnection connection = null;
InputStream in = null;
try {
if (!src.matches("(?i)https?://.*")) {
String file = path + "/" + src;
in = this.getClass().getClassLoader().... | java | private String getContent(TreeLogger logger, String path, String src)
throws UnableToCompleteException {
HttpURLConnection connection = null;
InputStream in = null;
try {
if (!src.matches("(?i)https?://.*")) {
String file = path + "/" + src;
in = this.getClass().getClassLoader().... | [
"private",
"String",
"getContent",
"(",
"TreeLogger",
"logger",
",",
"String",
"path",
",",
"String",
"src",
")",
"throws",
"UnableToCompleteException",
"{",
"HttpURLConnection",
"connection",
"=",
"null",
";",
"InputStream",
"in",
"=",
"null",
";",
"try",
"{",
... | Get the content of a javascript source. It supports remote sources hosted in CDN's. | [
"Get",
"the",
"content",
"of",
"a",
"javascript",
"source",
".",
"It",
"supports",
"remote",
"sources",
"hosted",
"in",
"CDN",
"s",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsniBundleGenerator.java#L127-L181 | train |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java | DynamoDBMapper.load | public <T extends Object> T load(Class<T> clazz, Object hashKey, DynamoDBMapperConfig config) {
return load(clazz, hashKey, null, config);
} | java | public <T extends Object> T load(Class<T> clazz, Object hashKey, DynamoDBMapperConfig config) {
return load(clazz, hashKey, null, config);
} | [
"public",
"<",
"T",
"extends",
"Object",
">",
"T",
"load",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"Object",
"hashKey",
",",
"DynamoDBMapperConfig",
"config",
")",
"{",
"return",
"load",
"(",
"clazz",
",",
"hashKey",
",",
"null",
",",
"config",
")",... | Loads an object with the hash key given and a configuration override.
This configuration overrides the default provided at object construction.
@see DynamoDBMapper#load(Class, Object, Object, DynamoDBMapperConfig) | [
"Loads",
"an",
"object",
"with",
"the",
"hash",
"key",
"given",
"and",
"a",
"configuration",
"override",
".",
"This",
"configuration",
"overrides",
"the",
"default",
"provided",
"at",
"object",
"construction",
"."
] | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java#L193-L195 | train |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java | DynamoDBMapper.load | public <T extends Object> T load(Class<T> clazz, Object hashKey, Object rangeKey, DynamoDBMapperConfig config) {
config = mergeConfig(config);
String tableName = getTableName(clazz, config);
// Fill in the hash key element in the service request
Method hashKeyGetter = reflector.getHash... | java | public <T extends Object> T load(Class<T> clazz, Object hashKey, Object rangeKey, DynamoDBMapperConfig config) {
config = mergeConfig(config);
String tableName = getTableName(clazz, config);
// Fill in the hash key element in the service request
Method hashKeyGetter = reflector.getHash... | [
"public",
"<",
"T",
"extends",
"Object",
">",
"T",
"load",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"Object",
"hashKey",
",",
"Object",
"rangeKey",
",",
"DynamoDBMapperConfig",
"config",
")",
"{",
"config",
"=",
"mergeConfig",
"(",
"config",
")",
";",
... | Returns an object with the given hash key, or null if no such object
exists.
@param clazz
The class to load, corresponding to a DynamoDB table.
@param hashKey
The key of the object.
@param rangeKey
The range key of the object, or null for tables without a
range key.
@param config
Configuration for the service call to ... | [
"Returns",
"an",
"object",
"with",
"the",
"given",
"hash",
"key",
"or",
"null",
"if",
"no",
"such",
"object",
"exists",
"."
] | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java#L232-L261 | train |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java | DynamoDBMapper.marshallIntoObjects | public <T> List<T> marshallIntoObjects(Class<T> clazz, List<Map<String, AttributeValue>> itemAttributes) {
List<T> result = new ArrayList<T>();
for (Map<String, AttributeValue> item : itemAttributes) {
result.add(marshallIntoObject(clazz, item));
}
return result;
} | java | public <T> List<T> marshallIntoObjects(Class<T> clazz, List<Map<String, AttributeValue>> itemAttributes) {
List<T> result = new ArrayList<T>();
for (Map<String, AttributeValue> item : itemAttributes) {
result.add(marshallIntoObject(clazz, item));
}
return result;
} | [
"public",
"<",
"T",
">",
"List",
"<",
"T",
">",
"marshallIntoObjects",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"List",
"<",
"Map",
"<",
"String",
",",
"AttributeValue",
">",
">",
"itemAttributes",
")",
"{",
"List",
"<",
"T",
">",
"result",
"=",
... | Marshalls the list of item attributes into objects of type clazz
@see DynamoDBMapper#marshallIntoObject(Class, Map) | [
"Marshalls",
"the",
"list",
"of",
"item",
"attributes",
"into",
"objects",
"of",
"type",
"clazz"
] | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java#L328-L334 | train |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java | DynamoDBMapper.setValue | private <T> void setValue(final T toReturn, final Method getter, AttributeValue value) {
Method setter = reflector.getSetter(getter);
ArgumentUnmarshaller unmarhsaller = reflector.getArgumentUnmarshaller(toReturn, getter, setter);
unmarhsaller.typeCheck(value, setter);
Object argument;... | java | private <T> void setValue(final T toReturn, final Method getter, AttributeValue value) {
Method setter = reflector.getSetter(getter);
ArgumentUnmarshaller unmarhsaller = reflector.getArgumentUnmarshaller(toReturn, getter, setter);
unmarhsaller.typeCheck(value, setter);
Object argument;... | [
"private",
"<",
"T",
">",
"void",
"setValue",
"(",
"final",
"T",
"toReturn",
",",
"final",
"Method",
"getter",
",",
"AttributeValue",
"value",
")",
"{",
"Method",
"setter",
"=",
"reflector",
".",
"getSetter",
"(",
"getter",
")",
";",
"ArgumentUnmarshaller",
... | Sets the value in the return object corresponding to the service result. | [
"Sets",
"the",
"value",
"in",
"the",
"return",
"object",
"corresponding",
"to",
"the",
"service",
"result",
"."
] | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java#L339-L355 | train |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java | DynamoDBMapper.delete | public void delete(Object object, DynamoDBMapperConfig config) {
config = mergeConfig(config);
Class<?> clazz = object.getClass();
String tableName = getTableName(clazz, config);
Method hashKeyGetter = reflector.getHashKeyGetter(clazz);
AttributeValue hashKeyElement = getHashK... | java | public void delete(Object object, DynamoDBMapperConfig config) {
config = mergeConfig(config);
Class<?> clazz = object.getClass();
String tableName = getTableName(clazz, config);
Method hashKeyGetter = reflector.getHashKeyGetter(clazz);
AttributeValue hashKeyElement = getHashK... | [
"public",
"void",
"delete",
"(",
"Object",
"object",
",",
"DynamoDBMapperConfig",
"config",
")",
"{",
"config",
"=",
"mergeConfig",
"(",
"config",
")",
";",
"Class",
"<",
"?",
">",
"clazz",
"=",
"object",
".",
"getClass",
"(",
")",
";",
"String",
"tableN... | Deletes the given object from its DynamoDB table.
@param config
Config override object. If {@link SaveBehavior#CLOBBER} is
supplied, version fields will not be considered when deleting
the object. | [
"Deletes",
"the",
"given",
"object",
"from",
"its",
"DynamoDB",
"table",
"."
] | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java#L604-L647 | train |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java | DynamoDBMapper.validBatchGetRequest | private boolean validBatchGetRequest(Map<Class<?>, List<KeyPair>> itemsToGet) {
if (itemsToGet == null || itemsToGet.size() == 0) {
return false;
}
for (Class<?> clazz : itemsToGet.keySet()) {
if (itemsToGet.get(clazz) != null && itemsToGet.get(clazz).size() > 0) {
... | java | private boolean validBatchGetRequest(Map<Class<?>, List<KeyPair>> itemsToGet) {
if (itemsToGet == null || itemsToGet.size() == 0) {
return false;
}
for (Class<?> clazz : itemsToGet.keySet()) {
if (itemsToGet.get(clazz) != null && itemsToGet.get(clazz).size() > 0) {
... | [
"private",
"boolean",
"validBatchGetRequest",
"(",
"Map",
"<",
"Class",
"<",
"?",
">",
",",
"List",
"<",
"KeyPair",
">",
">",
"itemsToGet",
")",
"{",
"if",
"(",
"itemsToGet",
"==",
"null",
"||",
"itemsToGet",
".",
"size",
"(",
")",
"==",
"0",
")",
"{... | Check whether the batchGetRequest meet all the constraints.
@param itemsToGet | [
"Check",
"whether",
"the",
"batchGetRequest",
"meet",
"all",
"the",
"constraints",
"."
] | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java#L950-L961 | train |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java | DynamoDBMapper.getAutoGeneratedKeyAttributeValue | private AttributeValue getAutoGeneratedKeyAttributeValue(Method getter, Object getterResult) {
ArgumentMarshaller marshaller = reflector.getAutoGeneratedKeyArgumentMarshaller(getter);
return marshaller.marshall(getterResult);
} | java | private AttributeValue getAutoGeneratedKeyAttributeValue(Method getter, Object getterResult) {
ArgumentMarshaller marshaller = reflector.getAutoGeneratedKeyArgumentMarshaller(getter);
return marshaller.marshall(getterResult);
} | [
"private",
"AttributeValue",
"getAutoGeneratedKeyAttributeValue",
"(",
"Method",
"getter",
",",
"Object",
"getterResult",
")",
"{",
"ArgumentMarshaller",
"marshaller",
"=",
"reflector",
".",
"getAutoGeneratedKeyArgumentMarshaller",
"(",
"getter",
")",
";",
"return",
"mars... | Returns an attribute value corresponding to the key method and value given. | [
"Returns",
"an",
"attribute",
"value",
"corresponding",
"to",
"the",
"key",
"method",
"and",
"value",
"given",
"."
] | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java#L1028-L1031 | train |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java | DynamoDBMapper.scanPage | public <T> ScanResultPage<T> scanPage(Class<T> clazz, DynamoDBScanExpression scanExpression, DynamoDBMapperConfig config) {
config = mergeConfig(config);
ScanRequest scanRequest = createScanRequestFromExpression(clazz, scanExpression, config);
ScanResult scanResult = db.scan(applyUserAgent(sca... | java | public <T> ScanResultPage<T> scanPage(Class<T> clazz, DynamoDBScanExpression scanExpression, DynamoDBMapperConfig config) {
config = mergeConfig(config);
ScanRequest scanRequest = createScanRequestFromExpression(clazz, scanExpression, config);
ScanResult scanResult = db.scan(applyUserAgent(sca... | [
"public",
"<",
"T",
">",
"ScanResultPage",
"<",
"T",
">",
"scanPage",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"DynamoDBScanExpression",
"scanExpression",
",",
"DynamoDBMapperConfig",
"config",
")",
"{",
"config",
"=",
"mergeConfig",
"(",
"config",
")",
";... | Scans through an Amazon DynamoDB table and returns a single page of matching
results. The table to scan is determined by looking at the annotations on
the specified class, which declares where to store the object data in AWS
DynamoDB, and the scan expression parameter allows the caller to filter
results and control how... | [
"Scans",
"through",
"an",
"Amazon",
"DynamoDB",
"table",
"and",
"returns",
"a",
"single",
"page",
"of",
"matching",
"results",
".",
"The",
"table",
"to",
"scan",
"is",
"determined",
"by",
"looking",
"at",
"the",
"annotations",
"on",
"the",
"specified",
"clas... | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java#L1101-L1112 | train |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java | DynamoDBMapper.query | public <T> PaginatedQueryList<T> query(Class<T> clazz, DynamoDBQueryExpression queryExpression) {
return query(clazz, queryExpression, config);
} | java | public <T> PaginatedQueryList<T> query(Class<T> clazz, DynamoDBQueryExpression queryExpression) {
return query(clazz, queryExpression, config);
} | [
"public",
"<",
"T",
">",
"PaginatedQueryList",
"<",
"T",
">",
"query",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"DynamoDBQueryExpression",
"queryExpression",
")",
"{",
"return",
"query",
"(",
"clazz",
",",
"queryExpression",
",",
"config",
")",
";",
"}"
... | Queries an Amazon DynamoDB table and returns the matching results as an
unmodifiable list of instantiated objects, using the default
configuration.
@see DynamoDBMapper#query(Class, DynamoDBQueryExpression,
DynamoDBMapperConfig) | [
"Queries",
"an",
"Amazon",
"DynamoDB",
"table",
"and",
"returns",
"the",
"matching",
"results",
"as",
"an",
"unmodifiable",
"list",
"of",
"instantiated",
"objects",
"using",
"the",
"default",
"configuration",
"."
] | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java#L1132-L1134 | train |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java | DynamoDBMapper.count | public int count(Class<?> clazz, DynamoDBQueryExpression queryExpression, DynamoDBMapperConfig config) {
config = mergeConfig(config);
QueryRequest queryRequest = createQueryRequestFromExpression(clazz, queryExpression, config);
queryRequest.setCount(true);
// Count queries can also be... | java | public int count(Class<?> clazz, DynamoDBQueryExpression queryExpression, DynamoDBMapperConfig config) {
config = mergeConfig(config);
QueryRequest queryRequest = createQueryRequestFromExpression(clazz, queryExpression, config);
queryRequest.setCount(true);
// Count queries can also be... | [
"public",
"int",
"count",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"DynamoDBQueryExpression",
"queryExpression",
",",
"DynamoDBMapperConfig",
"config",
")",
"{",
"config",
"=",
"mergeConfig",
"(",
"config",
")",
";",
"QueryRequest",
"queryRequest",
"=",
"creat... | Evaluates the specified query expression and returns the count of
matching items, without returning any of the actual item data.
@param clazz
The class mapped to a DynamoDB table.
@param queryExpression
The parameters for running the scan.
@param config
The mapper configuration to use for the query, which overrides
th... | [
"Evaluates",
"the",
"specified",
"query",
"expression",
"and",
"returns",
"the",
"count",
"of",
"matching",
"items",
"without",
"returning",
"any",
"of",
"the",
"actual",
"item",
"data",
"."
] | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java#L1290-L1306 | train |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java | DynamoDBMapper.mergeConfig | private DynamoDBMapperConfig mergeConfig(DynamoDBMapperConfig config) {
if ( config != this.config )
config = new DynamoDBMapperConfig(this.config, config);
return config;
} | java | private DynamoDBMapperConfig mergeConfig(DynamoDBMapperConfig config) {
if ( config != this.config )
config = new DynamoDBMapperConfig(this.config, config);
return config;
} | [
"private",
"DynamoDBMapperConfig",
"mergeConfig",
"(",
"DynamoDBMapperConfig",
"config",
")",
"{",
"if",
"(",
"config",
"!=",
"this",
".",
"config",
")",
"config",
"=",
"new",
"DynamoDBMapperConfig",
"(",
"this",
".",
"config",
",",
"config",
")",
";",
"return... | Merges the config object given with the one specified at construction and
returns the result. | [
"Merges",
"the",
"config",
"object",
"given",
"with",
"the",
"one",
"specified",
"at",
"construction",
"and",
"returns",
"the",
"result",
"."
] | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java#L1312-L1316 | train |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java | DynamoDBMapper.transformAttributeUpdates | private Map<String, AttributeValueUpdate> transformAttributeUpdates(Class<?> clazz,
Key objectKey, Map<String, AttributeValueUpdate> updateValues) {
Map<String, AttributeValue> item = convertToItem(updateValues);
boolean hashKeyAdded = false;
boolean rangeKeyAdded = false;
S... | java | private Map<String, AttributeValueUpdate> transformAttributeUpdates(Class<?> clazz,
Key objectKey, Map<String, AttributeValueUpdate> updateValues) {
Map<String, AttributeValue> item = convertToItem(updateValues);
boolean hashKeyAdded = false;
boolean rangeKeyAdded = false;
S... | [
"private",
"Map",
"<",
"String",
",",
"AttributeValueUpdate",
">",
"transformAttributeUpdates",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"Key",
"objectKey",
",",
"Map",
"<",
"String",
",",
"AttributeValueUpdate",
">",
"updateValues",
")",
"{",
"Map",
"<",
... | A transformation expects to see all values, including keys, when
determining the transformation, therefore we must insert them if they are
not already present. However, we must remove the keys prior to actual
storage as this method is called when updating DynamoDB, which does
not permit the modification of key attribut... | [
"A",
"transformation",
"expects",
"to",
"see",
"all",
"values",
"including",
"keys",
"when",
"determining",
"the",
"transformation",
"therefore",
"we",
"must",
"insert",
"them",
"if",
"they",
"are",
"not",
"already",
"present",
".",
"However",
"we",
"must",
"r... | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java#L1407-L1452 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/EventsListener.java | EventsListener.rebind | public static void rebind(Element e) {
EventsListener ret = getGQueryEventListener(e);
if (ret != null) {
DOM.setEventListener((com.google.gwt.user.client.Element) e, ret);
}
} | java | public static void rebind(Element e) {
EventsListener ret = getGQueryEventListener(e);
if (ret != null) {
DOM.setEventListener((com.google.gwt.user.client.Element) e, ret);
}
} | [
"public",
"static",
"void",
"rebind",
"(",
"Element",
"e",
")",
"{",
"EventsListener",
"ret",
"=",
"getGQueryEventListener",
"(",
"e",
")",
";",
"if",
"(",
"ret",
"!=",
"null",
")",
"{",
"DOM",
".",
"setEventListener",
"(",
"(",
"com",
".",
"google",
"... | We have to set the gQuery event listener to the element again when
the element is a widget, because when GWT detaches a widget it removes the
event listener. | [
"We",
"have",
"to",
"set",
"the",
"gQuery",
"event",
"listener",
"to",
"the",
"element",
"again",
"when",
"the",
"element",
"is",
"a",
"widget",
"because",
"when",
"GWT",
"detaches",
"a",
"widget",
"it",
"removes",
"the",
"event",
"listener",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/EventsListener.java#L386-L391 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/EventsListener.java | EventsListener.hasHandlers | public boolean hasHandlers(int eventBits, String eventName, Function handler) {
for (int i = 0, j = elementEvents.length(); i < j; i++) {
BindFunction function = elementEvents.get(i);
if ((function.hasEventType(eventBits) || function.isTypeOf(eventName))
&& (handler == null || function.isEquals... | java | public boolean hasHandlers(int eventBits, String eventName, Function handler) {
for (int i = 0, j = elementEvents.length(); i < j; i++) {
BindFunction function = elementEvents.get(i);
if ((function.hasEventType(eventBits) || function.isTypeOf(eventName))
&& (handler == null || function.isEquals... | [
"public",
"boolean",
"hasHandlers",
"(",
"int",
"eventBits",
",",
"String",
"eventName",
",",
"Function",
"handler",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"j",
"=",
"elementEvents",
".",
"length",
"(",
")",
";",
"i",
"<",
"j",
";",
"i",
... | Return true if the element is listening for the
given eventBit or eventName and the handler matches. | [
"Return",
"true",
"if",
"the",
"element",
"is",
"listening",
"for",
"the",
"given",
"eventBit",
"or",
"eventName",
"and",
"the",
"handler",
"matches",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/EventsListener.java#L705-L714 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/vm/CookieManager.java | CookieManager.storeCookies | public void storeCookies(URLConnection conn) throws IOException {
// let's determine the domain from where these cookies are being sent
String domain = getDomainFromHost(conn.getURL().getHost());
Map<String, Map<String, String>> domainStore; // this is where we will store cookies for this domain
// no... | java | public void storeCookies(URLConnection conn) throws IOException {
// let's determine the domain from where these cookies are being sent
String domain = getDomainFromHost(conn.getURL().getHost());
Map<String, Map<String, String>> domainStore; // this is where we will store cookies for this domain
// no... | [
"public",
"void",
"storeCookies",
"(",
"URLConnection",
"conn",
")",
"throws",
"IOException",
"{",
"// let's determine the domain from where these cookies are being sent",
"String",
"domain",
"=",
"getDomainFromHost",
"(",
"conn",
".",
"getURL",
"(",
")",
".",
"getHost",
... | Retrieves and stores cookies returned by the host on the other side of the the open
java.net.URLConnection.
The connection MUST have been opened using the connect() method or a IOException will be
thrown.
@param conn a java.net.URLConnection - must be open, or IOException will be thrown
@throws java.io.IOException Th... | [
"Retrieves",
"and",
"stores",
"cookies",
"returned",
"by",
"the",
"host",
"on",
"the",
"other",
"side",
"of",
"the",
"the",
"open",
"java",
".",
"net",
".",
"URLConnection",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/vm/CookieManager.java#L106-L152 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/vm/CookieManager.java | CookieManager.setCookies | public void setCookies(URLConnection conn) throws IOException {
// let's determine the domain and path to retrieve the appropriate cookies
URL url = conn.getURL();
String domain = getDomainFromHost(url.getHost());
if (domain.equals("localhost")) {
domain = "linkedin.com";
}
String path = ... | java | public void setCookies(URLConnection conn) throws IOException {
// let's determine the domain and path to retrieve the appropriate cookies
URL url = conn.getURL();
String domain = getDomainFromHost(url.getHost());
if (domain.equals("localhost")) {
domain = "linkedin.com";
}
String path = ... | [
"public",
"void",
"setCookies",
"(",
"URLConnection",
"conn",
")",
"throws",
"IOException",
"{",
"// let's determine the domain and path to retrieve the appropriate cookies",
"URL",
"url",
"=",
"conn",
".",
"getURL",
"(",
")",
";",
"String",
"domain",
"=",
"getDomainFro... | Prior to opening a URLConnection, calling this method will set all unexpired cookies that match
the path or subpaths for thi underlying URL
The connection MUST NOT have been opened method or an IOException will be thrown.
@param conn a java.net.URLConnection - must NOT be open, or IOException will be thrown
@throws j... | [
"Prior",
"to",
"opening",
"a",
"URLConnection",
"calling",
"this",
"method",
"will",
"set",
"all",
"unexpired",
"cookies",
"that",
"match",
"the",
"path",
"or",
"subpaths",
"for",
"thi",
"underlying",
"URL"
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/vm/CookieManager.java#L163-L202 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/WidgetsUtils.java | WidgetsUtils.matchesTags | public static boolean matchesTags(Element e, String... tagNames) {
assert e != null : "Element cannot be null";
StringBuilder regExp = new StringBuilder("^(");
int tagNameLenght = tagNames != null ? tagNames.length : 0;
for (int i = 0; i < tagNameLenght; i++) {
regExp.append(tagNames[i].toUpperC... | java | public static boolean matchesTags(Element e, String... tagNames) {
assert e != null : "Element cannot be null";
StringBuilder regExp = new StringBuilder("^(");
int tagNameLenght = tagNames != null ? tagNames.length : 0;
for (int i = 0; i < tagNameLenght; i++) {
regExp.append(tagNames[i].toUpperC... | [
"public",
"static",
"boolean",
"matchesTags",
"(",
"Element",
"e",
",",
"String",
"...",
"tagNames",
")",
"{",
"assert",
"e",
"!=",
"null",
":",
"\"Element cannot be null\"",
";",
"StringBuilder",
"regExp",
"=",
"new",
"StringBuilder",
"(",
"\"^(\"",
")",
";",... | Test if the tag name of the element is one of tag names given in parameter.
@param tagNames
@return | [
"Test",
"if",
"the",
"tag",
"name",
"of",
"the",
"element",
"is",
"one",
"of",
"tag",
"names",
"given",
"in",
"parameter",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/WidgetsUtils.java#L67-L82 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/WidgetsUtils.java | WidgetsUtils.attachWidget | public static void attachWidget(Widget widget, Widget firstParentWidget) {
if (widget != null && widget.getParent() == null) {
if (firstParentWidget == null) {
firstParentWidget = getFirstParentWidget(widget);
if (firstParentWidget == null) {
RootPanel.detachOnWindowClose(widget);
... | java | public static void attachWidget(Widget widget, Widget firstParentWidget) {
if (widget != null && widget.getParent() == null) {
if (firstParentWidget == null) {
firstParentWidget = getFirstParentWidget(widget);
if (firstParentWidget == null) {
RootPanel.detachOnWindowClose(widget);
... | [
"public",
"static",
"void",
"attachWidget",
"(",
"Widget",
"widget",
",",
"Widget",
"firstParentWidget",
")",
"{",
"if",
"(",
"widget",
"!=",
"null",
"&&",
"widget",
".",
"getParent",
"(",
")",
"==",
"null",
")",
"{",
"if",
"(",
"firstParentWidget",
"==",
... | Attach a widget to the GWT widget list. Normally used when GQuery
creates widgets wrapping existing dom elements.
It does nothing if the widget is already attached to another widget.
@param widget to attach
@param firstParentWidget the parent widget,
If it is null and it is not inside any other widget, we just add
the... | [
"Attach",
"a",
"widget",
"to",
"the",
"GWT",
"widget",
"list",
".",
"Normally",
"used",
"when",
"GQuery",
"creates",
"widgets",
"wrapping",
"existing",
"dom",
"elements",
".",
"It",
"does",
"nothing",
"if",
"the",
"widget",
"is",
"already",
"attached",
"to",... | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/WidgetsUtils.java#L186-L217 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/WidgetsUtils.java | WidgetsUtils.getChildren | public static Iterator<Widget> getChildren(Widget w) {
if (w instanceof Panel) {
return ((Panel) w).iterator();
}
if (w instanceof Composite) {
return getChildren(compositeGetWidget((Composite) w));
}
return null;
} | java | public static Iterator<Widget> getChildren(Widget w) {
if (w instanceof Panel) {
return ((Panel) w).iterator();
}
if (w instanceof Composite) {
return getChildren(compositeGetWidget((Composite) w));
}
return null;
} | [
"public",
"static",
"Iterator",
"<",
"Widget",
">",
"getChildren",
"(",
"Widget",
"w",
")",
"{",
"if",
"(",
"w",
"instanceof",
"Panel",
")",
"{",
"return",
"(",
"(",
"Panel",
")",
"w",
")",
".",
"iterator",
"(",
")",
";",
"}",
"if",
"(",
"w",
"in... | Return children of the first widget's panel. | [
"Return",
"children",
"of",
"the",
"first",
"widget",
"s",
"panel",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/WidgetsUtils.java#L247-L255 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/GqEvent.java | GqEvent.pageX | public final int pageX() {
if (getTouches() != null && getTouches().length() > 0) {
return getTouches().get(0).getPageX();
} else {
return getClientX() + GQuery.document.getScrollLeft();
}
} | java | public final int pageX() {
if (getTouches() != null && getTouches().length() > 0) {
return getTouches().get(0).getPageX();
} else {
return getClientX() + GQuery.document.getScrollLeft();
}
} | [
"public",
"final",
"int",
"pageX",
"(",
")",
"{",
"if",
"(",
"getTouches",
"(",
")",
"!=",
"null",
"&&",
"getTouches",
"(",
")",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"return",
"getTouches",
"(",
")",
".",
"get",
"(",
"0",
")",
".",
"get... | The mouse position relative to the left edge of the document. | [
"The",
"mouse",
"position",
"relative",
"to",
"the",
"left",
"edge",
"of",
"the",
"document",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/GqEvent.java#L91-L97 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/GqEvent.java | GqEvent.pageY | public final int pageY() {
if (getTouches() != null && getTouches().length() > 0) {
return getTouches().get(0).getPageY();
} else {
return getClientY() + GQuery.document.getScrollTop();
}
} | java | public final int pageY() {
if (getTouches() != null && getTouches().length() > 0) {
return getTouches().get(0).getPageY();
} else {
return getClientY() + GQuery.document.getScrollTop();
}
} | [
"public",
"final",
"int",
"pageY",
"(",
")",
"{",
"if",
"(",
"getTouches",
"(",
")",
"!=",
"null",
"&&",
"getTouches",
"(",
")",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"return",
"getTouches",
"(",
")",
".",
"get",
"(",
"0",
")",
".",
"get... | The mouse position relative to the top edge of the document. | [
"The",
"mouse",
"position",
"relative",
"to",
"the",
"top",
"edge",
"of",
"the",
"document",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/GqEvent.java#L103-L109 | train |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/model/ListTablesResult.java | ListTablesResult.setTableNames | public void setTableNames(java.util.Collection<String> tableNames) {
if (tableNames == null) {
this.tableNames = null;
return;
}
java.util.List<String> tableNamesCopy = new java.util.ArrayList<String>(tableNames.size());
tableNamesCopy.addAll(tableNames);
... | java | public void setTableNames(java.util.Collection<String> tableNames) {
if (tableNames == null) {
this.tableNames = null;
return;
}
java.util.List<String> tableNamesCopy = new java.util.ArrayList<String>(tableNames.size());
tableNamesCopy.addAll(tableNames);
... | [
"public",
"void",
"setTableNames",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"String",
">",
"tableNames",
")",
"{",
"if",
"(",
"tableNames",
"==",
"null",
")",
"{",
"this",
".",
"tableNames",
"=",
"null",
";",
"return",
";",
"}",
"java",
".",
... | Sets the value of the TableNames property for this object.
@param tableNames The new value for the TableNames property for this object. | [
"Sets",
"the",
"value",
"of",
"the",
"TableNames",
"property",
"for",
"this",
"object",
"."
] | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/model/ListTablesResult.java#L54-L63 | train |
beckchr/juel | modules/api/src/main/java/javax/el/ELContext.java | ELContext.getContext | public Object getContext(Class<?> key) {
if (key == null) {
throw new NullPointerException("key is null");
}
if (context == null) {
return null;
}
return context.get(key);
} | java | public Object getContext(Class<?> key) {
if (key == null) {
throw new NullPointerException("key is null");
}
if (context == null) {
return null;
}
return context.get(key);
} | [
"public",
"Object",
"getContext",
"(",
"Class",
"<",
"?",
">",
"key",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"key is null\"",
")",
";",
"}",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"re... | Returns the context object associated with the given key. The ELContext maintains a
collection of context objects relevant to the evaluation of an expression. These context
objects are used by ELResolvers. This method is used to retrieve the context with the given
key from the collection. By convention, the object retu... | [
"Returns",
"the",
"context",
"object",
"associated",
"with",
"the",
"given",
"key",
".",
"The",
"ELContext",
"maintains",
"a",
"collection",
"of",
"context",
"objects",
"relevant",
"to",
"the",
"evaluation",
"of",
"an",
"expression",
".",
"These",
"context",
"... | 1a8fb366b7349ddae81f806dee1ab2de11b672c7 | https://github.com/beckchr/juel/blob/1a8fb366b7349ddae81f806dee1ab2de11b672c7/modules/api/src/main/java/javax/el/ELContext.java#L64-L72 | train |
beckchr/juel | modules/api/src/main/java/javax/el/ELContext.java | ELContext.putContext | public void putContext(Class<?> key, Object contextObject) {
if (key == null) {
throw new NullPointerException("key is null");
}
if (context == null) {
context = new HashMap<Class<?>, Object>();
}
context.put(key, contextObject);
} | java | public void putContext(Class<?> key, Object contextObject) {
if (key == null) {
throw new NullPointerException("key is null");
}
if (context == null) {
context = new HashMap<Class<?>, Object>();
}
context.put(key, contextObject);
} | [
"public",
"void",
"putContext",
"(",
"Class",
"<",
"?",
">",
"key",
",",
"Object",
"contextObject",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"key is null\"",
")",
";",
"}",
"if",
"(",
"context",
... | Associates a context object with this ELContext. The ELContext maintains a collection of
context objects relevant to the evaluation of an expression. These context objects are used
by ELResolvers. This method is used to add a context object to that collection. By
convention, the contextObject will be of the type specif... | [
"Associates",
"a",
"context",
"object",
"with",
"this",
"ELContext",
".",
"The",
"ELContext",
"maintains",
"a",
"collection",
"of",
"context",
"objects",
"relevant",
"to",
"the",
"evaluation",
"of",
"an",
"expression",
".",
"These",
"context",
"objects",
"are",
... | 1a8fb366b7349ddae81f806dee1ab2de11b672c7 | https://github.com/beckchr/juel/blob/1a8fb366b7349ddae81f806dee1ab2de11b672c7/modules/api/src/main/java/javax/el/ELContext.java#L138-L146 | train |
beckchr/juel | samples/src/de/odysseus/el/samples/xml/sax/XMELFilter.java | XMELFilter.main | public static void main(String[] args) throws SAXException, IOException {
// create our expression context
ELContext context = new SimpleContext();
// set value for top-level property "home"
context.getELResolver().setValue(context, null, "home", "/foo/bar");
// create our filtered reader
XMLReader re... | java | public static void main(String[] args) throws SAXException, IOException {
// create our expression context
ELContext context = new SimpleContext();
// set value for top-level property "home"
context.getELResolver().setValue(context, null, "home", "/foo/bar");
// create our filtered reader
XMLReader re... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"// create our expression context\r",
"ELContext",
"context",
"=",
"new",
"SimpleContext",
"(",
")",
";",
"// set value for top-level property ... | Usage example. | [
"Usage",
"example",
"."
] | 1a8fb366b7349ddae81f806dee1ab2de11b672c7 | https://github.com/beckchr/juel/blob/1a8fb366b7349ddae81f806dee1ab2de11b672c7/samples/src/de/odysseus/el/samples/xml/sax/XMELFilter.java#L53-L81 | train |
beckchr/juel | modules/impl/src/main/java/de/odysseus/el/tree/Bindings.java | Bindings.convert | public <T> T convert(Object value, Class<T> type) {
return converter.convert(value, type);
} | java | public <T> T convert(Object value, Class<T> type) {
return converter.convert(value, type);
} | [
"public",
"<",
"T",
">",
"T",
"convert",
"(",
"Object",
"value",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"return",
"converter",
".",
"convert",
"(",
"value",
",",
"type",
")",
";",
"}"
] | Apply type conversion.
@param value value to convert
@param type target type
@return converted value
@throws ELException | [
"Apply",
"type",
"conversion",
"."
] | 1a8fb366b7349ddae81f806dee1ab2de11b672c7 | https://github.com/beckchr/juel/blob/1a8fb366b7349ddae81f806dee1ab2de11b672c7/modules/impl/src/main/java/de/odysseus/el/tree/Bindings.java#L137-L139 | train |
druid-io/druid-api | src/main/java/io/druid/segment/loading/DataSegmentPusherUtil.java | DataSegmentPusherUtil.getStorageDir | public static String getStorageDir(DataSegment segment)
{
return JOINER.join(
segment.getDataSource(),
String.format(
"%s_%s",
segment.getInterval().getStart(),
segment.getInterval().getEnd()
),
segment.getVersion(),
segment.getShardSpec(... | java | public static String getStorageDir(DataSegment segment)
{
return JOINER.join(
segment.getDataSource(),
String.format(
"%s_%s",
segment.getInterval().getStart(),
segment.getInterval().getEnd()
),
segment.getVersion(),
segment.getShardSpec(... | [
"public",
"static",
"String",
"getStorageDir",
"(",
"DataSegment",
"segment",
")",
"{",
"return",
"JOINER",
".",
"join",
"(",
"segment",
".",
"getDataSource",
"(",
")",
",",
"String",
".",
"format",
"(",
"\"%s_%s\"",
",",
"segment",
".",
"getInterval",
"(",
... | on segment deletion if segment being deleted was the only segment | [
"on",
"segment",
"deletion",
"if",
"segment",
"being",
"deleted",
"was",
"the",
"only",
"segment"
] | d822339d30bcac5c59eeffd6e255f69671d5e57c | https://github.com/druid-io/druid-api/blob/d822339d30bcac5c59eeffd6e255f69671d5e57c/src/main/java/io/druid/segment/loading/DataSegmentPusherUtil.java#L36-L48 | train |
dvdme/forecastio-lib-java | src/com/github/dvdme/ForecastIOLib/FIODataPoint.java | FIODataPoint.update | void update(JsonObject dp){
for(int i = 0; i < dp.names().size(); i++){
datapoint.put(dp.names().get(i), dp.get(dp.names().get(i)));
}
} | java | void update(JsonObject dp){
for(int i = 0; i < dp.names().size(); i++){
datapoint.put(dp.names().get(i), dp.get(dp.names().get(i)));
}
} | [
"void",
"update",
"(",
"JsonObject",
"dp",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"dp",
".",
"names",
"(",
")",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"datapoint",
".",
"put",
"(",
"dp",
".",
"names",
"(",
")",... | Updates the data point data
@param dp JsonObect with the data | [
"Updates",
"the",
"data",
"point",
"data"
] | 63c0ff17446eb7eb4e9f8bef4e19272f14c74e85 | https://github.com/dvdme/forecastio-lib-java/blob/63c0ff17446eb7eb4e9f8bef4e19272f14c74e85/src/com/github/dvdme/ForecastIOLib/FIODataPoint.java#L38-L42 | train |
dvdme/forecastio-lib-java | src/com/github/dvdme/ForecastIOLib/FIODataPoint.java | FIODataPoint.getFieldsArray | public String [] getFieldsArray(){
Object [] obj = datapoint.keySet().toArray();
String [] out = new String[obj.length];
for(int i=0; i<obj.length; i++)
out[i] = String.valueOf(obj[i]);
return out;
} | java | public String [] getFieldsArray(){
Object [] obj = datapoint.keySet().toArray();
String [] out = new String[obj.length];
for(int i=0; i<obj.length; i++)
out[i] = String.valueOf(obj[i]);
return out;
} | [
"public",
"String",
"[",
"]",
"getFieldsArray",
"(",
")",
"{",
"Object",
"[",
"]",
"obj",
"=",
"datapoint",
".",
"keySet",
"(",
")",
".",
"toArray",
"(",
")",
";",
"String",
"[",
"]",
"out",
"=",
"new",
"String",
"[",
"obj",
".",
"length",
"]",
"... | Returns a String array with all the Forecast.io fields available
in this data point. It can be usefull to iterate over all
available fields in a data point.
@return the String array with the field's names. | [
"Returns",
"a",
"String",
"array",
"with",
"all",
"the",
"Forecast",
".",
"io",
"fields",
"available",
"in",
"this",
"data",
"point",
".",
"It",
"can",
"be",
"usefull",
"to",
"iterate",
"over",
"all",
"available",
"fields",
"in",
"a",
"data",
"point",
".... | 63c0ff17446eb7eb4e9f8bef4e19272f14c74e85 | https://github.com/dvdme/forecastio-lib-java/blob/63c0ff17446eb7eb4e9f8bef4e19272f14c74e85/src/com/github/dvdme/ForecastIOLib/FIODataPoint.java#L62-L68 | train |
dvdme/forecastio-lib-java | src/com/github/dvdme/ForecastIOLib/FIODataPoint.java | FIODataPoint.getByKey | public String getByKey(String key){
String out = "";
if(key.equals("time"))
return time();
if(key.contains("Time")){
DateFormat dfm = new SimpleDateFormat("HH:mm:ss");
dfm.setTimeZone(TimeZone.getTimeZone(timezone));
out = dfm.format( Long.parseLong(String.valueOf(this.datapoint.get(key))) * 1000 );
... | java | public String getByKey(String key){
String out = "";
if(key.equals("time"))
return time();
if(key.contains("Time")){
DateFormat dfm = new SimpleDateFormat("HH:mm:ss");
dfm.setTimeZone(TimeZone.getTimeZone(timezone));
out = dfm.format( Long.parseLong(String.valueOf(this.datapoint.get(key))) * 1000 );
... | [
"public",
"String",
"getByKey",
"(",
"String",
"key",
")",
"{",
"String",
"out",
"=",
"\"\"",
";",
"if",
"(",
"key",
".",
"equals",
"(",
"\"time\"",
")",
")",
"return",
"time",
"(",
")",
";",
"if",
"(",
"key",
".",
"contains",
"(",
"\"Time\"",
")",... | Return the data point field with the corresponding key
@param key name of the field in the data point
@return the field value | [
"Return",
"the",
"data",
"point",
"field",
"with",
"the",
"corresponding",
"key"
] | 63c0ff17446eb7eb4e9f8bef4e19272f14c74e85 | https://github.com/dvdme/forecastio-lib-java/blob/63c0ff17446eb7eb4e9f8bef4e19272f14c74e85/src/com/github/dvdme/ForecastIOLib/FIODataPoint.java#L94-L106 | train |
dvdme/forecastio-lib-java | src/com/github/dvdme/ForecastIOLib/ForecastIO.java | ForecastIO.setHTTPProxy | public void setHTTPProxy(String PROXYNAME, int PROXYPORT) {
if (PROXYNAME == null) {
this.proxy_to_use = null;
}
else {
this.proxy_to_use = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(PROXYNAME, PROXYPORT));
}
} | java | public void setHTTPProxy(String PROXYNAME, int PROXYPORT) {
if (PROXYNAME == null) {
this.proxy_to_use = null;
}
else {
this.proxy_to_use = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(PROXYNAME, PROXYPORT));
}
} | [
"public",
"void",
"setHTTPProxy",
"(",
"String",
"PROXYNAME",
",",
"int",
"PROXYPORT",
")",
"{",
"if",
"(",
"PROXYNAME",
"==",
"null",
")",
"{",
"this",
".",
"proxy_to_use",
"=",
"null",
";",
"}",
"else",
"{",
"this",
".",
"proxy_to_use",
"=",
"new",
"... | Sets the http-proxy to use.
@param PROXYNAME hostname or ip of the proxy to use (e.g. "127.0.0.1"). If proxyname equals null, no proxy will be used.
@param PROXYPORT port of the proxy to use (e.g. 8080) | [
"Sets",
"the",
"http",
"-",
"proxy",
"to",
"use",
"."
] | 63c0ff17446eb7eb4e9f8bef4e19272f14c74e85 | https://github.com/dvdme/forecastio-lib-java/blob/63c0ff17446eb7eb4e9f8bef4e19272f14c74e85/src/com/github/dvdme/ForecastIOLib/ForecastIO.java#L285-L292 | train |
dvdme/forecastio-lib-java | src/com/github/dvdme/ForecastIOLib/ForecastIO.java | ForecastIO.update | public boolean update(){
boolean b = getForecast(String.valueOf(getLatitude()), String.valueOf(getLongitude()));
return b;
} | java | public boolean update(){
boolean b = getForecast(String.valueOf(getLatitude()), String.valueOf(getLongitude()));
return b;
} | [
"public",
"boolean",
"update",
"(",
")",
"{",
"boolean",
"b",
"=",
"getForecast",
"(",
"String",
".",
"valueOf",
"(",
"getLatitude",
"(",
")",
")",
",",
"String",
".",
"valueOf",
"(",
"getLongitude",
"(",
")",
")",
")",
";",
"return",
"b",
";",
"}"
] | Does another query to the API and updates the data
This only updates the data in ForecastIO class
@return True if successful | [
"Does",
"another",
"query",
"to",
"the",
"API",
"and",
"updates",
"the",
"data",
"This",
"only",
"updates",
"the",
"data",
"in",
"ForecastIO",
"class"
] | 63c0ff17446eb7eb4e9f8bef4e19272f14c74e85 | https://github.com/dvdme/forecastio-lib-java/blob/63c0ff17446eb7eb4e9f8bef4e19272f14c74e85/src/com/github/dvdme/ForecastIOLib/ForecastIO.java#L544-L547 | train |
dvdme/forecastio-lib-java | src/com/github/dvdme/ForecastIOLib/ForecastIO.java | ForecastIO.getForecast | public boolean getForecast(String LATITUDE, String LONGITUDE) {
try {
String reply = httpGET( urlBuilder(LATITUDE, LONGITUDE) );
if(reply == null)
return false;
this.forecast = Json.parse(reply).asObject();
//this.forecast = JsonObject.readFrom(reply);
} catch (NullPointerException e) {
System.... | java | public boolean getForecast(String LATITUDE, String LONGITUDE) {
try {
String reply = httpGET( urlBuilder(LATITUDE, LONGITUDE) );
if(reply == null)
return false;
this.forecast = Json.parse(reply).asObject();
//this.forecast = JsonObject.readFrom(reply);
} catch (NullPointerException e) {
System.... | [
"public",
"boolean",
"getForecast",
"(",
"String",
"LATITUDE",
",",
"String",
"LONGITUDE",
")",
"{",
"try",
"{",
"String",
"reply",
"=",
"httpGET",
"(",
"urlBuilder",
"(",
"LATITUDE",
",",
"LONGITUDE",
")",
")",
";",
"if",
"(",
"reply",
"==",
"null",
")"... | Gets the forecast reports for the given coordinates with the set options
@param LATITUDE the geographical latitude
@param LONGITUDE the geographical longitude
@return True if successful | [
"Gets",
"the",
"forecast",
"reports",
"for",
"the",
"given",
"coordinates",
"with",
"the",
"set",
"options"
] | 63c0ff17446eb7eb4e9f8bef4e19272f14c74e85 | https://github.com/dvdme/forecastio-lib-java/blob/63c0ff17446eb7eb4e9f8bef4e19272f14c74e85/src/com/github/dvdme/ForecastIOLib/ForecastIO.java#L555-L572 | train |
dvdme/forecastio-lib-java | src/com/github/dvdme/ForecastIOLib/ForecastIO.java | ForecastIO.getForecast | public boolean getForecast(String http_response) {
this.forecast = Json.parse(http_response).asObject();
//this.forecast = JsonObject.readFrom(http_response);
return getForecast(this.forecast);
} | java | public boolean getForecast(String http_response) {
this.forecast = Json.parse(http_response).asObject();
//this.forecast = JsonObject.readFrom(http_response);
return getForecast(this.forecast);
} | [
"public",
"boolean",
"getForecast",
"(",
"String",
"http_response",
")",
"{",
"this",
".",
"forecast",
"=",
"Json",
".",
"parse",
"(",
"http_response",
")",
".",
"asObject",
"(",
")",
";",
"//this.forecast = JsonObject.readFrom(http_response);",
"return",
"getForeca... | Parses the forecast reports for the given coordinates with the set options
Useful to use with an external http library
@param http_response String
@return boolean | [
"Parses",
"the",
"forecast",
"reports",
"for",
"the",
"given",
"coordinates",
"with",
"the",
"set",
"options",
"Useful",
"to",
"use",
"with",
"an",
"external",
"http",
"library"
] | 63c0ff17446eb7eb4e9f8bef4e19272f14c74e85 | https://github.com/dvdme/forecastio-lib-java/blob/63c0ff17446eb7eb4e9f8bef4e19272f14c74e85/src/com/github/dvdme/ForecastIOLib/ForecastIO.java#L590-L594 | train |
canoo/dolphin-platform | platform/dolphin-platform-remoting-client/src/main/java/com/canoo/dp/impl/client/legacy/communication/AbstractClientConnector.java | AbstractClientConnector.listen | protected void listen() {
if (!connectedFlag.get() || releaseNeeded.get()) {
return;
}
releaseNeeded.set(true);
try {
send(pushListener, new OnFinishedHandler() {
@Override
public void onFinished() {
releaseNeed... | java | protected void listen() {
if (!connectedFlag.get() || releaseNeeded.get()) {
return;
}
releaseNeeded.set(true);
try {
send(pushListener, new OnFinishedHandler() {
@Override
public void onFinished() {
releaseNeed... | [
"protected",
"void",
"listen",
"(",
")",
"{",
"if",
"(",
"!",
"connectedFlag",
".",
"get",
"(",
")",
"||",
"releaseNeeded",
".",
"get",
"(",
")",
")",
"{",
"return",
";",
"}",
"releaseNeeded",
".",
"set",
"(",
"true",
")",
";",
"try",
"{",
"send",
... | listens for the pushListener to return. The pushListener must be set and pushEnabled must be true. | [
"listens",
"for",
"the",
"pushListener",
"to",
"return",
".",
"The",
"pushListener",
"must",
"be",
"set",
"and",
"pushEnabled",
"must",
"be",
"true",
"."
] | fb99c1fab24df80d2fa094d8688b546140146874 | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-remoting-client/src/main/java/com/canoo/dp/impl/client/legacy/communication/AbstractClientConnector.java#L205-L222 | train |
canoo/dolphin-platform | platform/dolphin-platform-remoting-client/src/main/java/com/canoo/dp/impl/client/legacy/communication/AbstractClientConnector.java | AbstractClientConnector.release | protected void release() {
if (!releaseNeeded.get()) {
return; // there is no point in releasing if we do not wait. Avoid excessive releasing.
}
releaseNeeded.set(false);// release is under way
backgroundExecutor.execute(new Runnable() {
@Override
pub... | java | protected void release() {
if (!releaseNeeded.get()) {
return; // there is no point in releasing if we do not wait. Avoid excessive releasing.
}
releaseNeeded.set(false);// release is under way
backgroundExecutor.execute(new Runnable() {
@Override
pub... | [
"protected",
"void",
"release",
"(",
")",
"{",
"if",
"(",
"!",
"releaseNeeded",
".",
"get",
"(",
")",
")",
"{",
"return",
";",
"// there is no point in releasing if we do not wait. Avoid excessive releasing.",
"}",
"releaseNeeded",
".",
"set",
"(",
"false",
")",
"... | Release the current push listener, which blocks the sending queue.
Does nothing in case that the push listener is not active. | [
"Release",
"the",
"current",
"push",
"listener",
"which",
"blocks",
"the",
"sending",
"queue",
".",
"Does",
"nothing",
"in",
"case",
"that",
"the",
"push",
"listener",
"is",
"not",
"active",
"."
] | fb99c1fab24df80d2fa094d8688b546140146874 | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-remoting-client/src/main/java/com/canoo/dp/impl/client/legacy/communication/AbstractClientConnector.java#L228-L245 | train |
canoo/dolphin-platform | platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/legacy/ServerConnector.java | ServerConnector.receive | public List<Command> receive(final Command command) {
Assert.requireNonNull(command, "command");
LOG.trace("Received command of type {}", command.getClass().getSimpleName());
List<Command> response = new LinkedList();// collecting parameter pattern
if (!(command instanceof InterruptLon... | java | public List<Command> receive(final Command command) {
Assert.requireNonNull(command, "command");
LOG.trace("Received command of type {}", command.getClass().getSimpleName());
List<Command> response = new LinkedList();// collecting parameter pattern
if (!(command instanceof InterruptLon... | [
"public",
"List",
"<",
"Command",
">",
"receive",
"(",
"final",
"Command",
"command",
")",
"{",
"Assert",
".",
"requireNonNull",
"(",
"command",
",",
"\"command\"",
")",
";",
"LOG",
".",
"trace",
"(",
"\"Received command of type {}\"",
",",
"command",
".",
"... | doesn't fail on missing commands | [
"doesn",
"t",
"fail",
"on",
"missing",
"commands"
] | fb99c1fab24df80d2fa094d8688b546140146874 | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/legacy/ServerConnector.java#L59-L94 | train |
canoo/dolphin-platform | platform-extras/dolphin-platform-projector-client/src/main/java/com/canoo/dp/impl/platform/projector/client/css/CssHelper.java | CssHelper.createMetaData | public static <S extends Styleable, V> DefaultPropertyBasedCssMetaData<S, V> createMetaData(String property, StyleConverter<?, V> converter, String propertyName, V defaultValue) {
return new DefaultPropertyBasedCssMetaData<S, V>(property, converter, propertyName, defaultValue);
} | java | public static <S extends Styleable, V> DefaultPropertyBasedCssMetaData<S, V> createMetaData(String property, StyleConverter<?, V> converter, String propertyName, V defaultValue) {
return new DefaultPropertyBasedCssMetaData<S, V>(property, converter, propertyName, defaultValue);
} | [
"public",
"static",
"<",
"S",
"extends",
"Styleable",
",",
"V",
">",
"DefaultPropertyBasedCssMetaData",
"<",
"S",
",",
"V",
">",
"createMetaData",
"(",
"String",
"property",
",",
"StyleConverter",
"<",
"?",
",",
"V",
">",
"converter",
",",
"String",
"propert... | Creates a CssMetaData instance that can be used in a Styleable class.
@param property name of the CSS property
@param converter the StyleConverter used to convert the CSS parsed value to a Java object.
@param propertyName Name of the property field in the Styleable class
@param defaultValue The default value of the co... | [
"Creates",
"a",
"CssMetaData",
"instance",
"that",
"can",
"be",
"used",
"in",
"a",
"Styleable",
"class",
"."
] | fb99c1fab24df80d2fa094d8688b546140146874 | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform-extras/dolphin-platform-projector-client/src/main/java/com/canoo/dp/impl/platform/projector/client/css/CssHelper.java#L102-L104 | train |
canoo/dolphin-platform | platform-extras/dolphin-platform-projector-client/src/main/java/com/canoo/dp/impl/platform/projector/client/css/CssHelper.java | CssHelper.createSkinMetaData | public static <S extends Control, V> SkinPropertyBasedCssMetaData<S, V> createSkinMetaData(String property, StyleConverter<?, V> converter, String propertyName, V defaultValue) {
return new SkinPropertyBasedCssMetaData<S, V>(property, converter, propertyName, defaultValue);
} | java | public static <S extends Control, V> SkinPropertyBasedCssMetaData<S, V> createSkinMetaData(String property, StyleConverter<?, V> converter, String propertyName, V defaultValue) {
return new SkinPropertyBasedCssMetaData<S, V>(property, converter, propertyName, defaultValue);
} | [
"public",
"static",
"<",
"S",
"extends",
"Control",
",",
"V",
">",
"SkinPropertyBasedCssMetaData",
"<",
"S",
",",
"V",
">",
"createSkinMetaData",
"(",
"String",
"property",
",",
"StyleConverter",
"<",
"?",
",",
"V",
">",
"converter",
",",
"String",
"property... | Creates a CssMetaData instance that can be used in the Skin of a Control.
@param property name of the CSS property
@param converter the StyleConverter used to convert the CSS parsed value to a Java object.
@param propertyName Name of the property field in the Skin class
@param defaultValue The default value of the cor... | [
"Creates",
"a",
"CssMetaData",
"instance",
"that",
"can",
"be",
"used",
"in",
"the",
"Skin",
"of",
"a",
"Control",
"."
] | fb99c1fab24df80d2fa094d8688b546140146874 | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform-extras/dolphin-platform-projector-client/src/main/java/com/canoo/dp/impl/platform/projector/client/css/CssHelper.java#L117-L119 | train |
canoo/dolphin-platform | platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/mbean/DolphinContextMBeanRegistry.java | DolphinContextMBeanRegistry.registerDolphinContext | public Subscription registerDolphinContext(ClientSession session, GarbageCollector garbageCollector) {
Assert.requireNonNull(session, "session");
Assert.requireNonNull(garbageCollector, "garbageCollector");
DolphinSessionInfoMBean mBean = new DolphinSessionInfo(session, garbageCollector);
... | java | public Subscription registerDolphinContext(ClientSession session, GarbageCollector garbageCollector) {
Assert.requireNonNull(session, "session");
Assert.requireNonNull(garbageCollector, "garbageCollector");
DolphinSessionInfoMBean mBean = new DolphinSessionInfo(session, garbageCollector);
... | [
"public",
"Subscription",
"registerDolphinContext",
"(",
"ClientSession",
"session",
",",
"GarbageCollector",
"garbageCollector",
")",
"{",
"Assert",
".",
"requireNonNull",
"(",
"session",
",",
"\"session\"",
")",
";",
"Assert",
".",
"requireNonNull",
"(",
"garbageCol... | Register a new dolphin session as a MBean
@param session the session
@return the subscription for deregistration | [
"Register",
"a",
"new",
"dolphin",
"session",
"as",
"a",
"MBean"
] | fb99c1fab24df80d2fa094d8688b546140146874 | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/mbean/DolphinContextMBeanRegistry.java#L48-L53 | train |
canoo/dolphin-platform | platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/mbean/DolphinContextMBeanRegistry.java | DolphinContextMBeanRegistry.registerController | public Subscription registerController(Class<?> controllerClass, String controllerId, ModelProvider modelProvider) {
Assert.requireNonNull(controllerClass, "controllerClass");
Assert.requireNonBlank(controllerId, "controllerId");
Assert.requireNonNull(modelProvider, "modelProvider");
Dol... | java | public Subscription registerController(Class<?> controllerClass, String controllerId, ModelProvider modelProvider) {
Assert.requireNonNull(controllerClass, "controllerClass");
Assert.requireNonBlank(controllerId, "controllerId");
Assert.requireNonNull(modelProvider, "modelProvider");
Dol... | [
"public",
"Subscription",
"registerController",
"(",
"Class",
"<",
"?",
">",
"controllerClass",
",",
"String",
"controllerId",
",",
"ModelProvider",
"modelProvider",
")",
"{",
"Assert",
".",
"requireNonNull",
"(",
"controllerClass",
",",
"\"controllerClass\"",
")",
... | Register a new Dolphin Platform controller as a MBean
@param controllerClass the controller class
@param controllerId the controller id
@param modelProvider the model provider
@return the subscription for deregistration | [
"Register",
"a",
"new",
"Dolphin",
"Platform",
"controller",
"as",
"a",
"MBean"
] | fb99c1fab24df80d2fa094d8688b546140146874 | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/mbean/DolphinContextMBeanRegistry.java#L62-L68 | train |
canoo/dolphin-platform | platform/dolphin-platform-remoting-client-javafx/src/main/java/com/canoo/platform/remoting/client/javafx/DolphinPlatformApplication.java | DolphinPlatformApplication.init | @Override
public final void init() throws Exception {
FxToolkit.init();
applicationInit();
PlatformClient.getClientConfiguration().setUncaughtExceptionHandler((Thread thread, Throwable exception) -> {
PlatformClient.getClientConfiguration().getUiExecutor().execute(() -> {
... | java | @Override
public final void init() throws Exception {
FxToolkit.init();
applicationInit();
PlatformClient.getClientConfiguration().setUncaughtExceptionHandler((Thread thread, Throwable exception) -> {
PlatformClient.getClientConfiguration().getUiExecutor().execute(() -> {
... | [
"@",
"Override",
"public",
"final",
"void",
"init",
"(",
")",
"throws",
"Exception",
"{",
"FxToolkit",
".",
"init",
"(",
")",
";",
"applicationInit",
"(",
")",
";",
"PlatformClient",
".",
"getClientConfiguration",
"(",
")",
".",
"setUncaughtExceptionHandler",
... | Creates the connection to the Dolphin Platform server. If this method will be overridden always call the super method.
@throws Exception a exception if the connection can't be created | [
"Creates",
"the",
"connection",
"to",
"the",
"Dolphin",
"Platform",
"server",
".",
"If",
"this",
"method",
"will",
"be",
"overridden",
"always",
"call",
"the",
"super",
"method",
"."
] | fb99c1fab24df80d2fa094d8688b546140146874 | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-remoting-client-javafx/src/main/java/com/canoo/platform/remoting/client/javafx/DolphinPlatformApplication.java#L100-L132 | train |
canoo/dolphin-platform | platform/dolphin-platform-remoting-client-javafx/src/main/java/com/canoo/platform/remoting/client/javafx/DolphinPlatformApplication.java | DolphinPlatformApplication.onRuntimeError | protected void onRuntimeError(final Stage primaryStage, final DolphinRuntimeException runtimeException) {
Assert.requireNonNull(runtimeException, "runtimeException");
LOG.error("Dolphin Platform runtime error in thread " + runtimeException.getThread().getName(), runtimeException);
Platform.exit(... | java | protected void onRuntimeError(final Stage primaryStage, final DolphinRuntimeException runtimeException) {
Assert.requireNonNull(runtimeException, "runtimeException");
LOG.error("Dolphin Platform runtime error in thread " + runtimeException.getThread().getName(), runtimeException);
Platform.exit(... | [
"protected",
"void",
"onRuntimeError",
"(",
"final",
"Stage",
"primaryStage",
",",
"final",
"DolphinRuntimeException",
"runtimeException",
")",
"{",
"Assert",
".",
"requireNonNull",
"(",
"runtimeException",
",",
"\"runtimeException\"",
")",
";",
"LOG",
".",
"error",
... | This method is called if the connection to the Dolphin Platform server throws an exception at runtime. This can
for example happen if the server is shut down while the client is still running or if the server responses with
an error code.
@param primaryStage the primary stage
@param runtimeException the exception | [
"This",
"method",
"is",
"called",
"if",
"the",
"connection",
"to",
"the",
"Dolphin",
"Platform",
"server",
"throws",
"an",
"exception",
"at",
"runtime",
".",
"This",
"can",
"for",
"example",
"happen",
"if",
"the",
"server",
"is",
"shut",
"down",
"while",
"... | fb99c1fab24df80d2fa094d8688b546140146874 | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-remoting-client-javafx/src/main/java/com/canoo/platform/remoting/client/javafx/DolphinPlatformApplication.java#L255-L259 | train |
canoo/dolphin-platform | platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/gc/Instance.java | Instance.isReferencedByRoot | public boolean isReferencedByRoot() {
if(rootBean) {
return true;
}
for(Reference reference : references) {
Instance parent = reference.getParent();
if(parent.isReferencedByRoot()) {
return true;
}
}
return false;
... | java | public boolean isReferencedByRoot() {
if(rootBean) {
return true;
}
for(Reference reference : references) {
Instance parent = reference.getParent();
if(parent.isReferencedByRoot()) {
return true;
}
}
return false;
... | [
"public",
"boolean",
"isReferencedByRoot",
"(",
")",
"{",
"if",
"(",
"rootBean",
")",
"{",
"return",
"true",
";",
"}",
"for",
"(",
"Reference",
"reference",
":",
"references",
")",
"{",
"Instance",
"parent",
"=",
"reference",
".",
"getParent",
"(",
")",
... | Return true if the dolphin bean instance is a root bean or is referenced by a root bean
@return true if the dolphin bean instance is a root bean or is referenced by a root bean | [
"Return",
"true",
"if",
"the",
"dolphin",
"bean",
"instance",
"is",
"a",
"root",
"bean",
"or",
"is",
"referenced",
"by",
"a",
"root",
"bean"
] | fb99c1fab24df80d2fa094d8688b546140146874 | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/gc/Instance.java#L105-L116 | train |
lestard/advanced-bindings | src/main/java/eu/lestard/advanced_bindings/api/SwitchBindings.java | SwitchBindings.switchBinding | public static <T, R> SwitchBuilder<T, R> switchBinding(ObservableValue<T> observable, Class<R> bindingType) {
return new SwitchBuilder<>(observable);
} | java | public static <T, R> SwitchBuilder<T, R> switchBinding(ObservableValue<T> observable, Class<R> bindingType) {
return new SwitchBuilder<>(observable);
} | [
"public",
"static",
"<",
"T",
",",
"R",
">",
"SwitchBuilder",
"<",
"T",
",",
"R",
">",
"switchBinding",
"(",
"ObservableValue",
"<",
"T",
">",
"observable",
",",
"Class",
"<",
"R",
">",
"bindingType",
")",
"{",
"return",
"new",
"SwitchBuilder",
"<>",
"... | Creates builder for a binding that works like a switch-case in java.
Example:
```java
IntegerProperty base = new SimpleIntegerProperty();
ObservableValue<String> result = switchBinding(base, String.class)
.bindCase(3, i -> "three")
.bindCase(10, i -> "ten")
.bindCase(1, i -> "one")
.bindDefault(() -> "nothing")
.bui... | [
"Creates",
"builder",
"for",
"a",
"binding",
"that",
"works",
"like",
"a",
"switch",
"-",
"case",
"in",
"java",
"."
] | 054a5dde261c29f862b971765fa3da3704a13ab4 | https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/SwitchBindings.java#L154-L156 | train |
canoo/dolphin-platform | platform/dolphin-platform-remoting-client-javafx/src/main/java/com/canoo/platform/remoting/client/javafx/view/AbstractViewController.java | AbstractViewController.destroy | public CompletableFuture<Void> destroy() {
CompletableFuture<Void> ret;
if (controllerProxy != null) {
ret = controllerProxy.destroy();
controllerProxy = null;
} else {
ret = new CompletableFuture<>();
ret.complete(null);
}
return r... | java | public CompletableFuture<Void> destroy() {
CompletableFuture<Void> ret;
if (controllerProxy != null) {
ret = controllerProxy.destroy();
controllerProxy = null;
} else {
ret = new CompletableFuture<>();
ret.complete(null);
}
return r... | [
"public",
"CompletableFuture",
"<",
"Void",
">",
"destroy",
"(",
")",
"{",
"CompletableFuture",
"<",
"Void",
">",
"ret",
";",
"if",
"(",
"controllerProxy",
"!=",
"null",
")",
"{",
"ret",
"=",
"controllerProxy",
".",
"destroy",
"(",
")",
";",
"controllerPro... | By calling this method the MVC group will be destroyed. This means that the controller instance on the server will
be removed and the model that is managed and synchronized between client and server will be detached. After this method
is called the view should not be used anymore. It's important to call this method to ... | [
"By",
"calling",
"this",
"method",
"the",
"MVC",
"group",
"will",
"be",
"destroyed",
".",
"This",
"means",
"that",
"the",
"controller",
"instance",
"on",
"the",
"server",
"will",
"be",
"removed",
"and",
"the",
"model",
"that",
"is",
"managed",
"and",
"sync... | fb99c1fab24df80d2fa094d8688b546140146874 | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-remoting-client-javafx/src/main/java/com/canoo/platform/remoting/client/javafx/view/AbstractViewController.java#L92-L102 | train |
canoo/dolphin-platform | platform/dolphin-platform-remoting-client-javafx/src/main/java/com/canoo/platform/remoting/client/javafx/view/AbstractViewController.java | AbstractViewController.invoke | protected CompletableFuture<Void> invoke(String actionName, Param... params) {
Assert.requireNonBlank(actionName, "actionName");
actionInProcess.set(true);
return controllerProxy.invoke(actionName, params).whenComplete((v, e) -> {
try {
if (e != null) {
... | java | protected CompletableFuture<Void> invoke(String actionName, Param... params) {
Assert.requireNonBlank(actionName, "actionName");
actionInProcess.set(true);
return controllerProxy.invoke(actionName, params).whenComplete((v, e) -> {
try {
if (e != null) {
... | [
"protected",
"CompletableFuture",
"<",
"Void",
">",
"invoke",
"(",
"String",
"actionName",
",",
"Param",
"...",
"params",
")",
"{",
"Assert",
".",
"requireNonBlank",
"(",
"actionName",
",",
"\"actionName\"",
")",
";",
"actionInProcess",
".",
"set",
"(",
"true"... | This invokes a action on the server side controller. For more information how an action can be defined in the
controller have a look at the RemotingAction annotation in the server module.
This method don't block and can be called from the Platform thread. To check if an server
@param actionName name of the action
@par... | [
"This",
"invokes",
"a",
"action",
"on",
"the",
"server",
"side",
"controller",
".",
"For",
"more",
"information",
"how",
"an",
"action",
"can",
"be",
"defined",
"in",
"the",
"controller",
"have",
"a",
"look",
"at",
"the",
"RemotingAction",
"annotation",
"in"... | fb99c1fab24df80d2fa094d8688b546140146874 | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-remoting-client-javafx/src/main/java/com/canoo/platform/remoting/client/javafx/view/AbstractViewController.java#L113-L125 | train |
canoo/dolphin-platform | platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/legacy/ServerAttribute.java | ServerAttribute.silently | public void silently(final Runnable applyChange) {
boolean temp = notifyClient;
notifyClient = false;
try {
applyChange.run();
} finally {
notifyClient = temp;
}
} | java | public void silently(final Runnable applyChange) {
boolean temp = notifyClient;
notifyClient = false;
try {
applyChange.run();
} finally {
notifyClient = temp;
}
} | [
"public",
"void",
"silently",
"(",
"final",
"Runnable",
"applyChange",
")",
"{",
"boolean",
"temp",
"=",
"notifyClient",
";",
"notifyClient",
"=",
"false",
";",
"try",
"{",
"applyChange",
".",
"run",
"(",
")",
";",
"}",
"finally",
"{",
"notifyClient",
"=",... | Do the applyChange without creating commands that are sent to the client | [
"Do",
"the",
"applyChange",
"without",
"creating",
"commands",
"that",
"are",
"sent",
"to",
"the",
"client"
] | fb99c1fab24df80d2fa094d8688b546140146874 | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/legacy/ServerAttribute.java#L95-L103 | train |
canoo/dolphin-platform | platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/legacy/ServerAttribute.java | ServerAttribute.verbosely | protected void verbosely(final Runnable applyChange) {
boolean temp = notifyClient;
notifyClient = true;
try {
applyChange.run();
} finally {
notifyClient = temp;
}
} | java | protected void verbosely(final Runnable applyChange) {
boolean temp = notifyClient;
notifyClient = true;
try {
applyChange.run();
} finally {
notifyClient = temp;
}
} | [
"protected",
"void",
"verbosely",
"(",
"final",
"Runnable",
"applyChange",
")",
"{",
"boolean",
"temp",
"=",
"notifyClient",
";",
"notifyClient",
"=",
"true",
";",
"try",
"{",
"applyChange",
".",
"run",
"(",
")",
";",
"}",
"finally",
"{",
"notifyClient",
"... | Do the applyChange with enforced creation of commands that are sent to the client | [
"Do",
"the",
"applyChange",
"with",
"enforced",
"creation",
"of",
"commands",
"that",
"are",
"sent",
"to",
"the",
"client"
] | fb99c1fab24df80d2fa094d8688b546140146874 | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/legacy/ServerAttribute.java#L108-L116 | train |
lestard/advanced-bindings | src/main/java/eu/lestard/advanced_bindings/api/LogicBindings.java | LogicBindings.and | @SafeVarargs
public static BooleanBinding and(ObservableValue<Boolean>...values) {
return Bindings.createBooleanBinding(
()-> !Arrays.stream(values)
.filter(observable -> !observable.getValue())
.findAny()
.isPresent(), values);
} | java | @SafeVarargs
public static BooleanBinding and(ObservableValue<Boolean>...values) {
return Bindings.createBooleanBinding(
()-> !Arrays.stream(values)
.filter(observable -> !observable.getValue())
.findAny()
.isPresent(), values);
} | [
"@",
"SafeVarargs",
"public",
"static",
"BooleanBinding",
"and",
"(",
"ObservableValue",
"<",
"Boolean",
">",
"...",
"values",
")",
"{",
"return",
"Bindings",
".",
"createBooleanBinding",
"(",
"(",
")",
"->",
"!",
"Arrays",
".",
"stream",
"(",
"values",
")",... | A boolean binding that is `true` only when all dependent observable boolean values
are `true`.
This can be useful in cases where the
{@link Bindings#and(javafx.beans.value.ObservableBooleanValue, javafx.beans.value.ObservableBooleanValue)}
with 2 arguments isn't enough.
@param values variable number of observable boo... | [
"A",
"boolean",
"binding",
"that",
"is",
"true",
"only",
"when",
"all",
"dependent",
"observable",
"boolean",
"values",
"are",
"true",
"."
] | 054a5dde261c29f862b971765fa3da3704a13ab4 | https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/LogicBindings.java#L44-L51 | train |
lestard/advanced-bindings | src/main/java/eu/lestard/advanced_bindings/api/CollectionBindings.java | CollectionBindings.sum | public static NumberBinding sum(final ObservableList<? extends Number> numbers) {
return Bindings.createDoubleBinding(() -> numbers.stream().mapToDouble(Number::doubleValue).sum(), numbers);
} | java | public static NumberBinding sum(final ObservableList<? extends Number> numbers) {
return Bindings.createDoubleBinding(() -> numbers.stream().mapToDouble(Number::doubleValue).sum(), numbers);
} | [
"public",
"static",
"NumberBinding",
"sum",
"(",
"final",
"ObservableList",
"<",
"?",
"extends",
"Number",
">",
"numbers",
")",
"{",
"return",
"Bindings",
".",
"createDoubleBinding",
"(",
"(",
")",
"->",
"numbers",
".",
"stream",
"(",
")",
".",
"mapToDouble"... | Creates a number binding that contains the sum of the numbers of the given observable list of numbers.
@param numbers the observable list of numbers.
@return a number binding. | [
"Creates",
"a",
"number",
"binding",
"that",
"contains",
"the",
"sum",
"of",
"the",
"numbers",
"of",
"the",
"given",
"observable",
"list",
"of",
"numbers",
"."
] | 054a5dde261c29f862b971765fa3da3704a13ab4 | https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/CollectionBindings.java#L124-L126 | train |
lestard/advanced-bindings | src/main/java/eu/lestard/advanced_bindings/api/CollectionBindings.java | CollectionBindings.join | public static StringBinding join(final ObservableList<?> items, final ObservableValue<String> delimiter) {
return Bindings.createStringBinding(() -> items.stream().map(String::valueOf).collect(Collectors.joining(delimiter.getValue())), items, delimiter);
} | java | public static StringBinding join(final ObservableList<?> items, final ObservableValue<String> delimiter) {
return Bindings.createStringBinding(() -> items.stream().map(String::valueOf).collect(Collectors.joining(delimiter.getValue())), items, delimiter);
} | [
"public",
"static",
"StringBinding",
"join",
"(",
"final",
"ObservableList",
"<",
"?",
">",
"items",
",",
"final",
"ObservableValue",
"<",
"String",
">",
"delimiter",
")",
"{",
"return",
"Bindings",
".",
"createStringBinding",
"(",
"(",
")",
"->",
"items",
"... | Creates a string binding that constructs a sequence of characters separated by a delimiter.
@param items the observable list of items.
@param delimiter the sequence of characters to be used between each element.
@return a string binding. | [
"Creates",
"a",
"string",
"binding",
"that",
"constructs",
"a",
"sequence",
"of",
"characters",
"separated",
"by",
"a",
"delimiter",
"."
] | 054a5dde261c29f862b971765fa3da3704a13ab4 | https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/CollectionBindings.java#L136-L138 | train |
lestard/advanced-bindings | src/main/java/eu/lestard/advanced_bindings/api/CollectionBindings.java | CollectionBindings.concat | @SafeVarargs
public static <T> ObservableList<T> concat(ObservableList<T>... lists) {
ObservableList<T> result = FXCollections.observableArrayList();
// todo: think about a smarter solution
for (ObservableList<T> list : lists) {
list.addListener((Observable observable) -> {
... | java | @SafeVarargs
public static <T> ObservableList<T> concat(ObservableList<T>... lists) {
ObservableList<T> result = FXCollections.observableArrayList();
// todo: think about a smarter solution
for (ObservableList<T> list : lists) {
list.addListener((Observable observable) -> {
... | [
"@",
"SafeVarargs",
"public",
"static",
"<",
"T",
">",
"ObservableList",
"<",
"T",
">",
"concat",
"(",
"ObservableList",
"<",
"T",
">",
"...",
"lists",
")",
"{",
"ObservableList",
"<",
"T",
">",
"result",
"=",
"FXCollections",
".",
"observableArrayList",
"... | Creates an observable list that represents the concatenated source lists. All elements from the all source lists
will be contained in the new list. If there is a change in any of the source lists this change will also be done
in the concatenated list.
The order of elements will be maintained. All elements of the first... | [
"Creates",
"an",
"observable",
"list",
"that",
"represents",
"the",
"concatenated",
"source",
"lists",
".",
"All",
"elements",
"from",
"the",
"all",
"source",
"lists",
"will",
"be",
"contained",
"in",
"the",
"new",
"list",
".",
"If",
"there",
"is",
"a",
"c... | 054a5dde261c29f862b971765fa3da3704a13ab4 | https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/CollectionBindings.java#L216-L232 | train |
lestard/advanced-bindings | src/main/java/eu/lestard/advanced_bindings/api/StringBindings.java | StringBindings.matches | public static BooleanBinding matches(final ObservableValue<String> text, final String pattern) {
return Bindings.createBooleanBinding(() -> {
final String textToVerify = text.getValue();
return textToVerify != null && textToVerify.matches(pattern);
}, text);
} | java | public static BooleanBinding matches(final ObservableValue<String> text, final String pattern) {
return Bindings.createBooleanBinding(() -> {
final String textToVerify = text.getValue();
return textToVerify != null && textToVerify.matches(pattern);
}, text);
} | [
"public",
"static",
"BooleanBinding",
"matches",
"(",
"final",
"ObservableValue",
"<",
"String",
">",
"text",
",",
"final",
"String",
"pattern",
")",
"{",
"return",
"Bindings",
".",
"createBooleanBinding",
"(",
"(",
")",
"->",
"{",
"final",
"String",
"textToVe... | Creates a boolean binding that is `true` when the given observable string matches the given RegExp pattern.
@param text
the observable string that is verified.
@param pattern
the RegExp pattern that is used.
@return a boolean binding instance. | [
"Creates",
"a",
"boolean",
"binding",
"that",
"is",
"true",
"when",
"the",
"given",
"observable",
"string",
"matches",
"the",
"given",
"RegExp",
"pattern",
"."
] | 054a5dde261c29f862b971765fa3da3704a13ab4 | https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/StringBindings.java#L50-L55 | train |
lestard/advanced-bindings | src/main/java/eu/lestard/advanced_bindings/api/StringBindings.java | StringBindings.transforming | public static StringBinding transforming(ObservableValue<String> text, Function<String, String> transformer) {
return Bindings.createStringBinding(()
-> {
Function<String, String> func = transformer == null ? Function.identity() : transformer;
return text.getValue() == null ? "" : func.apply(text.getValue())... | java | public static StringBinding transforming(ObservableValue<String> text, Function<String, String> transformer) {
return Bindings.createStringBinding(()
-> {
Function<String, String> func = transformer == null ? Function.identity() : transformer;
return text.getValue() == null ? "" : func.apply(text.getValue())... | [
"public",
"static",
"StringBinding",
"transforming",
"(",
"ObservableValue",
"<",
"String",
">",
"text",
",",
"Function",
"<",
"String",
",",
"String",
">",
"transformer",
")",
"{",
"return",
"Bindings",
".",
"createStringBinding",
"(",
"(",
")",
"->",
"{",
... | Creates a string binding that contains the value of the given observable string transformed using the supplied
function.
If the given observable string has a value of `null` the created binding will contain an empty string.
If the given function has a value of `null` {@link Function#identity()} will be used instead.
... | [
"Creates",
"a",
"string",
"binding",
"that",
"contains",
"the",
"value",
"of",
"the",
"given",
"observable",
"string",
"transformed",
"using",
"the",
"supplied",
"function",
"."
] | 054a5dde261c29f862b971765fa3da3704a13ab4 | https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/StringBindings.java#L220-L226 | train |
canoo/dolphin-platform | platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/legacy/ServerModelStore.java | ServerModelStore.remove | public boolean remove(final ServerPresentationModel pm) {
boolean deleted = super.remove(pm);
if (!deleted) {
throw new IllegalStateException("Model " + pm + " not found on the server!");
}
deleteCommand(getCurrentResponse(), pm.getId());
return deleted;
} | java | public boolean remove(final ServerPresentationModel pm) {
boolean deleted = super.remove(pm);
if (!deleted) {
throw new IllegalStateException("Model " + pm + " not found on the server!");
}
deleteCommand(getCurrentResponse(), pm.getId());
return deleted;
} | [
"public",
"boolean",
"remove",
"(",
"final",
"ServerPresentationModel",
"pm",
")",
"{",
"boolean",
"deleted",
"=",
"super",
".",
"remove",
"(",
"pm",
")",
";",
"if",
"(",
"!",
"deleted",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Model \"",
... | Convenience method to let Dolphin removePresentationModel a presentation model directly on the server and notify the client. | [
"Convenience",
"method",
"to",
"let",
"Dolphin",
"removePresentationModel",
"a",
"presentation",
"model",
"directly",
"on",
"the",
"server",
"and",
"notify",
"the",
"client",
"."
] | fb99c1fab24df80d2fa094d8688b546140146874 | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/legacy/ServerModelStore.java#L122-L129 | train |
canoo/dolphin-platform | platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/legacy/ServerModelStore.java | ServerModelStore.deleteCommand | @Deprecated
public static void deleteCommand(final List<Command> response, final String pmId) {
if (response == null || Assert.isBlank(pmId)) {
return;
}
response.add(new DeletePresentationModelCommand(pmId));
} | java | @Deprecated
public static void deleteCommand(final List<Command> response, final String pmId) {
if (response == null || Assert.isBlank(pmId)) {
return;
}
response.add(new DeletePresentationModelCommand(pmId));
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"deleteCommand",
"(",
"final",
"List",
"<",
"Command",
">",
"response",
",",
"final",
"String",
"pmId",
")",
"{",
"if",
"(",
"response",
"==",
"null",
"||",
"Assert",
".",
"isBlank",
"(",
"pmId",
")",
")",
... | Convenience method to let Dolphin delete a presentation model on the client side | [
"Convenience",
"method",
"to",
"let",
"Dolphin",
"delete",
"a",
"presentation",
"model",
"on",
"the",
"client",
"side"
] | fb99c1fab24df80d2fa094d8688b546140146874 | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/legacy/ServerModelStore.java#L144-L150 | train |
canoo/dolphin-platform | platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/legacy/ServerModelStore.java | ServerModelStore.changeValueCommand | @Deprecated
public static void changeValueCommand(final List<Command> response, final ServerAttribute attribute, final Object value) {
if (response == null) {
return;
}
if (attribute == null) {
LOG.error("Cannot change value on a null attribute to '{}'", value);
... | java | @Deprecated
public static void changeValueCommand(final List<Command> response, final ServerAttribute attribute, final Object value) {
if (response == null) {
return;
}
if (attribute == null) {
LOG.error("Cannot change value on a null attribute to '{}'", value);
... | [
"@",
"Deprecated",
"public",
"static",
"void",
"changeValueCommand",
"(",
"final",
"List",
"<",
"Command",
">",
"response",
",",
"final",
"ServerAttribute",
"attribute",
",",
"final",
"Object",
"value",
")",
"{",
"if",
"(",
"response",
"==",
"null",
")",
"{"... | Convenience method to change an attribute value on the server side.
@param response must not be null or the method silently ignores the call
@param attribute must not be null | [
"Convenience",
"method",
"to",
"change",
"an",
"attribute",
"value",
"on",
"the",
"server",
"side",
"."
] | fb99c1fab24df80d2fa094d8688b546140146874 | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/legacy/ServerModelStore.java#L158-L168 | train |
canoo/dolphin-platform | platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/legacy/ServerModelStore.java | ServerModelStore.presentationModel | public ServerPresentationModel presentationModel(final String id, final String presentationModelType, final DTO dto) {
List<ServerAttribute> attributes = new ArrayList<ServerAttribute>();
for (final Slot slot : dto.getSlots()) {
final ServerAttribute result = new ServerAttribute(slot.getProp... | java | public ServerPresentationModel presentationModel(final String id, final String presentationModelType, final DTO dto) {
List<ServerAttribute> attributes = new ArrayList<ServerAttribute>();
for (final Slot slot : dto.getSlots()) {
final ServerAttribute result = new ServerAttribute(slot.getProp... | [
"public",
"ServerPresentationModel",
"presentationModel",
"(",
"final",
"String",
"id",
",",
"final",
"String",
"presentationModelType",
",",
"final",
"DTO",
"dto",
")",
"{",
"List",
"<",
"ServerAttribute",
">",
"attributes",
"=",
"new",
"ArrayList",
"<",
"ServerA... | Create a presentation model on the server side, add it to the model store, and withContent a command to
the client, advising him to do the same.
@throws IllegalArgumentException if a presentation model for this id already exists. No commands are sent in this case. | [
"Create",
"a",
"presentation",
"model",
"on",
"the",
"server",
"side",
"add",
"it",
"to",
"the",
"model",
"store",
"and",
"withContent",
"a",
"command",
"to",
"the",
"client",
"advising",
"him",
"to",
"do",
"the",
"same",
"."
] | fb99c1fab24df80d2fa094d8688b546140146874 | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/legacy/ServerModelStore.java#L205-L222 | train |
canoo/dolphin-platform | platform/dolphin-platform-server/src/main/java/com/canoo/dp/impl/server/mbean/MBeanRegistry.java | MBeanRegistry.register | public Subscription register(final Object mBean, final MBeanDescription description) {
Assert.requireNonNull(description, "description");
return register(mBean, description.getMBeanName(getNextId()));
} | java | public Subscription register(final Object mBean, final MBeanDescription description) {
Assert.requireNonNull(description, "description");
return register(mBean, description.getMBeanName(getNextId()));
} | [
"public",
"Subscription",
"register",
"(",
"final",
"Object",
"mBean",
",",
"final",
"MBeanDescription",
"description",
")",
"{",
"Assert",
".",
"requireNonNull",
"(",
"description",
",",
"\"description\"",
")",
";",
"return",
"register",
"(",
"mBean",
",",
"des... | Register the given MBean based on the given description
@param mBean the bean
@param description the description
@return the subscription that can be used to unregister the bean | [
"Register",
"the",
"given",
"MBean",
"based",
"on",
"the",
"given",
"description"
] | fb99c1fab24df80d2fa094d8688b546140146874 | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-server/src/main/java/com/canoo/dp/impl/server/mbean/MBeanRegistry.java#L55-L58 | train |
canoo/dolphin-platform | platform/dolphin-platform-server/src/main/java/com/canoo/dp/impl/server/mbean/MBeanRegistry.java | MBeanRegistry.register | public Subscription register(final Object mBean, final String name){
try {
if (mbeanSupport.get()) {
final ObjectName objectName = new ObjectName(name);
server.registerMBean(mBean, objectName);
return new Subscription() {
@Override
... | java | public Subscription register(final Object mBean, final String name){
try {
if (mbeanSupport.get()) {
final ObjectName objectName = new ObjectName(name);
server.registerMBean(mBean, objectName);
return new Subscription() {
@Override
... | [
"public",
"Subscription",
"register",
"(",
"final",
"Object",
"mBean",
",",
"final",
"String",
"name",
")",
"{",
"try",
"{",
"if",
"(",
"mbeanSupport",
".",
"get",
"(",
")",
")",
"{",
"final",
"ObjectName",
"objectName",
"=",
"new",
"ObjectName",
"(",
"n... | Register the given MBean based on the given name
@param mBean the bean
@param name the name
@return the subscription that can be used to unregister the bean | [
"Register",
"the",
"given",
"MBean",
"based",
"on",
"the",
"given",
"name"
] | fb99c1fab24df80d2fa094d8688b546140146874 | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-server/src/main/java/com/canoo/dp/impl/server/mbean/MBeanRegistry.java#L66-L91 | train |
canoo/dolphin-platform | platform/dolphin-platform-remoting-client/src/main/java/com/canoo/dp/impl/client/legacy/ClientDolphin.java | ClientDolphin.sync | @Deprecated
public void sync(final Runnable runnable) {
clientConnector.send(new EmptyCommand(), new OnFinishedHandler() {
public void onFinished() {
runnable.run();
}
});
} | java | @Deprecated
public void sync(final Runnable runnable) {
clientConnector.send(new EmptyCommand(), new OnFinishedHandler() {
public void onFinished() {
runnable.run();
}
});
} | [
"@",
"Deprecated",
"public",
"void",
"sync",
"(",
"final",
"Runnable",
"runnable",
")",
"{",
"clientConnector",
".",
"send",
"(",
"new",
"EmptyCommand",
"(",
")",
",",
"new",
"OnFinishedHandler",
"(",
")",
"{",
"public",
"void",
"onFinished",
"(",
")",
"{"... | both java- and groovy-friendly convenience method to withContent an empty command, which will have no
presentation models nor data in the callback | [
"both",
"java",
"-",
"and",
"groovy",
"-",
"friendly",
"convenience",
"method",
"to",
"withContent",
"an",
"empty",
"command",
"which",
"will",
"have",
"no",
"presentation",
"models",
"nor",
"data",
"in",
"the",
"callback"
] | fb99c1fab24df80d2fa094d8688b546140146874 | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-remoting-client/src/main/java/com/canoo/dp/impl/client/legacy/ClientDolphin.java#L53-L61 | train |
canoo/dolphin-platform | platform/dolphin-platform-server/src/main/java/com/canoo/dp/impl/server/scanner/DefaultClasspathScanner.java | DefaultClasspathScanner.getTypesAnnotatedWith | public synchronized Set<Class<?>> getTypesAnnotatedWith(final Class<? extends Annotation> annotation) {
Assert.requireNonNull(annotation, "annotation");
return reflections.getTypesAnnotatedWith(annotation);
} | java | public synchronized Set<Class<?>> getTypesAnnotatedWith(final Class<? extends Annotation> annotation) {
Assert.requireNonNull(annotation, "annotation");
return reflections.getTypesAnnotatedWith(annotation);
} | [
"public",
"synchronized",
"Set",
"<",
"Class",
"<",
"?",
">",
">",
"getTypesAnnotatedWith",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotation",
")",
"{",
"Assert",
".",
"requireNonNull",
"(",
"annotation",
",",
"\"annotation\"",
")",
... | Returns a set that contains all classes in the classpath that are annotated with the given annotation
@param annotation the annotation
@return the set of annotated classes | [
"Returns",
"a",
"set",
"that",
"contains",
"all",
"classes",
"in",
"the",
"classpath",
"that",
"are",
"annotated",
"with",
"the",
"given",
"annotation"
] | fb99c1fab24df80d2fa094d8688b546140146874 | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-server/src/main/java/com/canoo/dp/impl/server/scanner/DefaultClasspathScanner.java#L100-L103 | train |
canoo/dolphin-platform | platform-extras/dolphin-platform-bean-validation/src/main/java/com/canoo/dp/impl/validation/PatternPropertyValidator.java | PatternPropertyValidator.combineFlags | private int combineFlags(final Pattern.Flag[] flags) {
int combined = 0;
for (Pattern.Flag f : flags) {
combined |= f.getValue();
}
return combined;
} | java | private int combineFlags(final Pattern.Flag[] flags) {
int combined = 0;
for (Pattern.Flag f : flags) {
combined |= f.getValue();
}
return combined;
} | [
"private",
"int",
"combineFlags",
"(",
"final",
"Pattern",
".",
"Flag",
"[",
"]",
"flags",
")",
"{",
"int",
"combined",
"=",
"0",
";",
"for",
"(",
"Pattern",
".",
"Flag",
"f",
":",
"flags",
")",
"{",
"combined",
"|=",
"f",
".",
"getValue",
"(",
")"... | Combines a given set of javax.validation.constraints.Pattern.Flag instances into one bitmask suitable for
java.util.regex.Pattern consumption.
@param flags - list of javax.validation.constraints.Pattern.Flag instances to combine
@return combined bitmask for regex flags | [
"Combines",
"a",
"given",
"set",
"of",
"javax",
".",
"validation",
".",
"constraints",
".",
"Pattern",
".",
"Flag",
"instances",
"into",
"one",
"bitmask",
"suitable",
"for",
"java",
".",
"util",
".",
"regex",
".",
"Pattern",
"consumption",
"."
] | fb99c1fab24df80d2fa094d8688b546140146874 | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform-extras/dolphin-platform-bean-validation/src/main/java/com/canoo/dp/impl/validation/PatternPropertyValidator.java#L57-L63 | train |
lestard/advanced-bindings | src/main/java/eu/lestard/advanced_bindings/api/ObjectBindings.java | ObjectBindings.map | public static <S, R> ObjectBinding<R> map(ObservableValue<S> source, Function<? super S, ? extends R> function) {
return map(source, function, null);
} | java | public static <S, R> ObjectBinding<R> map(ObservableValue<S> source, Function<? super S, ? extends R> function) {
return map(source, function, null);
} | [
"public",
"static",
"<",
"S",
",",
"R",
">",
"ObjectBinding",
"<",
"R",
">",
"map",
"(",
"ObservableValue",
"<",
"S",
">",
"source",
",",
"Function",
"<",
"?",
"super",
"S",
",",
"?",
"extends",
"R",
">",
"function",
")",
"{",
"return",
"map",
"(",... | A Binding that holds a value that is determined by the given function applied to the value of the observable
source.
This binding is null safe: When the given observable has a value of `null` the created binding
will also contain `null` but will **not** throw a {@link java.lang.NullPointerException}.
(Hint: if you l... | [
"A",
"Binding",
"that",
"holds",
"a",
"value",
"that",
"is",
"determined",
"by",
"the",
"given",
"function",
"applied",
"to",
"the",
"value",
"of",
"the",
"observable",
"source",
"."
] | 054a5dde261c29f862b971765fa3da3704a13ab4 | https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/ObjectBindings.java#L86-L88 | train |
lestard/advanced-bindings | src/main/java/eu/lestard/advanced_bindings/api/ObjectBindings.java | ObjectBindings.map | public static <S, R> ObjectBinding<R> map(ObservableValue<S> source, Function<? super S, ? extends R> function, R defaultValue){
return Bindings.createObjectBinding(()->{
S sourceValue = source.getValue();
if(sourceValue == null){
return defaultValue;
}else{
... | java | public static <S, R> ObjectBinding<R> map(ObservableValue<S> source, Function<? super S, ? extends R> function, R defaultValue){
return Bindings.createObjectBinding(()->{
S sourceValue = source.getValue();
if(sourceValue == null){
return defaultValue;
}else{
... | [
"public",
"static",
"<",
"S",
",",
"R",
">",
"ObjectBinding",
"<",
"R",
">",
"map",
"(",
"ObservableValue",
"<",
"S",
">",
"source",
",",
"Function",
"<",
"?",
"super",
"S",
",",
"?",
"extends",
"R",
">",
"function",
",",
"R",
"defaultValue",
")",
... | A null safe binding that holds the return value of the given function when applied to the value of the given observable.
If the observable has a value of `null` the given default value (third param) will be used as value for the binding instead.
The given function will never get `null` as param so you don't need to c... | [
"A",
"null",
"safe",
"binding",
"that",
"holds",
"the",
"return",
"value",
"of",
"the",
"given",
"function",
"when",
"applied",
"to",
"the",
"value",
"of",
"the",
"given",
"observable",
"."
] | 054a5dde261c29f862b971765fa3da3704a13ab4 | https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/ObjectBindings.java#L107-L117 | train |
lestard/advanced-bindings | src/main/java/eu/lestard/advanced_bindings/api/ObjectBindings.java | ObjectBindings.cast | public static <T, S extends T> ObjectBinding<T> cast(final ObservableValue<S> source) {
return Bindings.createObjectBinding(source::getValue, source);
} | java | public static <T, S extends T> ObjectBinding<T> cast(final ObservableValue<S> source) {
return Bindings.createObjectBinding(source::getValue, source);
} | [
"public",
"static",
"<",
"T",
",",
"S",
"extends",
"T",
">",
"ObjectBinding",
"<",
"T",
">",
"cast",
"(",
"final",
"ObservableValue",
"<",
"S",
">",
"source",
")",
"{",
"return",
"Bindings",
".",
"createObjectBinding",
"(",
"source",
"::",
"getValue",
",... | Creates a binding that contains the same value as the source observable
but casted to a type that is higher in class hierarchy.
Example:
```java
public class Person {
}
public class Student extends Person {
}
ObjectProperty<Student> student = new SimpleObjectProperty<>();
ObjectBinding<Person> person = ObjectBind... | [
"Creates",
"a",
"binding",
"that",
"contains",
"the",
"same",
"value",
"as",
"the",
"source",
"observable",
"but",
"casted",
"to",
"a",
"type",
"that",
"is",
"higher",
"in",
"class",
"hierarchy",
"."
] | 054a5dde261c29f862b971765fa3da3704a13ab4 | https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/ObjectBindings.java#L170-L172 | train |
astefanutti/camel-cdi | impl/src/main/java/org/apache/camel/cdi/CdiSpiHelper.java | CdiSpiHelper.createAnnotationCollectionId | private static String createAnnotationCollectionId(Collection<Annotation> annotations) {
if (annotations.isEmpty())
return "";
return annotations.stream()
.sorted(comparing(a -> a.annotationType().getName()))
.map(CdiSpiHelper::createAnnotationId)
.collec... | java | private static String createAnnotationCollectionId(Collection<Annotation> annotations) {
if (annotations.isEmpty())
return "";
return annotations.stream()
.sorted(comparing(a -> a.annotationType().getName()))
.map(CdiSpiHelper::createAnnotationId)
.collec... | [
"private",
"static",
"String",
"createAnnotationCollectionId",
"(",
"Collection",
"<",
"Annotation",
">",
"annotations",
")",
"{",
"if",
"(",
"annotations",
".",
"isEmpty",
"(",
")",
")",
"return",
"\"\"",
";",
"return",
"annotations",
".",
"stream",
"(",
")",... | Generates a unique signature for a collection of annotations. | [
"Generates",
"a",
"unique",
"signature",
"for",
"a",
"collection",
"of",
"annotations",
"."
] | 686c7f5fe3a706f47378e0c49c323040795ddff8 | https://github.com/astefanutti/camel-cdi/blob/686c7f5fe3a706f47378e0c49c323040795ddff8/impl/src/main/java/org/apache/camel/cdi/CdiSpiHelper.java#L132-L140 | train |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/util/OgnlUtil.java | OgnlUtil.getValue | public static Object getValue(Object exp, Object root) {
return getValue(exp, root, null, 0);
} | java | public static Object getValue(Object exp, Object root) {
return getValue(exp, root, null, 0);
} | [
"public",
"static",
"Object",
"getValue",
"(",
"Object",
"exp",
",",
"Object",
"root",
")",
"{",
"return",
"getValue",
"(",
"exp",
",",
"root",
",",
"null",
",",
"0",
")",
";",
"}"
] | Returns the value using the OGNL expression and the root object.
@param exp the OGNL expression
@param root the root object
@return the value
@see #getValue(Object, Map, Object, String, int) | [
"Returns",
"the",
"value",
"using",
"the",
"OGNL",
"expression",
"and",
"the",
"root",
"object",
"."
] | 29a44b7ad267b5a48bc250cd0ef7d74813d46889 | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/util/OgnlUtil.java#L48-L50 | train |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/util/OgnlUtil.java | OgnlUtil.getValue | public static Object getValue(Object exp, Map ctx, Object root) {
return getValue(exp, ctx, root, null, 0);
} | java | public static Object getValue(Object exp, Map ctx, Object root) {
return getValue(exp, ctx, root, null, 0);
} | [
"public",
"static",
"Object",
"getValue",
"(",
"Object",
"exp",
",",
"Map",
"ctx",
",",
"Object",
"root",
")",
"{",
"return",
"getValue",
"(",
"exp",
",",
"ctx",
",",
"root",
",",
"null",
",",
"0",
")",
";",
"}"
] | Returns the value using the OGNL expression, the root object and a context map.
@param exp the OGNL expression
@param ctx the context map
@param root the root object
@return the value
@see #getValue(Object, Map, Object, String, int) | [
"Returns",
"the",
"value",
"using",
"the",
"OGNL",
"expression",
"the",
"root",
"object",
"and",
"a",
"context",
"map",
"."
] | 29a44b7ad267b5a48bc250cd0ef7d74813d46889 | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/util/OgnlUtil.java#L79-L81 | train |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/util/OgnlUtil.java | OgnlUtil.getValue | public static Object getValue(Object exp, Map ctx, Object root, String path, int lineNumber) {
try {
OgnlContext context = new OgnlContext(null, null, new DefaultMemberAccess(true));
return Ognl.getValue(exp, context, root);
} catch (OgnlException ex) {
throw new... | java | public static Object getValue(Object exp, Map ctx, Object root, String path, int lineNumber) {
try {
OgnlContext context = new OgnlContext(null, null, new DefaultMemberAccess(true));
return Ognl.getValue(exp, context, root);
} catch (OgnlException ex) {
throw new... | [
"public",
"static",
"Object",
"getValue",
"(",
"Object",
"exp",
",",
"Map",
"ctx",
",",
"Object",
"root",
",",
"String",
"path",
",",
"int",
"lineNumber",
")",
"{",
"try",
"{",
"OgnlContext",
"context",
"=",
"new",
"OgnlContext",
"(",
"null",
",",
"null"... | Returns the value using the OGNL expression, the root object, a context mpa, a path and a line number.
@param exp the OGNL expression
@param ctx the context map
@param root the root object
@param path the path
@param lineNumber the line number
@return the value
@throws OgnlRuntimeException when a {@link ognl.OgnlExc... | [
"Returns",
"the",
"value",
"using",
"the",
"OGNL",
"expression",
"the",
"root",
"object",
"a",
"context",
"mpa",
"a",
"path",
"and",
"a",
"line",
"number",
"."
] | 29a44b7ad267b5a48bc250cd0ef7d74813d46889 | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/util/OgnlUtil.java#L96-L106 | train |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/util/OgnlUtil.java | OgnlUtil.parseExpression | public static Object parseExpression(String expression, String path, int lineNumber) {
try {
return Ognl.parseExpression(expression);
} catch (Exception ex) {
throw new OgnlRuntimeException(ex, path, lineNumber);
}
} | java | public static Object parseExpression(String expression, String path, int lineNumber) {
try {
return Ognl.parseExpression(expression);
} catch (Exception ex) {
throw new OgnlRuntimeException(ex, path, lineNumber);
}
} | [
"public",
"static",
"Object",
"parseExpression",
"(",
"String",
"expression",
",",
"String",
"path",
",",
"int",
"lineNumber",
")",
"{",
"try",
"{",
"return",
"Ognl",
".",
"parseExpression",
"(",
"expression",
")",
";",
"}",
"catch",
"(",
"Exception",
"ex",
... | Parses an OGNL expression.
@param expression the expression
@param path the path
@param lineNumber the line number
@return a tree representation of the OGNL expression
@throws OgnlRuntimeException when a {@link ognl.OgnlException} occurs | [
"Parses",
"an",
"OGNL",
"expression",
"."
] | 29a44b7ad267b5a48bc250cd0ef7d74813d46889 | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/util/OgnlUtil.java#L132-L138 | train |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/SqlExecutor.java | SqlExecutor.getSingleResult | public <T> T getSingleResult(Class<T> clazz, String sql, Object[] params) {
PreparedStatement stmt = null;
ResultSet rs = null;
try {
stmt = connectionProvider.getConnection().prepareStatement(sql);
setParameters(stmt, params);
if (logger.isDebugEnable... | java | public <T> T getSingleResult(Class<T> clazz, String sql, Object[] params) {
PreparedStatement stmt = null;
ResultSet rs = null;
try {
stmt = connectionProvider.getConnection().prepareStatement(sql);
setParameters(stmt, params);
if (logger.isDebugEnable... | [
"public",
"<",
"T",
">",
"T",
"getSingleResult",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"String",
"sql",
",",
"Object",
"[",
"]",
"params",
")",
"{",
"PreparedStatement",
"stmt",
"=",
"null",
";",
"ResultSet",
"rs",
"=",
"null",
";",
"try",
"{",
... | Returns a single entity from the first row of an SQL.
@param <T> the entity type
@param clazz the class of the entity
@param sql the SQL to execute
@param params the parameters to execute the SQL
@return the entity from the result set.
@throws SQLRuntimeException if a database access error occurs | [
"Returns",
"a",
"single",
"entity",
"from",
"the",
"first",
"row",
"of",
"an",
"SQL",
"."
] | 29a44b7ad267b5a48bc250cd0ef7d74813d46889 | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/SqlExecutor.java#L228-L261 | train |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/SqlExecutor.java | SqlExecutor.executeUpdateSql | public int executeUpdateSql(String sql, PropertyDesc[] propDescs, Object entity){
PreparedStatement stmt = null;
ResultSet rs = null;
try {
Connection conn = connectionProvider.getConnection();
if (logger.isDebugEnabled()) {
printSql(sql);
... | java | public int executeUpdateSql(String sql, PropertyDesc[] propDescs, Object entity){
PreparedStatement stmt = null;
ResultSet rs = null;
try {
Connection conn = connectionProvider.getConnection();
if (logger.isDebugEnabled()) {
printSql(sql);
... | [
"public",
"int",
"executeUpdateSql",
"(",
"String",
"sql",
",",
"PropertyDesc",
"[",
"]",
"propDescs",
",",
"Object",
"entity",
")",
"{",
"PreparedStatement",
"stmt",
"=",
"null",
";",
"ResultSet",
"rs",
"=",
"null",
";",
"try",
"{",
"Connection",
"conn",
... | Executes an update SQL.
@param sql the update SQL to execute
@param propDescs the array of parameters
@param entity the entity object in insertion, otherwise null
@return the number of updated rows
@throws SQLRuntimeException if a database access error occurs | [
"Executes",
"an",
"update",
"SQL",
"."
] | 29a44b7ad267b5a48bc250cd0ef7d74813d46889 | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/SqlExecutor.java#L274-L309 | train |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/SqlExecutor.java | SqlExecutor.executeBatchUpdateSql | public int executeBatchUpdateSql(String sql, List<PropertyDesc[]> propDescsList, Object[] entities) {
PreparedStatement stmt = null;
ResultSet rs = null;
try {
Connection conn = connectionProvider.getConnection();
if (logger.isDebugEnabled()) {
pri... | java | public int executeBatchUpdateSql(String sql, List<PropertyDesc[]> propDescsList, Object[] entities) {
PreparedStatement stmt = null;
ResultSet rs = null;
try {
Connection conn = connectionProvider.getConnection();
if (logger.isDebugEnabled()) {
pri... | [
"public",
"int",
"executeBatchUpdateSql",
"(",
"String",
"sql",
",",
"List",
"<",
"PropertyDesc",
"[",
"]",
">",
"propDescsList",
",",
"Object",
"[",
"]",
"entities",
")",
"{",
"PreparedStatement",
"stmt",
"=",
"null",
";",
"ResultSet",
"rs",
"=",
"null",
... | Executes the update SQL.
@param sql the update SQL to execute
@param propDescsList the list of parameter arrays.
@param entities the entities object in insertion, otherwise null
@return the number of updated rows
@throws SQLRuntimeException if a database access error occurs | [
"Executes",
"the",
"update",
"SQL",
"."
] | 29a44b7ad267b5a48bc250cd0ef7d74813d46889 | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/SqlExecutor.java#L370-L427 | train |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/SqlExecutor.java | SqlExecutor.fillIdentityPrimaryKeys | @SuppressWarnings("unchecked")
protected void fillIdentityPrimaryKeys(Object entity, ResultSet rs) throws SQLException {
BeanDesc beanDesc = beanDescFactory.getBeanDesc(entity.getClass());
int size = beanDesc.getPropertyDescSize();
for(int i=0; i < size; i++){
PropertyDesc... | java | @SuppressWarnings("unchecked")
protected void fillIdentityPrimaryKeys(Object entity, ResultSet rs) throws SQLException {
BeanDesc beanDesc = beanDescFactory.getBeanDesc(entity.getClass());
int size = beanDesc.getPropertyDescSize();
for(int i=0; i < size; i++){
PropertyDesc... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"void",
"fillIdentityPrimaryKeys",
"(",
"Object",
"entity",
",",
"ResultSet",
"rs",
")",
"throws",
"SQLException",
"{",
"BeanDesc",
"beanDesc",
"=",
"beanDescFactory",
".",
"getBeanDesc",
"(",
"entity"... | Sets GenerationType.IDENTITY properties value.
@param entity the entity
@param rs the result set
@throws SQLException if something goes wrong. | [
"Sets",
"GenerationType",
".",
"IDENTITY",
"properties",
"value",
"."
] | 29a44b7ad267b5a48bc250cd0ef7d74813d46889 | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/SqlExecutor.java#L437-L457 | train |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/util/MirageUtil.java | MirageUtil.buildDeleteSql | public static String buildDeleteSql(BeanDescFactory beanDescFactory, EntityOperator entityOperator, Class<?> entityType, NameConverter nameConverter,
List<PropertyDesc> propDescs){
StringBuilder sb = new StringBuilder();
sb.append("DELETE FROM ").append(getTableName(entityType, nameConver... | java | public static String buildDeleteSql(BeanDescFactory beanDescFactory, EntityOperator entityOperator, Class<?> entityType, NameConverter nameConverter,
List<PropertyDesc> propDescs){
StringBuilder sb = new StringBuilder();
sb.append("DELETE FROM ").append(getTableName(entityType, nameConver... | [
"public",
"static",
"String",
"buildDeleteSql",
"(",
"BeanDescFactory",
"beanDescFactory",
",",
"EntityOperator",
"entityOperator",
",",
"Class",
"<",
"?",
">",
"entityType",
",",
"NameConverter",
"nameConverter",
",",
"List",
"<",
"PropertyDesc",
">",
"propDescs",
... | Builds delete SQL and correct parameters from the entity.
@param beanDescFactory the bean descriptor factory
@param entityOperator the entity operator
@param entityType the entity class to delete
@param nameConverter the name converter
@param propDescs the list of parameters
@return Delete SQL
@deprecated use {@link ... | [
"Builds",
"delete",
"SQL",
"and",
"correct",
"parameters",
"from",
"the",
"entity",
"."
] | 29a44b7ad267b5a48bc250cd0ef7d74813d46889 | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/util/MirageUtil.java#L458-L487 | train |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/SqlManagerImpl.java | SqlManagerImpl.fillPrimaryKeysBySequence | private void fillPrimaryKeysBySequence(Object entity){
if(!dialect.supportsGenerationType(GenerationType.SEQUENCE)){
return;
}
BeanDesc beanDesc = beanDescFactory.getBeanDesc(entity.getClass());
int size = beanDesc.getPropertyDescSize();
for(int i=0; i < siz... | java | private void fillPrimaryKeysBySequence(Object entity){
if(!dialect.supportsGenerationType(GenerationType.SEQUENCE)){
return;
}
BeanDesc beanDesc = beanDescFactory.getBeanDesc(entity.getClass());
int size = beanDesc.getPropertyDescSize();
for(int i=0; i < siz... | [
"private",
"void",
"fillPrimaryKeysBySequence",
"(",
"Object",
"entity",
")",
"{",
"if",
"(",
"!",
"dialect",
".",
"supportsGenerationType",
"(",
"GenerationType",
".",
"SEQUENCE",
")",
")",
"{",
"return",
";",
"}",
"BeanDesc",
"beanDesc",
"=",
"beanDescFactory"... | Sets GenerationType.SEQUENCE properties value. | [
"Sets",
"GenerationType",
".",
"SEQUENCE",
"properties",
"value",
"."
] | 29a44b7ad267b5a48bc250cd0ef7d74813d46889 | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/SqlManagerImpl.java#L329-L347 | train |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/SqlManagerImpl.java | SqlManagerImpl.setValueTypes | public void setValueTypes(List<ValueType<?>> valueTypes) {
Validate.noNullElements(valueTypes);
this.sqlExecutor.setValueTypes(valueTypes);
this.callExecutor.setValueTypes(valueTypes);
} | java | public void setValueTypes(List<ValueType<?>> valueTypes) {
Validate.noNullElements(valueTypes);
this.sqlExecutor.setValueTypes(valueTypes);
this.callExecutor.setValueTypes(valueTypes);
} | [
"public",
"void",
"setValueTypes",
"(",
"List",
"<",
"ValueType",
"<",
"?",
">",
">",
"valueTypes",
")",
"{",
"Validate",
".",
"noNullElements",
"(",
"valueTypes",
")",
";",
"this",
".",
"sqlExecutor",
".",
"setValueTypes",
"(",
"valueTypes",
")",
";",
"th... | Sets the value types.
@param valueTypes the value types to set.
@throws IllegalArgumentException if the {@code valueTypes} is {@code null} or
an element in the {@code valueTypes} is {@code null} | [
"Sets",
"the",
"value",
"types",
"."
] | 29a44b7ad267b5a48bc250cd0ef7d74813d46889 | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/SqlManagerImpl.java#L539-L543 | train |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/updater/SchemaUpdater.java | SchemaUpdater.getSql | protected String getSql(int version){
Dialect dialect = ((SqlManagerImpl) sqlManager).getDialect();
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
InputStream in = classLoader.getResourceAsStream(
String.format("%s/%s_%d.sql", packageName, dialect.g... | java | protected String getSql(int version){
Dialect dialect = ((SqlManagerImpl) sqlManager).getDialect();
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
InputStream in = classLoader.getResourceAsStream(
String.format("%s/%s_%d.sql", packageName, dialect.g... | [
"protected",
"String",
"getSql",
"(",
"int",
"version",
")",
"{",
"Dialect",
"dialect",
"=",
"(",
"(",
"SqlManagerImpl",
")",
"sqlManager",
")",
".",
"getDialect",
"(",
")",
";",
"ClassLoader",
"classLoader",
"=",
"Thread",
".",
"currentThread",
"(",
")",
... | Returns the SQL which located within a package specified by the packageName as
"dialectname_version.sql" or "version.sql".
@param version the version number
@return SQL or null if the SQL file does not exist | [
"Returns",
"the",
"SQL",
"which",
"located",
"within",
"a",
"package",
"specified",
"by",
"the",
"packageName",
"as",
"dialectname_version",
".",
"sql",
"or",
"version",
".",
"sql",
"."
] | 29a44b7ad267b5a48bc250cd0ef7d74813d46889 | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/updater/SchemaUpdater.java#L117-L136 | train |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/updater/SchemaUpdater.java | SchemaUpdater.existsTable | protected boolean existsTable(){
try {
int count = sqlManager.getSingleResult(Integer.class,
new StringSqlResource(String.format("SELECT COUNT(*) FROM %s", tableName)));
if(count == 0){
// TODO Should insert an initial record?
r... | java | protected boolean existsTable(){
try {
int count = sqlManager.getSingleResult(Integer.class,
new StringSqlResource(String.format("SELECT COUNT(*) FROM %s", tableName)));
if(count == 0){
// TODO Should insert an initial record?
r... | [
"protected",
"boolean",
"existsTable",
"(",
")",
"{",
"try",
"{",
"int",
"count",
"=",
"sqlManager",
".",
"getSingleResult",
"(",
"Integer",
".",
"class",
",",
"new",
"StringSqlResource",
"(",
"String",
".",
"format",
"(",
"\"SELECT COUNT(*) FROM %s\"",
",",
"... | Checks the table which manages a schema version exists or not exists.
@return if the table exists then returns true; otherwise false | [
"Checks",
"the",
"table",
"which",
"manages",
"a",
"schema",
"version",
"exists",
"or",
"not",
"exists",
"."
] | 29a44b7ad267b5a48bc250cd0ef7d74813d46889 | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/updater/SchemaUpdater.java#L143-L157 | train |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/updater/SchemaUpdater.java | SchemaUpdater.createTable | protected void createTable(){
sqlManager.executeUpdate(
new StringSqlResource(String.format("CREATE TABLE %s (VERSION NUMERIC NOT NULL)", tableName)));
sqlManager.executeUpdate(
new StringSqlResource(String.format("INSERT INTO %s (0))", tableName)));
} | java | protected void createTable(){
sqlManager.executeUpdate(
new StringSqlResource(String.format("CREATE TABLE %s (VERSION NUMERIC NOT NULL)", tableName)));
sqlManager.executeUpdate(
new StringSqlResource(String.format("INSERT INTO %s (0))", tableName)));
} | [
"protected",
"void",
"createTable",
"(",
")",
"{",
"sqlManager",
".",
"executeUpdate",
"(",
"new",
"StringSqlResource",
"(",
"String",
".",
"format",
"(",
"\"CREATE TABLE %s (VERSION NUMERIC NOT NULL)\"",
",",
"tableName",
")",
")",
")",
";",
"sqlManager",
".",
"e... | Creates table which manages schema version and insert an initial record as version 0. | [
"Creates",
"table",
"which",
"manages",
"schema",
"version",
"and",
"insert",
"an",
"initial",
"record",
"as",
"version",
"0",
"."
] | 29a44b7ad267b5a48bc250cd0ef7d74813d46889 | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/updater/SchemaUpdater.java#L162-L168 | train |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/session/SessionFactory.java | SessionFactory.getSession | public synchronized static Session getSession() {
if(session == null){
Properties properties = IOUtil.loadProperties("jdbc.properties");
session = getSession(properties);
}
return session;
} | java | public synchronized static Session getSession() {
if(session == null){
Properties properties = IOUtil.loadProperties("jdbc.properties");
session = getSession(properties);
}
return session;
} | [
"public",
"synchronized",
"static",
"Session",
"getSession",
"(",
")",
"{",
"if",
"(",
"session",
"==",
"null",
")",
"{",
"Properties",
"properties",
"=",
"IOUtil",
".",
"loadProperties",
"(",
"\"jdbc.properties\"",
")",
";",
"session",
"=",
"getSession",
"(",... | Returns a session configured with the properties specified in the "jdbc.properties" file.
@return {@link Session}
@throws ConfigurationException if the configuration can't be loaded | [
"Returns",
"a",
"session",
"configured",
"with",
"the",
"properties",
"specified",
"in",
"the",
"jdbc",
".",
"properties",
"file",
"."
] | 29a44b7ad267b5a48bc250cd0ef7d74813d46889 | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/session/SessionFactory.java#L22-L29 | train |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/naming/Inflection.java | Inflection.isUncountable | public static boolean isUncountable(String word) {
for (String w : UNCOUNTABLE) {
if (w.equalsIgnoreCase(word)) {
return true;
}
}
return false;
} | java | public static boolean isUncountable(String word) {
for (String w : UNCOUNTABLE) {
if (w.equalsIgnoreCase(word)) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"isUncountable",
"(",
"String",
"word",
")",
"{",
"for",
"(",
"String",
"w",
":",
"UNCOUNTABLE",
")",
"{",
"if",
"(",
"w",
".",
"equalsIgnoreCase",
"(",
"word",
")",
")",
"{",
"return",
"true",
";",
"}",
"}",
"return",
... | Return true if the word is uncountable.
@param word The word
@return True if it is uncountable | [
"Return",
"true",
"if",
"the",
"word",
"is",
"uncountable",
"."
] | 29a44b7ad267b5a48bc250cd0ef7d74813d46889 | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/naming/Inflection.java#L115-L122 | train |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/naming/Inflection.java | Inflection.singularize | public static String singularize(String word) {
if (isUncountable(word)) {
return word;
} else {
for (Inflection inflection : SINGULAR) {
if (inflection.match(word)) {
return inflection.replace(word);
}
}
}
... | java | public static String singularize(String word) {
if (isUncountable(word)) {
return word;
} else {
for (Inflection inflection : SINGULAR) {
if (inflection.match(word)) {
return inflection.replace(word);
}
}
}
... | [
"public",
"static",
"String",
"singularize",
"(",
"String",
"word",
")",
"{",
"if",
"(",
"isUncountable",
"(",
"word",
")",
")",
"{",
"return",
"word",
";",
"}",
"else",
"{",
"for",
"(",
"Inflection",
"inflection",
":",
"SINGULAR",
")",
"{",
"if",
"(",... | Return the singularized version of a word.
@param word The word
@return The singularized word | [
"Return",
"the",
"singularized",
"version",
"of",
"a",
"word",
"."
] | 29a44b7ad267b5a48bc250cd0ef7d74813d46889 | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/naming/Inflection.java#L149-L160 | train |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/naming/Inflection.java | Inflection.match | public boolean match(String word) {
int flags = 0;
if (ignoreCase) {
flags = flags | Pattern.CASE_INSENSITIVE;
}
return Pattern.compile(pattern, flags).matcher(word).find();
} | java | public boolean match(String word) {
int flags = 0;
if (ignoreCase) {
flags = flags | Pattern.CASE_INSENSITIVE;
}
return Pattern.compile(pattern, flags).matcher(word).find();
} | [
"public",
"boolean",
"match",
"(",
"String",
"word",
")",
"{",
"int",
"flags",
"=",
"0",
";",
"if",
"(",
"ignoreCase",
")",
"{",
"flags",
"=",
"flags",
"|",
"Pattern",
".",
"CASE_INSENSITIVE",
";",
"}",
"return",
"Pattern",
".",
"compile",
"(",
"patter... | Does the given word match?
@param word The word
@return True if it matches the inflection pattern | [
"Does",
"the",
"given",
"word",
"match?"
] | 29a44b7ad267b5a48bc250cd0ef7d74813d46889 | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/naming/Inflection.java#L207-L213 | train |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/naming/Inflection.java | Inflection.replace | public String replace(String word) {
int flags = 0;
if (ignoreCase) {
flags = flags | Pattern.CASE_INSENSITIVE;
}
return Pattern.compile(pattern, flags).matcher(word).replaceAll(replacement);
} | java | public String replace(String word) {
int flags = 0;
if (ignoreCase) {
flags = flags | Pattern.CASE_INSENSITIVE;
}
return Pattern.compile(pattern, flags).matcher(word).replaceAll(replacement);
} | [
"public",
"String",
"replace",
"(",
"String",
"word",
")",
"{",
"int",
"flags",
"=",
"0",
";",
"if",
"(",
"ignoreCase",
")",
"{",
"flags",
"=",
"flags",
"|",
"Pattern",
".",
"CASE_INSENSITIVE",
";",
"}",
"return",
"Pattern",
".",
"compile",
"(",
"patte... | Replace the word with its pattern.
@param word The word
@return The result | [
"Replace",
"the",
"word",
"with",
"its",
"pattern",
"."
] | 29a44b7ad267b5a48bc250cd0ef7d74813d46889 | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/naming/Inflection.java#L221-L227 | train |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/session/DialectAutoSelector.java | DialectAutoSelector.getDialect | public static Dialect getDialect(String url){
if(url.startsWith("jdbc:mysql:")){
return new MySQLDialect();
} else if(url.startsWith("jdbc:postgresql:")){
return new PostgreSQLDialect();
} else if(url.startsWith("jdbc:oracle:")){
return new OracleDialect... | java | public static Dialect getDialect(String url){
if(url.startsWith("jdbc:mysql:")){
return new MySQLDialect();
} else if(url.startsWith("jdbc:postgresql:")){
return new PostgreSQLDialect();
} else if(url.startsWith("jdbc:oracle:")){
return new OracleDialect... | [
"public",
"static",
"Dialect",
"getDialect",
"(",
"String",
"url",
")",
"{",
"if",
"(",
"url",
".",
"startsWith",
"(",
"\"jdbc:mysql:\"",
")",
")",
"{",
"return",
"new",
"MySQLDialect",
"(",
")",
";",
"}",
"else",
"if",
"(",
"url",
".",
"startsWith",
"... | Selects the Database Dialect based on the JDBC connection URL.
@param url the JDBC Connection URL
@return the dialect that maps to a specific JDBC URL. | [
"Selects",
"the",
"Database",
"Dialect",
"based",
"on",
"the",
"JDBC",
"connection",
"URL",
"."
] | 29a44b7ad267b5a48bc250cd0ef7d74813d46889 | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/session/DialectAutoSelector.java#L13-L36 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.