id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
2,100
fernandospr/javapns-jdk16
src/main/java/javapns/communication/KeystoreManager.java
KeystoreManager.verifyKeystoreContent
public static void verifyKeystoreContent(AppleServer server, Object keystore) throws KeystoreException { KeyStore keystoreToValidate = null; if (keystore instanceof KeyStore) keystoreToValidate = (KeyStore) keystore; else keystoreToValidate = loadKeystore(server, keystore); verifyKeystoreContent(keystoreToValid...
java
public static void verifyKeystoreContent(AppleServer server, Object keystore) throws KeystoreException { KeyStore keystoreToValidate = null; if (keystore instanceof KeyStore) keystoreToValidate = (KeyStore) keystore; else keystoreToValidate = loadKeystore(server, keystore); verifyKeystoreContent(keystoreToValid...
[ "public", "static", "void", "verifyKeystoreContent", "(", "AppleServer", "server", ",", "Object", "keystore", ")", "throws", "KeystoreException", "{", "KeyStore", "keystoreToValidate", "=", "null", ";", "if", "(", "keystore", "instanceof", "KeyStore", ")", "keystore...
Perform basic tests on a keystore to detect common user mistakes. If a problem is found, a KeystoreException is thrown. If no problem is found, this method simply returns without exceptions. @param server the server the keystore is intended for @param keystore a keystore containing your private key and the certificate...
[ "Perform", "basic", "tests", "on", "a", "keystore", "to", "detect", "common", "user", "mistakes", ".", "If", "a", "problem", "is", "found", "a", "KeystoreException", "is", "thrown", ".", "If", "no", "problem", "is", "found", "this", "method", "simply", "re...
84de6d9328ab01af92f77cc60c4554de02420909
https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/communication/KeystoreManager.java#L101-L106
2,101
fernandospr/javapns-jdk16
src/main/java/javapns/communication/KeystoreManager.java
KeystoreManager.validateKeystoreParameter
public static void validateKeystoreParameter(Object keystore) throws InvalidKeystoreReferenceException { if (keystore == null) throw new InvalidKeystoreReferenceException((Object) null); if (keystore instanceof KeyStore) return; if (keystore instanceof InputStream) return; if (keystore instanceof String) keysto...
java
public static void validateKeystoreParameter(Object keystore) throws InvalidKeystoreReferenceException { if (keystore == null) throw new InvalidKeystoreReferenceException((Object) null); if (keystore instanceof KeyStore) return; if (keystore instanceof InputStream) return; if (keystore instanceof String) keysto...
[ "public", "static", "void", "validateKeystoreParameter", "(", "Object", "keystore", ")", "throws", "InvalidKeystoreReferenceException", "{", "if", "(", "keystore", "==", "null", ")", "throw", "new", "InvalidKeystoreReferenceException", "(", "(", "Object", ")", "null",...
Ensures that a keystore parameter is actually supported by the KeystoreManager. @param keystore a keystore containing your private key and the certificate signed by Apple (File, InputStream, byte[], KeyStore or String for a file path) @throws InvalidKeystoreReferenceException thrown if the provided keystore parameter ...
[ "Ensures", "that", "a", "keystore", "parameter", "is", "actually", "supported", "by", "the", "KeystoreManager", "." ]
84de6d9328ab01af92f77cc60c4554de02420909
https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/communication/KeystoreManager.java#L212-L228
2,102
fernandospr/javapns-jdk16
src/main/java/javapns/notification/Payload.java
Payload.addCustomDictionary
public void addCustomDictionary(String name, String value) throws JSONException { logger.debug("Adding custom Dictionary [" + name + "] = [" + value + "]"); put(name, value, payload, false); }
java
public void addCustomDictionary(String name, String value) throws JSONException { logger.debug("Adding custom Dictionary [" + name + "] = [" + value + "]"); put(name, value, payload, false); }
[ "public", "void", "addCustomDictionary", "(", "String", "name", ",", "String", "value", ")", "throws", "JSONException", "{", "logger", ".", "debug", "(", "\"Adding custom Dictionary [\"", "+", "name", "+", "\"] = [\"", "+", "value", "+", "\"]\"", ")", ";", "pu...
Add a custom dictionnary with a string value @param name @param value @throws JSONException
[ "Add", "a", "custom", "dictionnary", "with", "a", "string", "value" ]
84de6d9328ab01af92f77cc60c4554de02420909
https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/notification/Payload.java#L77-L80
2,103
fernandospr/javapns-jdk16
src/main/java/javapns/notification/Payload.java
Payload.addCustomDictionary
public void addCustomDictionary(String name, List values) throws JSONException { logger.debug("Adding custom Dictionary [" + name + "] = (list)"); put(name, values, payload, false); }
java
public void addCustomDictionary(String name, List values) throws JSONException { logger.debug("Adding custom Dictionary [" + name + "] = (list)"); put(name, values, payload, false); }
[ "public", "void", "addCustomDictionary", "(", "String", "name", ",", "List", "values", ")", "throws", "JSONException", "{", "logger", ".", "debug", "(", "\"Adding custom Dictionary [\"", "+", "name", "+", "\"] = (list)\"", ")", ";", "put", "(", "name", ",", "v...
Add a custom dictionnary with multiple values @param name @param values @throws JSONException
[ "Add", "a", "custom", "dictionnary", "with", "multiple", "values" ]
84de6d9328ab01af92f77cc60c4554de02420909
https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/notification/Payload.java#L101-L104
2,104
fernandospr/javapns-jdk16
src/main/java/javapns/notification/Payload.java
Payload.getPayloadAsBytesUnchecked
private byte[] getPayloadAsBytesUnchecked() throws Exception { byte[] bytes = null; try { bytes = toString().getBytes(characterEncoding); } catch (Exception ex) { bytes = toString().getBytes(); } return bytes; }
java
private byte[] getPayloadAsBytesUnchecked() throws Exception { byte[] bytes = null; try { bytes = toString().getBytes(characterEncoding); } catch (Exception ex) { bytes = toString().getBytes(); } return bytes; }
[ "private", "byte", "[", "]", "getPayloadAsBytesUnchecked", "(", ")", "throws", "Exception", "{", "byte", "[", "]", "bytes", "=", "null", ";", "try", "{", "bytes", "=", "toString", "(", ")", ".", "getBytes", "(", "characterEncoding", ")", ";", "}", "catch...
Get this payload as a byte array using the preconfigured character encoding. This method does NOT check if the payload exceeds the maximum payload length. @return byte[] bytes ready to be streamed directly to Apple servers (but that might exceed the maximum size limit)
[ "Get", "this", "payload", "as", "a", "byte", "array", "using", "the", "preconfigured", "character", "encoding", ".", "This", "method", "does", "NOT", "check", "if", "the", "payload", "exceeds", "the", "maximum", "payload", "length", "." ]
84de6d9328ab01af92f77cc60c4554de02420909
https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/notification/Payload.java#L151-L159
2,105
fernandospr/javapns-jdk16
src/main/java/javapns/notification/Payload.java
Payload.estimatePayloadSizeAfterAdding
public int estimatePayloadSizeAfterAdding(String propertyName, Object propertyValue) { try { int maximumPayloadSize = getMaximumPayloadSize(); int currentPayloadSize = getPayloadAsBytesUnchecked().length; int estimatedSize = currentPayloadSize; if (propertyName != null && propertyValue != null) { esti...
java
public int estimatePayloadSizeAfterAdding(String propertyName, Object propertyValue) { try { int maximumPayloadSize = getMaximumPayloadSize(); int currentPayloadSize = getPayloadAsBytesUnchecked().length; int estimatedSize = currentPayloadSize; if (propertyName != null && propertyValue != null) { esti...
[ "public", "int", "estimatePayloadSizeAfterAdding", "(", "String", "propertyName", ",", "Object", "propertyValue", ")", "{", "try", "{", "int", "maximumPayloadSize", "=", "getMaximumPayloadSize", "(", ")", ";", "int", "currentPayloadSize", "=", "getPayloadAsBytesUnchecke...
Estimate the size that this payload will take after adding a given property. For performance reasons, this estimate is not as reliable as actually adding the property and checking the payload size afterwards. Currently works well with strings and numbers. @param propertyName the name of the property to use for calcul...
[ "Estimate", "the", "size", "that", "this", "payload", "will", "take", "after", "adding", "a", "given", "property", ".", "For", "performance", "reasons", "this", "estimate", "is", "not", "as", "reliable", "as", "actually", "adding", "the", "property", "and", ...
84de6d9328ab01af92f77cc60c4554de02420909
https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/notification/Payload.java#L200-L222
2,106
fernandospr/javapns-jdk16
src/main/java/javapns/notification/Payload.java
Payload.isEstimatedPayloadSizeAllowedAfterAdding
public boolean isEstimatedPayloadSizeAllowedAfterAdding(String propertyName, Object propertyValue) { int maximumPayloadSize = getMaximumPayloadSize(); int estimatedPayloadSize = estimatePayloadSizeAfterAdding(propertyName, propertyValue); boolean estimatedToBeAllowed = estimatedPayloadSize <= maximumPayloadSize; ...
java
public boolean isEstimatedPayloadSizeAllowedAfterAdding(String propertyName, Object propertyValue) { int maximumPayloadSize = getMaximumPayloadSize(); int estimatedPayloadSize = estimatePayloadSizeAfterAdding(propertyName, propertyValue); boolean estimatedToBeAllowed = estimatedPayloadSize <= maximumPayloadSize; ...
[ "public", "boolean", "isEstimatedPayloadSizeAllowedAfterAdding", "(", "String", "propertyName", ",", "Object", "propertyValue", ")", "{", "int", "maximumPayloadSize", "=", "getMaximumPayloadSize", "(", ")", ";", "int", "estimatedPayloadSize", "=", "estimatePayloadSizeAfterA...
Validate if the estimated payload size after adding a given property will be allowed. For performance reasons, this estimate is not as reliable as actually adding the property and checking the payload size afterwards. @param propertyName the name of the property to use for calculating the estimation @param propertyVal...
[ "Validate", "if", "the", "estimated", "payload", "size", "after", "adding", "a", "given", "property", "will", "be", "allowed", ".", "For", "performance", "reasons", "this", "estimate", "is", "not", "as", "reliable", "as", "actually", "adding", "the", "property...
84de6d9328ab01af92f77cc60c4554de02420909
https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/notification/Payload.java#L234-L239
2,107
fernandospr/javapns-jdk16
src/main/java/javapns/notification/Payload.java
Payload.validateMaximumPayloadSize
private void validateMaximumPayloadSize(int currentPayloadSize) throws PayloadMaxSizeExceededException { int maximumPayloadSize = getMaximumPayloadSize(); if (currentPayloadSize > maximumPayloadSize) { throw new PayloadMaxSizeExceededException(maximumPayloadSize, currentPayloadSize); } }
java
private void validateMaximumPayloadSize(int currentPayloadSize) throws PayloadMaxSizeExceededException { int maximumPayloadSize = getMaximumPayloadSize(); if (currentPayloadSize > maximumPayloadSize) { throw new PayloadMaxSizeExceededException(maximumPayloadSize, currentPayloadSize); } }
[ "private", "void", "validateMaximumPayloadSize", "(", "int", "currentPayloadSize", ")", "throws", "PayloadMaxSizeExceededException", "{", "int", "maximumPayloadSize", "=", "getMaximumPayloadSize", "(", ")", ";", "if", "(", "currentPayloadSize", ">", "maximumPayloadSize", ...
Validate that the payload does not exceed the maximum size allowed. If the limit is exceeded, a PayloadMaxSizeExceededException is thrown. @param currentPayloadSize the total size of the payload in bytes @throws PayloadMaxSizeExceededException if the payload exceeds the maximum size allowed
[ "Validate", "that", "the", "payload", "does", "not", "exceed", "the", "maximum", "size", "allowed", ".", "If", "the", "limit", "is", "exceeded", "a", "PayloadMaxSizeExceededException", "is", "thrown", "." ]
84de6d9328ab01af92f77cc60c4554de02420909
https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/notification/Payload.java#L249-L254
2,108
fernandospr/javapns-jdk16
src/main/java/javapns/notification/Payload.java
Payload.put
protected void put(String propertyName, Object propertyValue, JSONObject object, boolean opt) throws JSONException { try { if (isPayloadSizeEstimatedWhenAdding()) { int maximumPayloadSize = getMaximumPayloadSize(); int estimatedPayloadSize = estimatePayloadSizeAfterAdding(propertyName, propertyValue); ...
java
protected void put(String propertyName, Object propertyValue, JSONObject object, boolean opt) throws JSONException { try { if (isPayloadSizeEstimatedWhenAdding()) { int maximumPayloadSize = getMaximumPayloadSize(); int estimatedPayloadSize = estimatePayloadSizeAfterAdding(propertyName, propertyValue); ...
[ "protected", "void", "put", "(", "String", "propertyName", ",", "Object", "propertyValue", ",", "JSONObject", "object", ",", "boolean", "opt", ")", "throws", "JSONException", "{", "try", "{", "if", "(", "isPayloadSizeEstimatedWhenAdding", "(", ")", ")", "{", "...
Puts a property in a JSONObject, while possibly checking for estimated payload size violation. @param propertyName the name of the property to use for calculating the estimation @param propertyValue the value of the property to use for calculating the estimation @param object the JSONObject to put the property in @par...
[ "Puts", "a", "property", "in", "a", "JSONObject", "while", "possibly", "checking", "for", "estimated", "payload", "size", "violation", "." ]
84de6d9328ab01af92f77cc60c4554de02420909
https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/notification/Payload.java#L266-L281
2,109
fernandospr/javapns-jdk16
src/main/java/javapns/notification/PushNotificationPayload.java
PushNotificationPayload.alert
public static PushNotificationPayload alert(String message) { if (message == null) throw new IllegalArgumentException("Alert cannot be null"); PushNotificationPayload payload = complex(); try { payload.addAlert(message); } catch (JSONException e) { } return payload; }
java
public static PushNotificationPayload alert(String message) { if (message == null) throw new IllegalArgumentException("Alert cannot be null"); PushNotificationPayload payload = complex(); try { payload.addAlert(message); } catch (JSONException e) { } return payload; }
[ "public", "static", "PushNotificationPayload", "alert", "(", "String", "message", ")", "{", "if", "(", "message", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "\"Alert cannot be null\"", ")", ";", "PushNotificationPayload", "payload", "=", "co...
Create a pre-defined payload with a simple alert message. @param message the alert's message @return a ready-to-send payload
[ "Create", "a", "pre", "-", "defined", "payload", "with", "a", "simple", "alert", "message", "." ]
84de6d9328ab01af92f77cc60c4554de02420909
https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/notification/PushNotificationPayload.java#L28-L36
2,110
fernandospr/javapns-jdk16
src/main/java/javapns/notification/PushNotificationPayload.java
PushNotificationPayload.badge
public static PushNotificationPayload badge(int badge) { PushNotificationPayload payload = complex(); try { payload.addBadge(badge); } catch (JSONException e) { } return payload; }
java
public static PushNotificationPayload badge(int badge) { PushNotificationPayload payload = complex(); try { payload.addBadge(badge); } catch (JSONException e) { } return payload; }
[ "public", "static", "PushNotificationPayload", "badge", "(", "int", "badge", ")", "{", "PushNotificationPayload", "payload", "=", "complex", "(", ")", ";", "try", "{", "payload", ".", "addBadge", "(", "badge", ")", ";", "}", "catch", "(", "JSONException", "e...
Create a pre-defined payload with a badge. @param badge the badge @return a ready-to-send payload
[ "Create", "a", "pre", "-", "defined", "payload", "with", "a", "badge", "." ]
84de6d9328ab01af92f77cc60c4554de02420909
https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/notification/PushNotificationPayload.java#L45-L52
2,111
fernandospr/javapns-jdk16
src/main/java/javapns/notification/PushNotificationPayload.java
PushNotificationPayload.sound
public static PushNotificationPayload sound(String sound) { if (sound == null) throw new IllegalArgumentException("Sound name cannot be null"); PushNotificationPayload payload = complex(); try { payload.addSound(sound); } catch (JSONException e) { } return payload; }
java
public static PushNotificationPayload sound(String sound) { if (sound == null) throw new IllegalArgumentException("Sound name cannot be null"); PushNotificationPayload payload = complex(); try { payload.addSound(sound); } catch (JSONException e) { } return payload; }
[ "public", "static", "PushNotificationPayload", "sound", "(", "String", "sound", ")", "{", "if", "(", "sound", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "\"Sound name cannot be null\"", ")", ";", "PushNotificationPayload", "payload", "=", "c...
Create a pre-defined payload with a sound name. @param sound the name of the sound @return a ready-to-send payload
[ "Create", "a", "pre", "-", "defined", "payload", "with", "a", "sound", "name", "." ]
84de6d9328ab01af92f77cc60c4554de02420909
https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/notification/PushNotificationPayload.java#L61-L69
2,112
fernandospr/javapns-jdk16
src/main/java/javapns/notification/PushNotificationPayload.java
PushNotificationPayload.combined
public static PushNotificationPayload combined(String message, int badge, String sound) { if (message == null && badge < 0 && sound == null) throw new IllegalArgumentException("Must provide at least one non-null argument"); PushNotificationPayload payload = complex(); try { if (message != null) payload.add...
java
public static PushNotificationPayload combined(String message, int badge, String sound) { if (message == null && badge < 0 && sound == null) throw new IllegalArgumentException("Must provide at least one non-null argument"); PushNotificationPayload payload = complex(); try { if (message != null) payload.add...
[ "public", "static", "PushNotificationPayload", "combined", "(", "String", "message", ",", "int", "badge", ",", "String", "sound", ")", "{", "if", "(", "message", "==", "null", "&&", "badge", "<", "0", "&&", "sound", "==", "null", ")", "throw", "new", "Il...
Create a pre-defined payload with a simple alert message, a badge and a sound. @param message the alert message @param badge the badge @param sound the name of the sound @return a ready-to-send payload
[ "Create", "a", "pre", "-", "defined", "payload", "with", "a", "simple", "alert", "message", "a", "badge", "and", "a", "sound", "." ]
84de6d9328ab01af92f77cc60c4554de02420909
https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/notification/PushNotificationPayload.java#L80-L90
2,113
fernandospr/javapns-jdk16
src/main/java/javapns/notification/PushNotificationPayload.java
PushNotificationPayload.fromJSON
public static PushNotificationPayload fromJSON(String rawJSON) throws JSONException { PushNotificationPayload payload = new PushNotificationPayload(rawJSON); return payload; }
java
public static PushNotificationPayload fromJSON(String rawJSON) throws JSONException { PushNotificationPayload payload = new PushNotificationPayload(rawJSON); return payload; }
[ "public", "static", "PushNotificationPayload", "fromJSON", "(", "String", "rawJSON", ")", "throws", "JSONException", "{", "PushNotificationPayload", "payload", "=", "new", "PushNotificationPayload", "(", "rawJSON", ")", ";", "return", "payload", ";", "}" ]
Create a PushNotificationPayload object from a preformatted JSON payload. @param rawJSON a JSON-formatted string representing a payload (ex: {"aps":{"alert":"Hello World!"}} ) @return a ready-to-send payload @throws JSONException if any exception occurs parsing the JSON string
[ "Create", "a", "PushNotificationPayload", "object", "from", "a", "preformatted", "JSON", "payload", "." ]
84de6d9328ab01af92f77cc60c4554de02420909
https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/notification/PushNotificationPayload.java#L125-L128
2,114
fernandospr/javapns-jdk16
src/main/java/javapns/notification/PushNotificationPayload.java
PushNotificationPayload.addBadge
public void addBadge(int badge) throws JSONException { logger.debug("Adding badge [" + badge + "]"); put("badge", badge, this.apsDictionary, true); }
java
public void addBadge(int badge) throws JSONException { logger.debug("Adding badge [" + badge + "]"); put("badge", badge, this.apsDictionary, true); }
[ "public", "void", "addBadge", "(", "int", "badge", ")", "throws", "JSONException", "{", "logger", ".", "debug", "(", "\"Adding badge [\"", "+", "badge", "+", "\"]\"", ")", ";", "put", "(", "\"badge\"", ",", "badge", ",", "this", ".", "apsDictionary", ",", ...
Add a badge. @param badge a badge number @throws JSONException
[ "Add", "a", "badge", "." ]
84de6d9328ab01af92f77cc60c4554de02420909
https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/notification/PushNotificationPayload.java#L193-L196
2,115
fernandospr/javapns-jdk16
src/main/java/javapns/notification/PushNotificationPayload.java
PushNotificationPayload.addSound
public void addSound(String sound) throws JSONException { logger.debug("Adding sound [" + sound + "]"); put("sound", sound, this.apsDictionary, true); }
java
public void addSound(String sound) throws JSONException { logger.debug("Adding sound [" + sound + "]"); put("sound", sound, this.apsDictionary, true); }
[ "public", "void", "addSound", "(", "String", "sound", ")", "throws", "JSONException", "{", "logger", ".", "debug", "(", "\"Adding sound [\"", "+", "sound", "+", "\"]\"", ")", ";", "put", "(", "\"sound\"", ",", "sound", ",", "this", ".", "apsDictionary", ",...
Add a sound. @param sound the name of a sound @throws JSONException
[ "Add", "a", "sound", "." ]
84de6d9328ab01af92f77cc60c4554de02420909
https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/notification/PushNotificationPayload.java#L205-L208
2,116
fernandospr/javapns-jdk16
src/main/java/javapns/notification/PushNotificationPayload.java
PushNotificationPayload.getOrAddCustomAlert
private JSONObject getOrAddCustomAlert() throws JSONException { JSONObject alert = getCompatibleProperty("alert", JSONObject.class, "A simple alert (\"%s\") was already added to this payload"); if (alert == null) { alert = new JSONObject(); put("alert", alert, this.apsDictionary, false); } return al...
java
private JSONObject getOrAddCustomAlert() throws JSONException { JSONObject alert = getCompatibleProperty("alert", JSONObject.class, "A simple alert (\"%s\") was already added to this payload"); if (alert == null) { alert = new JSONObject(); put("alert", alert, this.apsDictionary, false); } return al...
[ "private", "JSONObject", "getOrAddCustomAlert", "(", ")", "throws", "JSONException", "{", "JSONObject", "alert", "=", "getCompatibleProperty", "(", "\"alert\"", ",", "JSONObject", ".", "class", ",", "\"A simple alert (\\\"%s\\\") was already added to this payload\"", ")", "...
Get the custom alert object, creating it if it does not yet exist. @return the JSON object defining the custom alert @throws JSONException if a simple alert has already been added to this payload
[ "Get", "the", "custom", "alert", "object", "creating", "it", "if", "it", "does", "not", "yet", "exist", "." ]
84de6d9328ab01af92f77cc60c4554de02420909
https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/notification/PushNotificationPayload.java#L231-L238
2,117
fernandospr/javapns-jdk16
src/main/java/javapns/notification/PushNotificationPayload.java
PushNotificationPayload.setContentAvailable
public void setContentAvailable(boolean available) throws JSONException { if (available == true) { logger.debug("Setting content available"); put("content-available", 1, this.apsDictionary, false); } else { logger.debug("Removing content available"); remove("content-available", this.apsDictionary)...
java
public void setContentAvailable(boolean available) throws JSONException { if (available == true) { logger.debug("Setting content available"); put("content-available", 1, this.apsDictionary, false); } else { logger.debug("Removing content available"); remove("content-available", this.apsDictionary)...
[ "public", "void", "setContentAvailable", "(", "boolean", "available", ")", "throws", "JSONException", "{", "if", "(", "available", "==", "true", ")", "{", "logger", ".", "debug", "(", "\"Setting content available\"", ")", ";", "put", "(", "\"content-available\"", ...
Sets the content available. @param available @throws JSONException
[ "Sets", "the", "content", "available", "." ]
84de6d9328ab01af92f77cc60c4554de02420909
https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/notification/PushNotificationPayload.java#L397-L405
2,118
fernandospr/javapns-jdk16
src/main/java/javapns/notification/PushNotificationPayload.java
PushNotificationPayload.addCategory
public void addCategory(String category) throws JSONException { logger.debug("Adding category [" + category + "]"); put("category", category, this.apsDictionary, true); }
java
public void addCategory(String category) throws JSONException { logger.debug("Adding category [" + category + "]"); put("category", category, this.apsDictionary, true); }
[ "public", "void", "addCategory", "(", "String", "category", ")", "throws", "JSONException", "{", "logger", ".", "debug", "(", "\"Adding category [\"", "+", "category", "+", "\"]\"", ")", ";", "put", "(", "\"category\"", ",", "category", ",", "this", ".", "ap...
Add a category. @param category the category of a message @throws JSONException
[ "Add", "a", "category", "." ]
84de6d9328ab01af92f77cc60c4554de02420909
https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/notification/PushNotificationPayload.java#L413-L416
2,119
fernandospr/javapns-jdk16
src/main/java/javapns/notification/PushNotificationPayload.java
PushNotificationPayload.setMutableContent
public void setMutableContent(boolean mutable) throws JSONException { if (mutable == true) { logger.debug("Setting mutable content"); put("mutable-content", 1, this.apsDictionary, false); } else { logger.debug("Removing mutable content"); remove("mutable-content", this.apsDictionary); } }
java
public void setMutableContent(boolean mutable) throws JSONException { if (mutable == true) { logger.debug("Setting mutable content"); put("mutable-content", 1, this.apsDictionary, false); } else { logger.debug("Removing mutable content"); remove("mutable-content", this.apsDictionary); } }
[ "public", "void", "setMutableContent", "(", "boolean", "mutable", ")", "throws", "JSONException", "{", "if", "(", "mutable", "==", "true", ")", "{", "logger", ".", "debug", "(", "\"Setting mutable content\"", ")", ";", "put", "(", "\"mutable-content\"", ",", "...
Sets the mutable content. @param mutable @throws JSONException
[ "Sets", "the", "mutable", "content", "." ]
84de6d9328ab01af92f77cc60c4554de02420909
https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/notification/PushNotificationPayload.java#L424-L432
2,120
fernandospr/javapns-jdk16
src/main/java/javapns/notification/ResponsePacket.java
ResponsePacket.getMessage
public String getMessage() { if (command == 8) { String prefix = "APNS: [" + identifier + "] "; //APNS ERROR FOR MESSAGE ID #" + identifier + ": "; if (status == 0) return prefix + "No errors encountered"; if (status == 1) return prefix + "Processing error"; if (status == 2) return prefix + "Missing devic...
java
public String getMessage() { if (command == 8) { String prefix = "APNS: [" + identifier + "] "; //APNS ERROR FOR MESSAGE ID #" + identifier + ": "; if (status == 0) return prefix + "No errors encountered"; if (status == 1) return prefix + "Processing error"; if (status == 2) return prefix + "Missing devic...
[ "public", "String", "getMessage", "(", ")", "{", "if", "(", "command", "==", "8", ")", "{", "String", "prefix", "=", "\"APNS: [\"", "+", "identifier", "+", "\"] \"", ";", "//APNS ERROR FOR MESSAGE ID #\" + identifier + \": \";", "if", "(", "status", "==", "0", ...
Returns a humand-friendly error message, as documented by Apple. @return a humand-friendly error message
[ "Returns", "a", "humand", "-", "friendly", "error", "message", "as", "documented", "by", "Apple", "." ]
84de6d9328ab01af92f77cc60c4554de02420909
https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/notification/ResponsePacket.java#L107-L123
2,121
wdullaer/SwipeActionAdapter
library/src/main/java/com/wdullaer/swipeactionadapter/SwipeViewGroup.java
SwipeViewGroup.addBackground
public SwipeViewGroup addBackground(View background, SwipeDirection direction){ if(mBackgroundMap.get(direction) != null) removeView(mBackgroundMap.get(direction)); background.setVisibility(View.INVISIBLE); mBackgroundMap.put(direction, background); addView(background); return t...
java
public SwipeViewGroup addBackground(View background, SwipeDirection direction){ if(mBackgroundMap.get(direction) != null) removeView(mBackgroundMap.get(direction)); background.setVisibility(View.INVISIBLE); mBackgroundMap.put(direction, background); addView(background); return t...
[ "public", "SwipeViewGroup", "addBackground", "(", "View", "background", ",", "SwipeDirection", "direction", ")", "{", "if", "(", "mBackgroundMap", ".", "get", "(", "direction", ")", "!=", "null", ")", "removeView", "(", "mBackgroundMap", ".", "get", "(", "dire...
Add a View to the background of the Layout. The background should have the same height as the contentView @param background The View to be added to the Layout @param direction The key to be used to find it again @return A reference to the a layout so commands can be chained
[ "Add", "a", "View", "to", "the", "background", "of", "the", "Layout", ".", "The", "background", "should", "have", "the", "same", "height", "as", "the", "contentView" ]
24a7e2ed953ac11ea0d8875d375bba571ffeba55
https://github.com/wdullaer/SwipeActionAdapter/blob/24a7e2ed953ac11ea0d8875d375bba571ffeba55/library/src/main/java/com/wdullaer/swipeactionadapter/SwipeViewGroup.java#L76-L83
2,122
wdullaer/SwipeActionAdapter
library/src/main/java/com/wdullaer/swipeactionadapter/SwipeViewGroup.java
SwipeViewGroup.showBackground
public void showBackground(SwipeDirection direction, boolean dimBackground){ if(SwipeDirection.DIRECTION_NEUTRAL != direction && mBackgroundMap.get(direction) == null) return; if(SwipeDirection.DIRECTION_NEUTRAL != visibleView) mBackgroundMap.get(visibleView).setVisibility(View.INVISIBLE); ...
java
public void showBackground(SwipeDirection direction, boolean dimBackground){ if(SwipeDirection.DIRECTION_NEUTRAL != direction && mBackgroundMap.get(direction) == null) return; if(SwipeDirection.DIRECTION_NEUTRAL != visibleView) mBackgroundMap.get(visibleView).setVisibility(View.INVISIBLE); ...
[ "public", "void", "showBackground", "(", "SwipeDirection", "direction", ",", "boolean", "dimBackground", ")", "{", "if", "(", "SwipeDirection", ".", "DIRECTION_NEUTRAL", "!=", "direction", "&&", "mBackgroundMap", ".", "get", "(", "direction", ")", "==", "null", ...
Show the View linked to a key. Don't do anything if the key is not found @param direction The key of the View to be shown @param dimBackground Indicates whether the background should be dimmed
[ "Show", "the", "View", "linked", "to", "a", "key", ".", "Don", "t", "do", "anything", "if", "the", "key", "is", "not", "found" ]
24a7e2ed953ac11ea0d8875d375bba571ffeba55
https://github.com/wdullaer/SwipeActionAdapter/blob/24a7e2ed953ac11ea0d8875d375bba571ffeba55/library/src/main/java/com/wdullaer/swipeactionadapter/SwipeViewGroup.java#L91-L102
2,123
wdullaer/SwipeActionAdapter
library/src/main/java/com/wdullaer/swipeactionadapter/SwipeViewGroup.java
SwipeViewGroup.setContentView
public SwipeViewGroup setContentView(View contentView){ if(this.contentView != null) removeView(contentView); addView(contentView); this.contentView = contentView; return this; }
java
public SwipeViewGroup setContentView(View contentView){ if(this.contentView != null) removeView(contentView); addView(contentView); this.contentView = contentView; return this; }
[ "public", "SwipeViewGroup", "setContentView", "(", "View", "contentView", ")", "{", "if", "(", "this", ".", "contentView", "!=", "null", ")", "removeView", "(", "contentView", ")", ";", "addView", "(", "contentView", ")", ";", "this", ".", "contentView", "="...
Add a contentView to the Layout @param contentView The View to be added @return A reference to the layout so commands can be chained
[ "Add", "a", "contentView", "to", "the", "Layout" ]
24a7e2ed953ac11ea0d8875d375bba571ffeba55
https://github.com/wdullaer/SwipeActionAdapter/blob/24a7e2ed953ac11ea0d8875d375bba571ffeba55/library/src/main/java/com/wdullaer/swipeactionadapter/SwipeViewGroup.java#L110-L116
2,124
wdullaer/SwipeActionAdapter
library/src/main/java/com/wdullaer/swipeactionadapter/SwipeViewGroup.java
SwipeViewGroup.translateBackgrounds
public void translateBackgrounds(){ this.setClipChildren(false); for(Map.Entry<SwipeDirection, View> entry : mBackgroundMap.entrySet()) { int signum = entry.getKey().isLeft() ? 1 : -1; entry.getValue().setTranslationX(signum*entry.getValue().getWidth()); } }
java
public void translateBackgrounds(){ this.setClipChildren(false); for(Map.Entry<SwipeDirection, View> entry : mBackgroundMap.entrySet()) { int signum = entry.getKey().isLeft() ? 1 : -1; entry.getValue().setTranslationX(signum*entry.getValue().getWidth()); } }
[ "public", "void", "translateBackgrounds", "(", ")", "{", "this", ".", "setClipChildren", "(", "false", ")", ";", "for", "(", "Map", ".", "Entry", "<", "SwipeDirection", ",", "View", ">", "entry", ":", "mBackgroundMap", ".", "entrySet", "(", ")", ")", "{"...
Move all backgrounds to the edge of the Layout so they can be swiped in
[ "Move", "all", "backgrounds", "to", "the", "edge", "of", "the", "Layout", "so", "they", "can", "be", "swiped", "in" ]
24a7e2ed953ac11ea0d8875d375bba571ffeba55
https://github.com/wdullaer/SwipeActionAdapter/blob/24a7e2ed953ac11ea0d8875d375bba571ffeba55/library/src/main/java/com/wdullaer/swipeactionadapter/SwipeViewGroup.java#L130-L136
2,125
wdullaer/SwipeActionAdapter
library/src/main/java/com/wdullaer/swipeactionadapter/SwipeActionAdapter.java
SwipeActionAdapter.onSwipeStarted
@Override public void onSwipeStarted(ListView listView, int position, SwipeDirection direction) { if(mSwipeActionListener != null) mSwipeActionListener.onSwipeStarted(listView, position, direction); }
java
@Override public void onSwipeStarted(ListView listView, int position, SwipeDirection direction) { if(mSwipeActionListener != null) mSwipeActionListener.onSwipeStarted(listView, position, direction); }
[ "@", "Override", "public", "void", "onSwipeStarted", "(", "ListView", "listView", ",", "int", "position", ",", "SwipeDirection", "direction", ")", "{", "if", "(", "mSwipeActionListener", "!=", "null", ")", "mSwipeActionListener", ".", "onSwipeStarted", "(", "listV...
Called once the user touches the screen and starts swiping in any direction @param listView The originating {@link ListView}. @param position The position to perform the action on, sorted in descending order for convenience. @param direction The type of swipe that triggered the action
[ "Called", "once", "the", "user", "touches", "the", "screen", "and", "starts", "swiping", "in", "any", "direction" ]
24a7e2ed953ac11ea0d8875d375bba571ffeba55
https://github.com/wdullaer/SwipeActionAdapter/blob/24a7e2ed953ac11ea0d8875d375bba571ffeba55/library/src/main/java/com/wdullaer/swipeactionadapter/SwipeActionAdapter.java#L118-L121
2,126
wdullaer/SwipeActionAdapter
library/src/main/java/com/wdullaer/swipeactionadapter/SwipeActionAdapter.java
SwipeActionAdapter.setFadeOut
@SuppressWarnings("unused") public SwipeActionAdapter setFadeOut(boolean mFadeOut){ this.mFadeOut = mFadeOut; if(mListView != null) mTouchListener.setFadeOut(mFadeOut); return this; }
java
@SuppressWarnings("unused") public SwipeActionAdapter setFadeOut(boolean mFadeOut){ this.mFadeOut = mFadeOut; if(mListView != null) mTouchListener.setFadeOut(mFadeOut); return this; }
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "public", "SwipeActionAdapter", "setFadeOut", "(", "boolean", "mFadeOut", ")", "{", "this", ".", "mFadeOut", "=", "mFadeOut", ";", "if", "(", "mListView", "!=", "null", ")", "mTouchListener", ".", "setFadeOut", ...
Set whether items should have a fadeOut animation @param mFadeOut true makes items fade out with a swipe (opacity to 0) @return A reference to the current instance so that commands can be chained
[ "Set", "whether", "items", "should", "have", "a", "fadeOut", "animation" ]
24a7e2ed953ac11ea0d8875d375bba571ffeba55
https://github.com/wdullaer/SwipeActionAdapter/blob/24a7e2ed953ac11ea0d8875d375bba571ffeba55/library/src/main/java/com/wdullaer/swipeactionadapter/SwipeActionAdapter.java#L142-L147
2,127
wdullaer/SwipeActionAdapter
library/src/main/java/com/wdullaer/swipeactionadapter/SwipeActionAdapter.java
SwipeActionAdapter.setFarSwipeFraction
@SuppressWarnings("unused") public SwipeActionAdapter setFarSwipeFraction(float farSwipeFraction) { if(farSwipeFraction < 0 || farSwipeFraction > 1) { throw new IllegalArgumentException("Must be a float between 0 and 1"); } this.mFarSwipeFraction = farSwipeFraction; if(mL...
java
@SuppressWarnings("unused") public SwipeActionAdapter setFarSwipeFraction(float farSwipeFraction) { if(farSwipeFraction < 0 || farSwipeFraction > 1) { throw new IllegalArgumentException("Must be a float between 0 and 1"); } this.mFarSwipeFraction = farSwipeFraction; if(mL...
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "public", "SwipeActionAdapter", "setFarSwipeFraction", "(", "float", "farSwipeFraction", ")", "{", "if", "(", "farSwipeFraction", "<", "0", "||", "farSwipeFraction", ">", "1", ")", "{", "throw", "new", "IllegalArgum...
Set the fraction of the View Width that needs to be swiped before it is counted as a far swipe @param farSwipeFraction float between 0 and 1
[ "Set", "the", "fraction", "of", "the", "View", "Width", "that", "needs", "to", "be", "swiped", "before", "it", "is", "counted", "as", "a", "far", "swipe" ]
24a7e2ed953ac11ea0d8875d375bba571ffeba55
https://github.com/wdullaer/SwipeActionAdapter/blob/24a7e2ed953ac11ea0d8875d375bba571ffeba55/library/src/main/java/com/wdullaer/swipeactionadapter/SwipeActionAdapter.java#L180-L188
2,128
wdullaer/SwipeActionAdapter
library/src/main/java/com/wdullaer/swipeactionadapter/SwipeActionAdapter.java
SwipeActionAdapter.setNormalSwipeFraction
@SuppressWarnings("unused") public SwipeActionAdapter setNormalSwipeFraction(float normalSwipeFraction) { if(normalSwipeFraction < 0 || normalSwipeFraction > 1) { throw new IllegalArgumentException("Must be a float between 0 and 1"); } this.mNormalSwipeFraction = normalSwipeFract...
java
@SuppressWarnings("unused") public SwipeActionAdapter setNormalSwipeFraction(float normalSwipeFraction) { if(normalSwipeFraction < 0 || normalSwipeFraction > 1) { throw new IllegalArgumentException("Must be a float between 0 and 1"); } this.mNormalSwipeFraction = normalSwipeFract...
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "public", "SwipeActionAdapter", "setNormalSwipeFraction", "(", "float", "normalSwipeFraction", ")", "{", "if", "(", "normalSwipeFraction", "<", "0", "||", "normalSwipeFraction", ">", "1", ")", "{", "throw", "new", "...
Set the fraction of the View Width that needs to be swiped before it is counted as a normal swipe @param normalSwipeFraction float between 0 and 1
[ "Set", "the", "fraction", "of", "the", "View", "Width", "that", "needs", "to", "be", "swiped", "before", "it", "is", "counted", "as", "a", "normal", "swipe" ]
24a7e2ed953ac11ea0d8875d375bba571ffeba55
https://github.com/wdullaer/SwipeActionAdapter/blob/24a7e2ed953ac11ea0d8875d375bba571ffeba55/library/src/main/java/com/wdullaer/swipeactionadapter/SwipeActionAdapter.java#L195-L203
2,129
wdullaer/SwipeActionAdapter
library/src/main/java/com/wdullaer/swipeactionadapter/SwipeActionAdapter.java
SwipeActionAdapter.setListView
public SwipeActionAdapter setListView(ListView listView){ this.mListView = listView; mTouchListener = new SwipeActionTouchListener(listView,this); this.mListView.setOnTouchListener(mTouchListener); this.mListView.setOnScrollListener(mTouchListener.makeScrollListener()); this.mLis...
java
public SwipeActionAdapter setListView(ListView listView){ this.mListView = listView; mTouchListener = new SwipeActionTouchListener(listView,this); this.mListView.setOnTouchListener(mTouchListener); this.mListView.setOnScrollListener(mTouchListener.makeScrollListener()); this.mLis...
[ "public", "SwipeActionAdapter", "setListView", "(", "ListView", "listView", ")", "{", "this", ".", "mListView", "=", "listView", ";", "mTouchListener", "=", "new", "SwipeActionTouchListener", "(", "listView", ",", "this", ")", ";", "this", ".", "mListView", ".",...
We need the ListView to be able to modify it's OnTouchListener @param listView the ListView to which the adapter will be attached @return A reference to the current instance so that commands can be chained
[ "We", "need", "the", "ListView", "to", "be", "able", "to", "modify", "it", "s", "OnTouchListener" ]
24a7e2ed953ac11ea0d8875d375bba571ffeba55
https://github.com/wdullaer/SwipeActionAdapter/blob/24a7e2ed953ac11ea0d8875d375bba571ffeba55/library/src/main/java/com/wdullaer/swipeactionadapter/SwipeActionAdapter.java#L211-L223
2,130
wdullaer/SwipeActionAdapter
library/src/main/java/com/wdullaer/swipeactionadapter/SwipeActionAdapter.java
SwipeActionAdapter.addBackground
public SwipeActionAdapter addBackground(SwipeDirection key, int resId){ if(SwipeDirection.getAllDirections().contains(key)) mBackgroundResIds.put(key,resId); return this; }
java
public SwipeActionAdapter addBackground(SwipeDirection key, int resId){ if(SwipeDirection.getAllDirections().contains(key)) mBackgroundResIds.put(key,resId); return this; }
[ "public", "SwipeActionAdapter", "addBackground", "(", "SwipeDirection", "key", ",", "int", "resId", ")", "{", "if", "(", "SwipeDirection", ".", "getAllDirections", "(", ")", ".", "contains", "(", "key", ")", ")", "mBackgroundResIds", ".", "put", "(", "key", ...
Add a background image for a certain callback. The key for the background must be one of the directions from the SwipeDirections class. @param key the identifier of the callback for which this resource should be shown @param resId the resource Id of the background to add @return A reference to the current instance so ...
[ "Add", "a", "background", "image", "for", "a", "certain", "callback", ".", "The", "key", "for", "the", "background", "must", "be", "one", "of", "the", "directions", "from", "the", "SwipeDirections", "class", "." ]
24a7e2ed953ac11ea0d8875d375bba571ffeba55
https://github.com/wdullaer/SwipeActionAdapter/blob/24a7e2ed953ac11ea0d8875d375bba571ffeba55/library/src/main/java/com/wdullaer/swipeactionadapter/SwipeActionAdapter.java#L243-L246
2,131
captain-miao/OptionRoundCardview
optroundcardview/src/main/java/com/github/captain_miao/optroundcardview/OptRoundCardView.java
OptRoundCardView.setShadowPadding
@Override public void setShadowPadding(int left, int top, int right, int bottom) { mShadowBounds.set(left, top, right, bottom); super.setPadding(left + mContentPadding.left, top + mContentPadding.top, right + mContentPadding.right, bottom + mContentPadding.bottom); }
java
@Override public void setShadowPadding(int left, int top, int right, int bottom) { mShadowBounds.set(left, top, right, bottom); super.setPadding(left + mContentPadding.left, top + mContentPadding.top, right + mContentPadding.right, bottom + mContentPadding.bottom); }
[ "@", "Override", "public", "void", "setShadowPadding", "(", "int", "left", ",", "int", "top", ",", "int", "right", ",", "int", "bottom", ")", "{", "mShadowBounds", ".", "set", "(", "left", ",", "top", ",", "right", ",", "bottom", ")", ";", "super", "...
Internal method used by CardView implementations to update the padding. @hide
[ "Internal", "method", "used", "by", "CardView", "implementations", "to", "update", "the", "padding", "." ]
aefad1e42351958724b916b8003a24f10634b3d8
https://github.com/captain-miao/OptionRoundCardview/blob/aefad1e42351958724b916b8003a24f10634b3d8/optroundcardview/src/main/java/com/github/captain_miao/optroundcardview/OptRoundCardView.java#L347-L352
2,132
captain-miao/OptionRoundCardview
optroundcardview/src/main/java/com/github/captain_miao/optroundcardview/OptRoundCardView.java
OptRoundCardView.showCorner
public void showCorner(boolean leftTop, boolean rightTop, boolean leftBottom, boolean rightBottom) { if (SDK_LOLLIPOP) { ((OptRoundRectDrawable) getBackground()).showCorner(leftTop, rightTop, leftBottom, rightBottom); } else { ((OptRoundRectDrawableWithShadow) getBackground()).sh...
java
public void showCorner(boolean leftTop, boolean rightTop, boolean leftBottom, boolean rightBottom) { if (SDK_LOLLIPOP) { ((OptRoundRectDrawable) getBackground()).showCorner(leftTop, rightTop, leftBottom, rightBottom); } else { ((OptRoundRectDrawableWithShadow) getBackground()).sh...
[ "public", "void", "showCorner", "(", "boolean", "leftTop", ",", "boolean", "rightTop", ",", "boolean", "leftBottom", ",", "boolean", "rightBottom", ")", "{", "if", "(", "SDK_LOLLIPOP", ")", "{", "(", "(", "OptRoundRectDrawable", ")", "getBackground", "(", ")",...
show corner or rect
[ "show", "corner", "or", "rect" ]
aefad1e42351958724b916b8003a24f10634b3d8
https://github.com/captain-miao/OptionRoundCardview/blob/aefad1e42351958724b916b8003a24f10634b3d8/optroundcardview/src/main/java/com/github/captain_miao/optroundcardview/OptRoundCardView.java#L441-L447
2,133
captain-miao/OptionRoundCardview
optroundcardview/src/main/java/com/github/captain_miao/optroundcardview/OptRoundCardView.java
OptRoundCardView.showEdgeShadow
public void showEdgeShadow(boolean left, boolean top, boolean right, boolean bottom) { if (SDK_LOLLIPOP) { //((OptRoundRectDrawable) getBackground()).showCorner(leftTop, rightTop, leftBottom, rightBottom); } else { ((OptRoundRectDrawableWithShadow) getBackground()).showEdgeShadow...
java
public void showEdgeShadow(boolean left, boolean top, boolean right, boolean bottom) { if (SDK_LOLLIPOP) { //((OptRoundRectDrawable) getBackground()).showCorner(leftTop, rightTop, leftBottom, rightBottom); } else { ((OptRoundRectDrawableWithShadow) getBackground()).showEdgeShadow...
[ "public", "void", "showEdgeShadow", "(", "boolean", "left", ",", "boolean", "top", ",", "boolean", "right", ",", "boolean", "bottom", ")", "{", "if", "(", "SDK_LOLLIPOP", ")", "{", "//((OptRoundRectDrawable) getBackground()).showCorner(leftTop, rightTop, leftBottom, right...
show Edge Shadow
[ "show", "Edge", "Shadow" ]
aefad1e42351958724b916b8003a24f10634b3d8
https://github.com/captain-miao/OptionRoundCardview/blob/aefad1e42351958724b916b8003a24f10634b3d8/optroundcardview/src/main/java/com/github/captain_miao/optroundcardview/OptRoundCardView.java#L484-L490
2,134
dmak/jaxb-xew-plugin
src/main/java/com/sun/tools/xjc/addon/xew/Candidate.java
Candidate.addObjectFactoryForClass
public boolean addObjectFactoryForClass(JDefinedClass clazz) { JDefinedClass valueObjectFactoryClass = clazz._package()._getClass(FACTORY_CLASS_NAME); if (objectFactoryClasses.containsKey(valueObjectFactoryClass.fullName())) { return false; } objectFactoryClasses.put(valueObjectFactoryClass.fullName...
java
public boolean addObjectFactoryForClass(JDefinedClass clazz) { JDefinedClass valueObjectFactoryClass = clazz._package()._getClass(FACTORY_CLASS_NAME); if (objectFactoryClasses.containsKey(valueObjectFactoryClass.fullName())) { return false; } objectFactoryClasses.put(valueObjectFactoryClass.fullName...
[ "public", "boolean", "addObjectFactoryForClass", "(", "JDefinedClass", "clazz", ")", "{", "JDefinedClass", "valueObjectFactoryClass", "=", "clazz", ".", "_package", "(", ")", ".", "_getClass", "(", "FACTORY_CLASS_NAME", ")", ";", "if", "(", "objectFactoryClasses", "...
For the given class locate and add Object Factory classes to the map. @return {@code true} if value class generation is enabled
[ "For", "the", "given", "class", "locate", "and", "add", "Object", "Factory", "classes", "to", "the", "map", "." ]
d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3
https://github.com/dmak/jaxb-xew-plugin/blob/d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3/src/main/java/com/sun/tools/xjc/addon/xew/Candidate.java#L201-L226
2,135
dmak/jaxb-xew-plugin
src/main/java/com/sun/tools/xjc/addon/xew/config/AbstractConfigurablePlugin.java
AbstractConfigurablePlugin.parseArgument
@Override public int parseArgument(Options opts, String[] args, int i) throws BadCommandLineException { initLoggerIfNecessary(opts); int recognized = 0; String arg = args[i]; logger.trace("Argument[" + i + "] = " + arg); if (arg.equals(getArgumentName(ConfigurationOption.APPLY_PLURAL_FORM.optionN...
java
@Override public int parseArgument(Options opts, String[] args, int i) throws BadCommandLineException { initLoggerIfNecessary(opts); int recognized = 0; String arg = args[i]; logger.trace("Argument[" + i + "] = " + arg); if (arg.equals(getArgumentName(ConfigurationOption.APPLY_PLURAL_FORM.optionN...
[ "@", "Override", "public", "int", "parseArgument", "(", "Options", "opts", ",", "String", "[", "]", "args", ",", "int", "i", ")", "throws", "BadCommandLineException", "{", "initLoggerIfNecessary", "(", "opts", ")", ";", "int", "recognized", "=", "0", ";", ...
Parse and apply plugin configuration options. @return number of consumed argument options
[ "Parse", "and", "apply", "plugin", "configuration", "options", "." ]
d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3
https://github.com/dmak/jaxb-xew-plugin/blob/d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3/src/main/java/com/sun/tools/xjc/addon/xew/config/AbstractConfigurablePlugin.java#L150-L174
2,136
dmak/jaxb-xew-plugin
src/main/java/com/sun/tools/xjc/addon/xew/config/AbstractConfigurablePlugin.java
AbstractConfigurablePlugin.run
@Override public boolean run(Outline outline, Options opt, ErrorHandler errorHandler) throws SAXException { try { runInternal(outline); return true; } catch (IOException e) { logger.error("Failed to read the file", e); throw new SAXException(e); } catch (ClassNotFoundException e) { ...
java
@Override public boolean run(Outline outline, Options opt, ErrorHandler errorHandler) throws SAXException { try { runInternal(outline); return true; } catch (IOException e) { logger.error("Failed to read the file", e); throw new SAXException(e); } catch (ClassNotFoundException e) { ...
[ "@", "Override", "public", "boolean", "run", "(", "Outline", "outline", ",", "Options", "opt", ",", "ErrorHandler", "errorHandler", ")", "throws", "SAXException", "{", "try", "{", "runInternal", "(", "outline", ")", ";", "return", "true", ";", "}", "catch", ...
Implements exception handling.
[ "Implements", "exception", "handling", "." ]
d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3
https://github.com/dmak/jaxb-xew-plugin/blob/d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3/src/main/java/com/sun/tools/xjc/addon/xew/config/AbstractConfigurablePlugin.java#L260-L275
2,137
dmak/jaxb-xew-plugin
src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java
CommonUtils.generableToString
public static final String generableToString(JGenerable generable) { // There is hardly any clean universal way to get the value from e.g. JExpression except of serializing it. // Compare JStringLiteral and JExp#dotclass(). Writer w = new StringWriter(); generable.generate(new JFormatter(w)); // FIXME: Hope...
java
public static final String generableToString(JGenerable generable) { // There is hardly any clean universal way to get the value from e.g. JExpression except of serializing it. // Compare JStringLiteral and JExp#dotclass(). Writer w = new StringWriter(); generable.generate(new JFormatter(w)); // FIXME: Hope...
[ "public", "static", "final", "String", "generableToString", "(", "JGenerable", "generable", ")", "{", "// There is hardly any clean universal way to get the value from e.g. JExpression except of serializing it.", "// Compare JStringLiteral and JExp#dotclass().", "Writer", "w", "=", "ne...
Returns the string value of passed argument.
[ "Returns", "the", "string", "value", "of", "passed", "argument", "." ]
d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3
https://github.com/dmak/jaxb-xew-plugin/blob/d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3/src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java#L159-L168
2,138
dmak/jaxb-xew-plugin
src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java
CommonUtils.getXsdDeclaration
public static XSDeclaration getXsdDeclaration(CPropertyInfo propertyInfo) { XSComponent schemaComponent = propertyInfo.getSchemaComponent(); if (!(schemaComponent instanceof XSParticle)) { // XSComplexType for example: return null; } XSTerm term = ((XSParticle) schemaComponent).getTerm(); if (!(term ...
java
public static XSDeclaration getXsdDeclaration(CPropertyInfo propertyInfo) { XSComponent schemaComponent = propertyInfo.getSchemaComponent(); if (!(schemaComponent instanceof XSParticle)) { // XSComplexType for example: return null; } XSTerm term = ((XSParticle) schemaComponent).getTerm(); if (!(term ...
[ "public", "static", "XSDeclaration", "getXsdDeclaration", "(", "CPropertyInfo", "propertyInfo", ")", "{", "XSComponent", "schemaComponent", "=", "propertyInfo", ".", "getSchemaComponent", "(", ")", ";", "if", "(", "!", "(", "schemaComponent", "instanceof", "XSParticle...
Returns XSD declaration of given property.
[ "Returns", "XSD", "declaration", "of", "given", "property", "." ]
d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3
https://github.com/dmak/jaxb-xew-plugin/blob/d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3/src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java#L241-L257
2,139
dmak/jaxb-xew-plugin
src/main/java/com/sun/tools/xjc/addon/xew/config/GlobalConfiguration.java
GlobalConfiguration.readControlFile
void readControlFile(String fileName) throws IOException { BufferedReader reader = new BufferedReader(new FileReader(fileName)); try { controlList.clear(); String line; while ((line = reader.readLine()) != null) { line = line.trim(); if (line.isEmpty() || line.startsWith("#")) { co...
java
void readControlFile(String fileName) throws IOException { BufferedReader reader = new BufferedReader(new FileReader(fileName)); try { controlList.clear(); String line; while ((line = reader.readLine()) != null) { line = line.trim(); if (line.isEmpty() || line.startsWith("#")) { co...
[ "void", "readControlFile", "(", "String", "fileName", ")", "throws", "IOException", "{", "BufferedReader", "reader", "=", "new", "BufferedReader", "(", "new", "FileReader", "(", "fileName", ")", ")", ";", "try", "{", "controlList", ".", "clear", "(", ")", ";...
Parse the given control file and initialize this config appropriately.
[ "Parse", "the", "given", "control", "file", "and", "initialize", "this", "config", "appropriately", "." ]
d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3
https://github.com/dmak/jaxb-xew-plugin/blob/d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3/src/main/java/com/sun/tools/xjc/addon/xew/config/GlobalConfiguration.java#L43-L84
2,140
dmak/jaxb-xew-plugin
src/main/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPlugin.java
XmlElementWrapperPlugin.createScopedFactoryMethods
private int createScopedFactoryMethods(JCodeModel codeModel, JDefinedClass factoryClass, Collection<ScopedElementInfo> scopedElementInfos, JDefinedClass targetClass, JClass xmlElementDeclModelClass, JClass jaxbElementModelClass, JClass qNameModelClass) { int createdMethods = 0; NEXT: for ...
java
private int createScopedFactoryMethods(JCodeModel codeModel, JDefinedClass factoryClass, Collection<ScopedElementInfo> scopedElementInfos, JDefinedClass targetClass, JClass xmlElementDeclModelClass, JClass jaxbElementModelClass, JClass qNameModelClass) { int createdMethods = 0; NEXT: for ...
[ "private", "int", "createScopedFactoryMethods", "(", "JCodeModel", "codeModel", ",", "JDefinedClass", "factoryClass", ",", "Collection", "<", "ScopedElementInfo", ">", "scopedElementInfos", ",", "JDefinedClass", "targetClass", ",", "JClass", "xmlElementDeclModelClass", ",",...
Create additional factory methods with a new scope for elements that should be scoped. @param targetClass the class that is applied the transformation of properties @param jaxbElementModelClass TODO @param qNameModelClass TODO @return number of created methods @see com.sun.tools.xjc.generator.bean.ObjectFactoryGenerat...
[ "Create", "additional", "factory", "methods", "with", "a", "new", "scope", "for", "elements", "that", "should", "be", "scoped", "." ]
d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3
https://github.com/dmak/jaxb-xew-plugin/blob/d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3/src/main/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPlugin.java#L584-L651
2,141
dmak/jaxb-xew-plugin
src/main/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPlugin.java
XmlElementWrapperPlugin.deleteClass
private void deleteClass(Outline outline, JDefinedClass clazz) { if (clazz.parentContainer().isClass()) { // The candidate class is an inner class. Remove the class from its parent class. JDefinedClass parentClass = (JDefinedClass) clazz.parentContainer(); writeSummary("\tRemoving class " + clazz.fullName()...
java
private void deleteClass(Outline outline, JDefinedClass clazz) { if (clazz.parentContainer().isClass()) { // The candidate class is an inner class. Remove the class from its parent class. JDefinedClass parentClass = (JDefinedClass) clazz.parentContainer(); writeSummary("\tRemoving class " + clazz.fullName()...
[ "private", "void", "deleteClass", "(", "Outline", "outline", ",", "JDefinedClass", "clazz", ")", "{", "if", "(", "clazz", ".", "parentContainer", "(", ")", ".", "isClass", "(", ")", ")", "{", "// The candidate class is an inner class. Remove the class from its parent ...
Remove the given class from it's parent class or package it is defined in.
[ "Remove", "the", "given", "class", "from", "it", "s", "parent", "class", "or", "package", "it", "is", "defined", "in", "." ]
d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3
https://github.com/dmak/jaxb-xew-plugin/blob/d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3/src/main/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPlugin.java#L928-L962
2,142
ingwarsw/arquillian-suite-extension
src/main/java/org/eu/ingwar/tools/arquillian/extension/deployment/EarDescriptorBuilder.java
EarDescriptorBuilder.render
public String render() { try { DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = docFactory.newDocumentBuilder(); // root elements doc = docBuilder.newDocument(); rootElement = doc.createElement("ap...
java
public String render() { try { DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = docFactory.newDocumentBuilder(); // root elements doc = docBuilder.newDocument(); rootElement = doc.createElement("ap...
[ "public", "String", "render", "(", ")", "{", "try", "{", "DocumentBuilderFactory", "docFactory", "=", "DocumentBuilderFactory", ".", "newInstance", "(", ")", ";", "DocumentBuilder", "docBuilder", "=", "docFactory", ".", "newDocumentBuilder", "(", ")", ";", "// roo...
Renders application.xml filr for application. @return aplication.xml as string
[ "Renders", "application", ".", "xml", "filr", "for", "application", "." ]
93c9e542ead1d52f45e87b0632bb02ac11f693c8
https://github.com/ingwarsw/arquillian-suite-extension/blob/93c9e542ead1d52f45e87b0632bb02ac11f693c8/src/main/java/org/eu/ingwar/tools/arquillian/extension/deployment/EarDescriptorBuilder.java#L132-L183
2,143
ingwarsw/arquillian-suite-extension
src/main/java/org/eu/ingwar/tools/arquillian/extension/suite/DeploymentClassFinder.java
DeploymentClassFinder.getDeploymentClass
static Class<?> getDeploymentClass(ArquillianDescriptor descriptor) { Class<?> deploymentClass = getDeploymentClassFromConfig(descriptor); if (deploymentClass == null) { deploymentClass = getDeploymentClassFromAnnotation(); } if (deploymentClass == null) { log.war...
java
static Class<?> getDeploymentClass(ArquillianDescriptor descriptor) { Class<?> deploymentClass = getDeploymentClassFromConfig(descriptor); if (deploymentClass == null) { deploymentClass = getDeploymentClassFromAnnotation(); } if (deploymentClass == null) { log.war...
[ "static", "Class", "<", "?", ">", "getDeploymentClass", "(", "ArquillianDescriptor", "descriptor", ")", "{", "Class", "<", "?", ">", "deploymentClass", "=", "getDeploymentClassFromConfig", "(", "descriptor", ")", ";", "if", "(", "deploymentClass", "==", "null", ...
Finds class to be used as global deployment. @param descriptor ArquillianDescriptor @return class to be used as global deployment.
[ "Finds", "class", "to", "be", "used", "as", "global", "deployment", "." ]
93c9e542ead1d52f45e87b0632bb02ac11f693c8
https://github.com/ingwarsw/arquillian-suite-extension/blob/93c9e542ead1d52f45e87b0632bb02ac11f693c8/src/main/java/org/eu/ingwar/tools/arquillian/extension/suite/DeploymentClassFinder.java#L43-L52
2,144
ingwarsw/arquillian-suite-extension
src/main/java/org/eu/ingwar/tools/arquillian/extension/suite/SuiteDeployer.java
SuiteDeployer.startup
public void startup(@Observes(precedence = -100) final BeforeSuite event) { if (extensionEnabled()) { debug("Catching BeforeSuite event {0}", event.toString()); executeInClassScope(new Callable<Void>() { @Override public Void call() { g...
java
public void startup(@Observes(precedence = -100) final BeforeSuite event) { if (extensionEnabled()) { debug("Catching BeforeSuite event {0}", event.toString()); executeInClassScope(new Callable<Void>() { @Override public Void call() { g...
[ "public", "void", "startup", "(", "@", "Observes", "(", "precedence", "=", "-", "100", ")", "final", "BeforeSuite", "event", ")", "{", "if", "(", "extensionEnabled", "(", ")", ")", "{", "debug", "(", "\"Catching BeforeSuite event {0}\"", ",", "event", ".", ...
Startup event. @param event AfterStart event to catch
[ "Startup", "event", "." ]
93c9e542ead1d52f45e87b0632bb02ac11f693c8
https://github.com/ingwarsw/arquillian-suite-extension/blob/93c9e542ead1d52f45e87b0632bb02ac11f693c8/src/main/java/org/eu/ingwar/tools/arquillian/extension/suite/SuiteDeployer.java#L147-L162
2,145
ingwarsw/arquillian-suite-extension
src/main/java/org/eu/ingwar/tools/arquillian/extension/suite/SuiteDeployer.java
SuiteDeployer.undeploy
public void undeploy(@Observes final BeforeStop event) { if (extensionEnabled()) { debug("Catching BeforeStop event {0}", event.toString()); undeployDeployments = true; undeployEvent.fire(new UnDeployManagedDeployments()); } }
java
public void undeploy(@Observes final BeforeStop event) { if (extensionEnabled()) { debug("Catching BeforeStop event {0}", event.toString()); undeployDeployments = true; undeployEvent.fire(new UnDeployManagedDeployments()); } }
[ "public", "void", "undeploy", "(", "@", "Observes", "final", "BeforeStop", "event", ")", "{", "if", "(", "extensionEnabled", "(", ")", ")", "{", "debug", "(", "\"Catching BeforeStop event {0}\"", ",", "event", ".", "toString", "(", ")", ")", ";", "undeployDe...
Undeploy event. @param event event to observe
[ "Undeploy", "event", "." ]
93c9e542ead1d52f45e87b0632bb02ac11f693c8
https://github.com/ingwarsw/arquillian-suite-extension/blob/93c9e542ead1d52f45e87b0632bb02ac11f693c8/src/main/java/org/eu/ingwar/tools/arquillian/extension/suite/SuiteDeployer.java#L169-L175
2,146
ingwarsw/arquillian-suite-extension
src/main/java/org/eu/ingwar/tools/arquillian/extension/suite/SuiteDeployer.java
SuiteDeployer.executeInClassScope
private void executeInClassScope(Callable<Void> call) { try { classContext.get().activate(deploymentClass); call.call(); } catch (Exception e) { throw new RuntimeException("Could not invoke operation", e); // NOPMD } finally { classContext.get().de...
java
private void executeInClassScope(Callable<Void> call) { try { classContext.get().activate(deploymentClass); call.call(); } catch (Exception e) { throw new RuntimeException("Could not invoke operation", e); // NOPMD } finally { classContext.get().de...
[ "private", "void", "executeInClassScope", "(", "Callable", "<", "Void", ">", "call", ")", "{", "try", "{", "classContext", ".", "get", "(", ")", ".", "activate", "(", "deploymentClass", ")", ";", "call", ".", "call", "(", ")", ";", "}", "catch", "(", ...
Calls operation in deployment class scope. @param call Callable to call
[ "Calls", "operation", "in", "deployment", "class", "scope", "." ]
93c9e542ead1d52f45e87b0632bb02ac11f693c8
https://github.com/ingwarsw/arquillian-suite-extension/blob/93c9e542ead1d52f45e87b0632bb02ac11f693c8/src/main/java/org/eu/ingwar/tools/arquillian/extension/suite/SuiteDeployer.java#L182-L191
2,147
ingwarsw/arquillian-suite-extension
src/main/java/org/eu/ingwar/tools/arquillian/extension/suite/SuiteDeployer.java
SuiteDeployer.debug
private void debug(String format, Object... message) { Boolean DEBUG = Boolean.valueOf(System.getProperty("arquillian.debug")); if (DEBUG) { log.log(Level.WARNING, format, message); } }
java
private void debug(String format, Object... message) { Boolean DEBUG = Boolean.valueOf(System.getProperty("arquillian.debug")); if (DEBUG) { log.log(Level.WARNING, format, message); } }
[ "private", "void", "debug", "(", "String", "format", ",", "Object", "...", "message", ")", "{", "Boolean", "DEBUG", "=", "Boolean", ".", "valueOf", "(", "System", ".", "getProperty", "(", "\"arquillian.debug\"", ")", ")", ";", "if", "(", "DEBUG", ")", "{...
Prints debug message. If arquillian.debug flag is set. @param format format of message @param message message objects to format
[ "Prints", "debug", "message", "." ]
93c9e542ead1d52f45e87b0632bb02ac11f693c8
https://github.com/ingwarsw/arquillian-suite-extension/blob/93c9e542ead1d52f45e87b0632bb02ac11f693c8/src/main/java/org/eu/ingwar/tools/arquillian/extension/suite/SuiteDeployer.java#L201-L206
2,148
gkopff/gson-javatime-serialisers
src/main/java/com/fatboyindustrial/gsonjavatime/Converters.java
Converters.registerAll
public static GsonBuilder registerAll(GsonBuilder builder) { if (builder == null) { throw new NullPointerException("builder cannot be null"); } registerLocalDate(builder); registerLocalDateTime(builder); registerLocalTime(builder); registerOffsetDateTime(builder); registerOffsetTime(builder);...
java
public static GsonBuilder registerAll(GsonBuilder builder) { if (builder == null) { throw new NullPointerException("builder cannot be null"); } registerLocalDate(builder); registerLocalDateTime(builder); registerLocalTime(builder); registerOffsetDateTime(builder); registerOffsetTime(builder);...
[ "public", "static", "GsonBuilder", "registerAll", "(", "GsonBuilder", "builder", ")", "{", "if", "(", "builder", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"builder cannot be null\"", ")", ";", "}", "registerLocalDate", "(", "builder", ...
Registers all the Java Time converters. @param builder The GSON builder to register the converters with. @return A reference to {@code builder}.
[ "Registers", "all", "the", "Java", "Time", "converters", "." ]
273d706fa32df31821177375d837b83151cfc67e
https://github.com/gkopff/gson-javatime-serialisers/blob/273d706fa32df31821177375d837b83151cfc67e/src/main/java/com/fatboyindustrial/gsonjavatime/Converters.java#L70-L83
2,149
ReactiveX/RxJavaReactiveStreams
rxjava-reactive-streams/src/main/java/rx/RxReactiveStreams.java
RxReactiveStreams.toPublisher
public static <T> Publisher<T> toPublisher(Completable completable) { if (completable == null) { throw new NullPointerException("completable"); } return new CompletableAsPublisher<T>(completable); }
java
public static <T> Publisher<T> toPublisher(Completable completable) { if (completable == null) { throw new NullPointerException("completable"); } return new CompletableAsPublisher<T>(completable); }
[ "public", "static", "<", "T", ">", "Publisher", "<", "T", ">", "toPublisher", "(", "Completable", "completable", ")", "{", "if", "(", "completable", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"completable\"", ")", ";", "}", "ret...
Converts an RxJava Completable into a Publisher that emits only onError or onComplete. @param <T> the target value type @param completable the Completable instance to convert @return the new Publisher instance @since 1.1 @throws NullPointerException if completable is null
[ "Converts", "an", "RxJava", "Completable", "into", "a", "Publisher", "that", "emits", "only", "onError", "or", "onComplete", "." ]
1c6a64de2c9f5c8bd6c798bd1f53513d214aea30
https://github.com/ReactiveX/RxJavaReactiveStreams/blob/1c6a64de2c9f5c8bd6c798bd1f53513d214aea30/rxjava-reactive-streams/src/main/java/rx/RxReactiveStreams.java#L84-L89
2,150
ReactiveX/RxJavaReactiveStreams
rxjava-reactive-streams/src/main/java/rx/RxReactiveStreams.java
RxReactiveStreams.toCompletable
public static Completable toCompletable(Publisher<?> publisher) { if (publisher == null) { throw new NullPointerException("publisher"); } return Completable.create(new PublisherAsCompletable(publisher)); }
java
public static Completable toCompletable(Publisher<?> publisher) { if (publisher == null) { throw new NullPointerException("publisher"); } return Completable.create(new PublisherAsCompletable(publisher)); }
[ "public", "static", "Completable", "toCompletable", "(", "Publisher", "<", "?", ">", "publisher", ")", "{", "if", "(", "publisher", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"publisher\"", ")", ";", "}", "return", "Completable", ...
Converst a Publisher into a Completable by ignoring all onNext values and emitting onError or onComplete only. @param publisher the Publisher instance to convert @return the Completable instance @since 1.1 @throws NullPointerException if publisher is null
[ "Converst", "a", "Publisher", "into", "a", "Completable", "by", "ignoring", "all", "onNext", "values", "and", "emitting", "onError", "or", "onComplete", "only", "." ]
1c6a64de2c9f5c8bd6c798bd1f53513d214aea30
https://github.com/ReactiveX/RxJavaReactiveStreams/blob/1c6a64de2c9f5c8bd6c798bd1f53513d214aea30/rxjava-reactive-streams/src/main/java/rx/RxReactiveStreams.java#L99-L104
2,151
hudomju/android-swipe-to-dismiss-undo
library/src/main/java/com/hudomju/swipe/SwipeToDismissTouchListener.java
SwipeToDismissTouchListener.undoPendingDismiss
public boolean undoPendingDismiss() { boolean existPendingDismisses = existPendingDismisses(); if (existPendingDismisses) { mPendingDismiss.rowContainer.undoContainer.setVisibility(View.GONE); mPendingDismiss.rowContainer.dataContainer .animate() ...
java
public boolean undoPendingDismiss() { boolean existPendingDismisses = existPendingDismisses(); if (existPendingDismisses) { mPendingDismiss.rowContainer.undoContainer.setVisibility(View.GONE); mPendingDismiss.rowContainer.dataContainer .animate() ...
[ "public", "boolean", "undoPendingDismiss", "(", ")", "{", "boolean", "existPendingDismisses", "=", "existPendingDismisses", "(", ")", ";", "if", "(", "existPendingDismisses", ")", "{", "mPendingDismiss", ".", "rowContainer", ".", "undoContainer", ".", "setVisibility",...
If a view was dismissed and the undo container is showing it will undo and make the data container reappear. @return whether there were any pending rows to be dismissed.
[ "If", "a", "view", "was", "dismissed", "and", "the", "undo", "container", "is", "showing", "it", "will", "undo", "and", "make", "the", "data", "container", "reappear", "." ]
e9995ec797d77de9986a7d184a4c0a2a814612e1
https://github.com/hudomju/android-swipe-to-dismiss-undo/blob/e9995ec797d77de9986a7d184a4c0a2a814612e1/library/src/main/java/com/hudomju/swipe/SwipeToDismissTouchListener.java#L450-L463
2,152
mklemm/jaxb2-rich-contract-plugin
src/main/java/com/kscs/util/plugins/xjc/GroupInterfacePlugin.java
GroupInterfacePlugin.generateDummyGroupUsages
private void generateDummyGroupUsages(final Options opts) throws BadCommandLineException { try { final Transformer transformer = GroupInterfacePlugin.TRANSFORMER_FACTORY.newTransformer(); final XPath xPath = GroupInterfacePlugin.X_PATH_FACTORY.newXPath(); final MappingNamespaceContext namespaceContext = new ...
java
private void generateDummyGroupUsages(final Options opts) throws BadCommandLineException { try { final Transformer transformer = GroupInterfacePlugin.TRANSFORMER_FACTORY.newTransformer(); final XPath xPath = GroupInterfacePlugin.X_PATH_FACTORY.newXPath(); final MappingNamespaceContext namespaceContext = new ...
[ "private", "void", "generateDummyGroupUsages", "(", "final", "Options", "opts", ")", "throws", "BadCommandLineException", "{", "try", "{", "final", "Transformer", "transformer", "=", "GroupInterfacePlugin", ".", "TRANSFORMER_FACTORY", ".", "newTransformer", "(", ")", ...
Generates dummy complexTypes that implement the interface generated from group decls. These complexTypes will be transformed into classes by the default code generator. Later, this plugin will transform the classes into interface declarations. This approach avoids tedious re-implementation of the property generation co...
[ "Generates", "dummy", "complexTypes", "that", "implement", "the", "interface", "generated", "from", "group", "decls", ".", "These", "complexTypes", "will", "be", "transformed", "into", "classes", "by", "the", "default", "code", "generator", ".", "Later", "this", ...
359d20abcc4913a598f6d8df3dd2c4078a11c731
https://github.com/mklemm/jaxb2-rich-contract-plugin/blob/359d20abcc4913a598f6d8df3dd2c4078a11c731/src/main/java/com/kscs/util/plugins/xjc/GroupInterfacePlugin.java#L179-L220
2,153
cketti/EmailIntentBuilder
library/src/main/java/de/cketti/mailto/EmailIntentBuilder.java
EmailIntentBuilder.start
public boolean start() { Intent emailIntent = build(); try { startActivity(emailIntent); } catch (ActivityNotFoundException e) { return false; } return true; }
java
public boolean start() { Intent emailIntent = build(); try { startActivity(emailIntent); } catch (ActivityNotFoundException e) { return false; } return true; }
[ "public", "boolean", "start", "(", ")", "{", "Intent", "emailIntent", "=", "build", "(", ")", ";", "try", "{", "startActivity", "(", "emailIntent", ")", ";", "}", "catch", "(", "ActivityNotFoundException", "e", ")", "{", "return", "false", ";", "}", "ret...
Launch the email intent. @return {@code false} if no activity to handle the email intent could be found; {@code true} otherwise
[ "Launch", "the", "email", "intent", "." ]
81660eebd415a1a8f16824cba2d37f019034223e
https://github.com/cketti/EmailIntentBuilder/blob/81660eebd415a1a8f16824cba2d37f019034223e/library/src/main/java/de/cketti/mailto/EmailIntentBuilder.java#L220-L229
2,154
benjamin-bader/droptools
dropwizard-jooq/src/main/java/com/bendb/dropwizard/jooq/PostgresSupport.java
PostgresSupport.stringAgg
@Support({SQLDialect.POSTGRES}) public static Field<String> stringAgg(Field<String> field, String delimiter) { return DSL.field("string_agg({0}, {1})", field.getDataType(), field, DSL.val(delimiter)); }
java
@Support({SQLDialect.POSTGRES}) public static Field<String> stringAgg(Field<String> field, String delimiter) { return DSL.field("string_agg({0}, {1})", field.getDataType(), field, DSL.val(delimiter)); }
[ "@", "Support", "(", "{", "SQLDialect", ".", "POSTGRES", "}", ")", "public", "static", "Field", "<", "String", ">", "stringAgg", "(", "Field", "<", "String", ">", "field", ",", "String", "delimiter", ")", "{", "return", "DSL", ".", "field", "(", "\"str...
Joins a set of string values using the given delimiter. @param field the field to be concatenated @param delimiter the separating delimiter @return a {@link Field} representing the joined string
[ "Joins", "a", "set", "of", "string", "values", "using", "the", "given", "delimiter", "." ]
f1964465d725dfb07a5b6eb16f7bbe794896d1e0
https://github.com/benjamin-bader/droptools/blob/f1964465d725dfb07a5b6eb16f7bbe794896d1e0/dropwizard-jooq/src/main/java/com/bendb/dropwizard/jooq/PostgresSupport.java#L53-L56
2,155
kamon-io/sigar-loader
core/src/main/java/kamon/sigar/SigarAgent.java
SigarAgent.configure
public static synchronized void configure(final String options, final Instrumentation instrumentation) throws Exception { if (SigarAgent.instrumentation != null) { logger.severe("Duplicate agent setup attempt."); return; } SigarAgent.options = options; SigarAgent.instrumentation = instrumentation; ...
java
public static synchronized void configure(final String options, final Instrumentation instrumentation) throws Exception { if (SigarAgent.instrumentation != null) { logger.severe("Duplicate agent setup attempt."); return; } SigarAgent.options = options; SigarAgent.instrumentation = instrumentation; ...
[ "public", "static", "synchronized", "void", "configure", "(", "final", "String", "options", ",", "final", "Instrumentation", "instrumentation", ")", "throws", "Exception", "{", "if", "(", "SigarAgent", ".", "instrumentation", "!=", "null", ")", "{", "logger", "....
Agent mode configuration. @param options Agent command line options. @param instrumentation Injected JVM instrumentation instance. @throws Exception the exception
[ "Agent", "mode", "configuration", "." ]
83146fe9fd7581dea469b561a0226038af568477
https://github.com/kamon-io/sigar-loader/blob/83146fe9fd7581dea469b561a0226038af568477/core/src/main/java/kamon/sigar/SigarAgent.java#L85-L102
2,156
kamon-io/sigar-loader
core/src/main/java/kamon/sigar/SigarProvisioner.java
SigarProvisioner.isNativeLoaded
public static synchronized boolean isNativeLoaded() { try { return isSigarAlreadyLoaded(); } catch (final Throwable e) { try { final Sigar sigar = new Sigar(); sigar.getPid(); sigar.close(); return true; ...
java
public static synchronized boolean isNativeLoaded() { try { return isSigarAlreadyLoaded(); } catch (final Throwable e) { try { final Sigar sigar = new Sigar(); sigar.getPid(); sigar.close(); return true; ...
[ "public", "static", "synchronized", "boolean", "isNativeLoaded", "(", ")", "{", "try", "{", "return", "isSigarAlreadyLoaded", "(", ")", ";", "}", "catch", "(", "final", "Throwable", "e", ")", "{", "try", "{", "final", "Sigar", "sigar", "=", "new", "Sigar",...
Verify if sigar native library is loaded and operational. @return true, if is native library loaded.
[ "Verify", "if", "sigar", "native", "library", "is", "loaded", "and", "operational", "." ]
83146fe9fd7581dea469b561a0226038af568477
https://github.com/kamon-io/sigar-loader/blob/83146fe9fd7581dea469b561a0226038af568477/core/src/main/java/kamon/sigar/SigarProvisioner.java#L113-L126
2,157
kamon-io/sigar-loader
core/src/main/java/kamon/sigar/SigarProvisioner.java
SigarProvisioner.provision
public static synchronized void provision(final File folder) throws Exception { if (isNativeLoaded()) { logger.warning("Sigar library is already provisioned."); return; } if (!folder.exists()) { folder.mkdirs(); } final SigarLoader sigarLoader = new SigarLoader(Sigar.class); /** Library name...
java
public static synchronized void provision(final File folder) throws Exception { if (isNativeLoaded()) { logger.warning("Sigar library is already provisioned."); return; } if (!folder.exists()) { folder.mkdirs(); } final SigarLoader sigarLoader = new SigarLoader(Sigar.class); /** Library name...
[ "public", "static", "synchronized", "void", "provision", "(", "final", "File", "folder", ")", "throws", "Exception", "{", "if", "(", "isNativeLoaded", "(", ")", ")", "{", "logger", ".", "warning", "(", "\"Sigar library is already provisioned.\"", ")", ";", "retu...
Extract and load native sigar library in the provided folder. @param folder Library extraction folder. @throws Exception The provisioning failure exception.
[ "Extract", "and", "load", "native", "sigar", "library", "in", "the", "provided", "folder", "." ]
83146fe9fd7581dea469b561a0226038af568477
https://github.com/kamon-io/sigar-loader/blob/83146fe9fd7581dea469b561a0226038af568477/core/src/main/java/kamon/sigar/SigarProvisioner.java#L146-L187
2,158
kamon-io/sigar-loader
core/src/main/java/kamon/sigar/SigarProvisioner.java
SigarProvisioner.transfer
public static void transfer(final InputStream input, final OutputStream output) throws Exception { final byte[] data = new byte[SIZE]; while (true) { final int count = input.read(data, 0, SIZE); if (count == EOF) { break; } output.write(data, 0, count); } }
java
public static void transfer(final InputStream input, final OutputStream output) throws Exception { final byte[] data = new byte[SIZE]; while (true) { final int count = input.read(data, 0, SIZE); if (count == EOF) { break; } output.write(data, 0, count); } }
[ "public", "static", "void", "transfer", "(", "final", "InputStream", "input", ",", "final", "OutputStream", "output", ")", "throws", "Exception", "{", "final", "byte", "[", "]", "data", "=", "new", "byte", "[", "SIZE", "]", ";", "while", "(", "true", ")"...
Perform stream copy. @param input The input stream. @param output The output stream. @throws Exception The stream copy failure exception.
[ "Perform", "stream", "copy", "." ]
83146fe9fd7581dea469b561a0226038af568477
https://github.com/kamon-io/sigar-loader/blob/83146fe9fd7581dea469b561a0226038af568477/core/src/main/java/kamon/sigar/SigarProvisioner.java#L205-L215
2,159
kefirfromperm/kefirbb
src/org/kefirsf/bb/conf/Code.java
Code.addPattern
public void addPattern(Pattern pattern) { if (patterns == null) { patterns = new ArrayList<Pattern>(); } patterns.add(pattern); }
java
public void addPattern(Pattern pattern) { if (patterns == null) { patterns = new ArrayList<Pattern>(); } patterns.add(pattern); }
[ "public", "void", "addPattern", "(", "Pattern", "pattern", ")", "{", "if", "(", "patterns", "==", "null", ")", "{", "patterns", "=", "new", "ArrayList", "<", "Pattern", ">", "(", ")", ";", "}", "patterns", ".", "add", "(", "pattern", ")", ";", "}" ]
Add a pattern to the list of patterns. @param pattern a pattern
[ "Add", "a", "pattern", "to", "the", "list", "of", "patterns", "." ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/conf/Code.java#L128-L134
2,160
kefirfromperm/kefirbb
src/org/kefirsf/bb/conf/Code.java
Code.getPattern
@Deprecated public Pattern getPattern() { if (patterns != null && !patterns.isEmpty()) { return patterns.get(0); } else { return null; } }
java
@Deprecated public Pattern getPattern() { if (patterns != null && !patterns.isEmpty()) { return patterns.get(0); } else { return null; } }
[ "@", "Deprecated", "public", "Pattern", "getPattern", "(", ")", "{", "if", "(", "patterns", "!=", "null", "&&", "!", "patterns", ".", "isEmpty", "(", ")", ")", "{", "return", "patterns", ".", "get", "(", "0", ")", ";", "}", "else", "{", "return", "...
Get pattern for text parsing @return pattern definition object
[ "Get", "pattern", "for", "text", "parsing" ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/conf/Code.java#L150-L157
2,161
kefirfromperm/kefirbb
src/org/kefirsf/bb/conf/Code.java
Code.setPattern
@Deprecated public void setPattern(Pattern pattern) { patterns = new ArrayList<Pattern>(1); patterns.add(pattern); }
java
@Deprecated public void setPattern(Pattern pattern) { patterns = new ArrayList<Pattern>(1); patterns.add(pattern); }
[ "@", "Deprecated", "public", "void", "setPattern", "(", "Pattern", "pattern", ")", "{", "patterns", "=", "new", "ArrayList", "<", "Pattern", ">", "(", "1", ")", ";", "patterns", ".", "add", "(", "pattern", ")", ";", "}" ]
Set pattern for text parsing @param pattern pattern definition object
[ "Set", "pattern", "for", "text", "parsing" ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/conf/Code.java#L164-L168
2,162
kefirfromperm/kefirbb
src/org/kefirsf/bb/proc/ProcBol.java
ProcBol.findIn
public int findIn(Source source) { if (source.hasNext()) { // maybe we are on the beginning of line already? if (onBol(source)) { return source.getOffset(); } // If no find next line break int index = findLineBreak(source); ...
java
public int findIn(Source source) { if (source.hasNext()) { // maybe we are on the beginning of line already? if (onBol(source)) { return source.getOffset(); } // If no find next line break int index = findLineBreak(source); ...
[ "public", "int", "findIn", "(", "Source", "source", ")", "{", "if", "(", "source", ".", "hasNext", "(", ")", ")", "{", "// maybe we are on the beginning of line already?", "if", "(", "onBol", "(", "source", ")", ")", "{", "return", "source", ".", "getOffset"...
I strongly don't recommend to use tag bol as a terminator.
[ "I", "strongly", "don", "t", "recommend", "to", "use", "tag", "bol", "as", "a", "terminator", "." ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/proc/ProcBol.java#L21-L47
2,163
kefirfromperm/kefirbb
src/org/kefirsf/bb/proc/ProcBol.java
ProcBol.onBol
private boolean onBol(Source source) { int offset = source.getOffset(); if (offset == 0) { return true; } else { char c = source.charAt(offset); char p = source.charAt(offset - 1); return c != '\n' && c != '\r' && (p == '\n' || p == '\r'); ...
java
private boolean onBol(Source source) { int offset = source.getOffset(); if (offset == 0) { return true; } else { char c = source.charAt(offset); char p = source.charAt(offset - 1); return c != '\n' && c != '\r' && (p == '\n' || p == '\r'); ...
[ "private", "boolean", "onBol", "(", "Source", "source", ")", "{", "int", "offset", "=", "source", ".", "getOffset", "(", ")", ";", "if", "(", "offset", "==", "0", ")", "{", "return", "true", ";", "}", "else", "{", "char", "c", "=", "source", ".", ...
Check we are on the beginning of line @param source the text source @return true if we are on the beginning of line
[ "Check", "we", "are", "on", "the", "beginning", "of", "line" ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/proc/ProcBol.java#L55-L64
2,164
kefirfromperm/kefirbb
src/org/kefirsf/bb/proc/ProcBol.java
ProcBol.findLineBreak
private int findLineBreak(Source source) { int index; int n = source.find(AbstractEol.AN, false); int r = source.find(AbstractEol.AR, false); if (n >= 0 && r >= 0) { index = Math.min(n, r); } else if (n >= 0) { index = n; } else if (r >= 0) { ...
java
private int findLineBreak(Source source) { int index; int n = source.find(AbstractEol.AN, false); int r = source.find(AbstractEol.AR, false); if (n >= 0 && r >= 0) { index = Math.min(n, r); } else if (n >= 0) { index = n; } else if (r >= 0) { ...
[ "private", "int", "findLineBreak", "(", "Source", "source", ")", "{", "int", "index", ";", "int", "n", "=", "source", ".", "find", "(", "AbstractEol", ".", "AN", ",", "false", ")", ";", "int", "r", "=", "source", ".", "find", "(", "AbstractEol", ".",...
Find first input of line break @param source the text source
[ "Find", "first", "input", "of", "line", "break" ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/proc/ProcBol.java#L71-L85
2,165
kefirfromperm/kefirbb
src/org/kefirsf/bb/proc/ProcBol.java
ProcBol.skipLineBreak
private int skipLineBreak(Source source, final int offset) { char p; char c; int index = offset; p = source.charAt(index); index++; if (index < source.length()) { c = source.charAt(index); if ((c == '\n' || c == '\r') && c != p) { i...
java
private int skipLineBreak(Source source, final int offset) { char p; char c; int index = offset; p = source.charAt(index); index++; if (index < source.length()) { c = source.charAt(index); if ((c == '\n' || c == '\r') && c != p) { i...
[ "private", "int", "skipLineBreak", "(", "Source", "source", ",", "final", "int", "offset", ")", "{", "char", "p", ";", "char", "c", ";", "int", "index", "=", "offset", ";", "p", "=", "source", ".", "charAt", "(", "index", ")", ";", "index", "++", "...
Skip line break characters. '\r\n' for example @param source text source @param offset current index @return new index
[ "Skip", "line", "break", "characters", ".", "\\", "r", "\\", "n", "for", "example" ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/proc/ProcBol.java#L94-L107
2,166
kefirfromperm/kefirbb
src/org/kefirsf/bb/proc/Context.java
Context.getAttribute
public Object getAttribute(String name) { Object value = getLocalAttribute(name); if (value == null && parent != null) { value = parent.getAttribute(name); } return value; }
java
public Object getAttribute(String name) { Object value = getLocalAttribute(name); if (value == null && parent != null) { value = parent.getAttribute(name); } return value; }
[ "public", "Object", "getAttribute", "(", "String", "name", ")", "{", "Object", "value", "=", "getLocalAttribute", "(", "name", ")", ";", "if", "(", "value", "==", "null", "&&", "parent", "!=", "null", ")", "{", "value", "=", "parent", ".", "getAttribute"...
Get the context attribute. If attribute not exists in current context, then context search the sttribute in parent context @param name attribute name @return attribute value
[ "Get", "the", "context", "attribute", ".", "If", "attribute", "not", "exists", "in", "current", "context", "then", "context", "search", "the", "sttribute", "in", "parent", "context" ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/proc/Context.java#L133-L139
2,167
kefirfromperm/kefirbb
src/org/kefirsf/bb/proc/Context.java
Context.setScope
public void setScope(ProcScope scope) { this.scope = scope; // Scope false memo scopeFalseMemo = falseMemo.get(scope); if (scopeFalseMemo == null) { scopeFalseMemo = new IntSet(); falseMemo.put(scope, scopeFalseMemo); } }
java
public void setScope(ProcScope scope) { this.scope = scope; // Scope false memo scopeFalseMemo = falseMemo.get(scope); if (scopeFalseMemo == null) { scopeFalseMemo = new IntSet(); falseMemo.put(scope, scopeFalseMemo); } }
[ "public", "void", "setScope", "(", "ProcScope", "scope", ")", "{", "this", ".", "scope", "=", "scope", ";", "// Scope false memo", "scopeFalseMemo", "=", "falseMemo", ".", "get", "(", "scope", ")", ";", "if", "(", "scopeFalseMemo", "==", "null", ")", "{", ...
Set list of codes in current context @param scope code scope
[ "Set", "list", "of", "codes", "in", "current", "context" ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/proc/Context.java#L156-L165
2,168
kefirfromperm/kefirbb
src/org/kefirsf/bb/proc/ProcUrl.java
ProcUrl.preparePrefixes
private List<String> preparePrefixes() { // Prepare prefixes for all schemas List<String> prefixes = new ArrayList<String>(Schema.values().length + (local ? 3 : 0)); for (Schema schema : Schema.values()) { prefixes.add(schema.getPrefix()); } // For local URls prefixe...
java
private List<String> preparePrefixes() { // Prepare prefixes for all schemas List<String> prefixes = new ArrayList<String>(Schema.values().length + (local ? 3 : 0)); for (Schema schema : Schema.values()) { prefixes.add(schema.getPrefix()); } // For local URls prefixe...
[ "private", "List", "<", "String", ">", "preparePrefixes", "(", ")", "{", "// Prepare prefixes for all schemas", "List", "<", "String", ">", "prefixes", "=", "new", "ArrayList", "<", "String", ">", "(", "Schema", ".", "values", "(", ")", ".", "length", "+", ...
Prepare URL's prefixes. @return list of schema prefixes and local prefixes if local URL are allowed.
[ "Prepare", "URL", "s", "prefixes", "." ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/proc/ProcUrl.java#L99-L111
2,169
kefirfromperm/kefirbb
src/org/kefirsf/bb/conf/Scope.java
Scope.setCodes
public void setCodes(Set<Code> codes) { Exceptions.nullArgument("codes", codes); this.codes.clear(); this.codes.addAll(codes); }
java
public void setCodes(Set<Code> codes) { Exceptions.nullArgument("codes", codes); this.codes.clear(); this.codes.addAll(codes); }
[ "public", "void", "setCodes", "(", "Set", "<", "Code", ">", "codes", ")", "{", "Exceptions", ".", "nullArgument", "(", "\"codes\"", ",", "codes", ")", ";", "this", ".", "codes", ".", "clear", "(", ")", ";", "this", ".", "codes", ".", "addAll", "(", ...
Set codes. @param codes set of codes
[ "Set", "codes", "." ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/conf/Scope.java#L200-L205
2,170
kefirfromperm/kefirbb
src/org/kefirsf/bb/proc/ProcScope.java
ProcScope.cacheCodes
private void cacheCodes() { Set<ProcCode> set = new HashSet<ProcCode>(); if (parent != null) { set.addAll(Arrays.asList(parent.getCodes())); } if (scopeCodes != null) { set.addAll(scopeCodes); } cachedCodes = set.toArray(new ProcCode[set.size()]...
java
private void cacheCodes() { Set<ProcCode> set = new HashSet<ProcCode>(); if (parent != null) { set.addAll(Arrays.asList(parent.getCodes())); } if (scopeCodes != null) { set.addAll(scopeCodes); } cachedCodes = set.toArray(new ProcCode[set.size()]...
[ "private", "void", "cacheCodes", "(", ")", "{", "Set", "<", "ProcCode", ">", "set", "=", "new", "HashSet", "<", "ProcCode", ">", "(", ")", ";", "if", "(", "parent", "!=", "null", ")", "{", "set", ".", "addAll", "(", "Arrays", ".", "asList", "(", ...
Cache scope codes. Join scope codes with parent scope codes.
[ "Cache", "scope", "codes", ".", "Join", "scope", "codes", "with", "parent", "scope", "codes", "." ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/proc/ProcScope.java#L188-L213
2,171
kefirfromperm/kefirbb
src/org/kefirsf/bb/ProcessorBuilder.java
ProcessorBuilder.build
public BBProcessor build() { this.scopes = new HashMap<Scope, ProcScope>(); this.codes = new HashMap<Code, ProcCode>(); patternElementFactory.cleanConstants(); BBProcessor processor = new BBProcessor(); processor.setScope(createScope(conf.getRootScope())); processor.setP...
java
public BBProcessor build() { this.scopes = new HashMap<Scope, ProcScope>(); this.codes = new HashMap<Code, ProcCode>(); patternElementFactory.cleanConstants(); BBProcessor processor = new BBProcessor(); processor.setScope(createScope(conf.getRootScope())); processor.setP...
[ "public", "BBProcessor", "build", "(", ")", "{", "this", ".", "scopes", "=", "new", "HashMap", "<", "Scope", ",", "ProcScope", ">", "(", ")", ";", "this", ".", "codes", "=", "new", "HashMap", "<", "Code", ",", "ProcCode", ">", "(", ")", ";", "patte...
Build an processor.
[ "Build", "an", "processor", "." ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/ProcessorBuilder.java#L27-L47
2,172
kefirfromperm/kefirbb
src/org/kefirsf/bb/ProcessorBuilder.java
ProcessorBuilder.createScope
ProcScope createScope(Scope scope) { ProcScope created = scopes.get(scope); if (created == null) { created = new ProcScope(scope.getName()); scopes.put(scope, created); created.setStrong(scope.isStrong()); created.setIgnoreText(scope.isIgnoreText()); ...
java
ProcScope createScope(Scope scope) { ProcScope created = scopes.get(scope); if (created == null) { created = new ProcScope(scope.getName()); scopes.put(scope, created); created.setStrong(scope.isStrong()); created.setIgnoreText(scope.isIgnoreText()); ...
[ "ProcScope", "createScope", "(", "Scope", "scope", ")", "{", "ProcScope", "created", "=", "scopes", ".", "get", "(", "scope", ")", ";", "if", "(", "created", "==", "null", ")", "{", "created", "=", "new", "ProcScope", "(", "scope", ".", "getName", "(",...
Find or create the scope. @param scope the scope configuration @return scope scope
[ "Find", "or", "create", "the", "scope", "." ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/ProcessorBuilder.java#L55-L74
2,173
kefirfromperm/kefirbb
src/org/kefirsf/bb/ProcessorBuilder.java
ProcessorBuilder.createCode
private ProcCode createCode(Code defCode) { if (!defCode.hasPatterns()) { throw new IllegalStateException("Field pattern can't be null."); } if (defCode.getTemplate() == null) { throw new IllegalStateException("Field template can't be null."); } ProcCode...
java
private ProcCode createCode(Code defCode) { if (!defCode.hasPatterns()) { throw new IllegalStateException("Field pattern can't be null."); } if (defCode.getTemplate() == null) { throw new IllegalStateException("Field template can't be null."); } ProcCode...
[ "private", "ProcCode", "createCode", "(", "Code", "defCode", ")", "{", "if", "(", "!", "defCode", ".", "hasPatterns", "(", ")", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Field pattern can't be null.\"", ")", ";", "}", "if", "(", "defCode", "...
Create code from this definition @param defCode code definition @return code object
[ "Create", "code", "from", "this", "definition" ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/ProcessorBuilder.java#L82-L110
2,174
kefirfromperm/kefirbb
src/org/kefirsf/bb/ProcessorBuilder.java
ProcessorBuilder.createTemplate
private ProcTemplate createTemplate(Template template) { if (!template.isEmpty()) { return new ProcTemplate(templateElementFactory.createTemplateList(template.getElements())); } else { return ProcTemplate.EMPTY; } }
java
private ProcTemplate createTemplate(Template template) { if (!template.isEmpty()) { return new ProcTemplate(templateElementFactory.createTemplateList(template.getElements())); } else { return ProcTemplate.EMPTY; } }
[ "private", "ProcTemplate", "createTemplate", "(", "Template", "template", ")", "{", "if", "(", "!", "template", ".", "isEmpty", "(", ")", ")", "{", "return", "new", "ProcTemplate", "(", "templateElementFactory", ".", "createTemplateList", "(", "template", ".", ...
Create a template from definition @param template the template definition @return template
[ "Create", "a", "template", "from", "definition" ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/ProcessorBuilder.java#L118-L124
2,175
kefirfromperm/kefirbb
src/org/kefirsf/bb/ProcessorBuilder.java
ProcessorBuilder.createPattern
private ProcPattern createPattern(Pattern pattern) { if (pattern.isEmpty()) { throw new IllegalStateException("Pattern elements list can't be empty."); } List<ProcPatternElement> elements = new ArrayList<ProcPatternElement>(); for (PatternElement element : pattern.getElement...
java
private ProcPattern createPattern(Pattern pattern) { if (pattern.isEmpty()) { throw new IllegalStateException("Pattern elements list can't be empty."); } List<ProcPatternElement> elements = new ArrayList<ProcPatternElement>(); for (PatternElement element : pattern.getElement...
[ "private", "ProcPattern", "createPattern", "(", "Pattern", "pattern", ")", "{", "if", "(", "pattern", ".", "isEmpty", "(", ")", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Pattern elements list can't be empty.\"", ")", ";", "}", "List", "<", "Proc...
Create a pattern for text parsing @param pattern pattern definition @return pattern pattern
[ "Create", "a", "pattern", "for", "text", "parsing" ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/ProcessorBuilder.java#L132-L142
2,176
kefirfromperm/kefirbb
src/org/kefirsf/bb/proc/ProcVariable.java
ProcVariable.findIn
public int findIn(Source source) { if (regex != null) { Matcher matcher = regex.matcher(source.subToEnd()); if (matcher.find()) { return source.getOffset() + matcher.start(); } else { return -1; } } else { return...
java
public int findIn(Source source) { if (regex != null) { Matcher matcher = regex.matcher(source.subToEnd()); if (matcher.find()) { return source.getOffset() + matcher.start(); } else { return -1; } } else { return...
[ "public", "int", "findIn", "(", "Source", "source", ")", "{", "if", "(", "regex", "!=", "null", ")", "{", "Matcher", "matcher", "=", "regex", ".", "matcher", "(", "source", ".", "subToEnd", "(", ")", ")", ";", "if", "(", "matcher", ".", "find", "("...
Find this element @param source text source @return start offset
[ "Find", "this", "element" ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/proc/ProcVariable.java#L118-L129
2,177
kefirfromperm/kefirbb
src/org/kefirsf/bb/util/IntSet.java
IntSet.binarySearch
private static int binarySearch(int[] array, int toIndex, int key) { int low = 0; int high = toIndex - 1; while (low <= high) { int mid = (low + high) >>> 1; int midVal = array[mid]; if (midVal < key) { low = mid + 1; } else if (m...
java
private static int binarySearch(int[] array, int toIndex, int key) { int low = 0; int high = toIndex - 1; while (low <= high) { int mid = (low + high) >>> 1; int midVal = array[mid]; if (midVal < key) { low = mid + 1; } else if (m...
[ "private", "static", "int", "binarySearch", "(", "int", "[", "]", "array", ",", "int", "toIndex", ",", "int", "key", ")", "{", "int", "low", "=", "0", ";", "int", "high", "=", "toIndex", "-", "1", ";", "while", "(", "low", "<=", "high", ")", "{",...
Realisation of binary search algorithm. It is in JDK 1.6.0 but for JDK 1.5.0 compatibility I added it there. @param array array of integers values ordered by ascending @param toIndex top break of array @param key searched value @return value index or -(index of position)
[ "Realisation", "of", "binary", "search", "algorithm", ".", "It", "is", "in", "JDK", "1", ".", "6", ".", "0", "but", "for", "JDK", "1", ".", "5", ".", "0", "compatibility", "I", "added", "it", "there", "." ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/util/IntSet.java#L66-L83
2,178
kefirfromperm/kefirbb
src/org/kefirsf/bb/ConfigurationFactory.java
ConfigurationFactory.create
public Configuration create() { Configuration configuration; try { InputStream stream = null; try { // Search the user configuration stream = Utils.openResourceStream(DEFAULT_USER_CONFIGURATION_FILE); // If user configuration not f...
java
public Configuration create() { Configuration configuration; try { InputStream stream = null; try { // Search the user configuration stream = Utils.openResourceStream(DEFAULT_USER_CONFIGURATION_FILE); // If user configuration not f...
[ "public", "Configuration", "create", "(", ")", "{", "Configuration", "configuration", ";", "try", "{", "InputStream", "stream", "=", "null", ";", "try", "{", "// Search the user configuration", "stream", "=", "Utils", ".", "openResourceStream", "(", "DEFAULT_USER_CO...
Create the default bb-code processor. @return Default bb-code processor @throws TextProcessorFactoryException when can't read the default code set resource
[ "Create", "the", "default", "bb", "-", "code", "processor", "." ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/ConfigurationFactory.java#L70-L138
2,179
kefirfromperm/kefirbb
src/org/kefirsf/bb/ConfigurationFactory.java
ConfigurationFactory.createFromResource
public Configuration createFromResource(String resourceName) { Exceptions.nullArgument("resourceName", resourceName); Configuration configuration; try { InputStream stream = null; try { stream = Utils.openResourceStream(resourceName); if ...
java
public Configuration createFromResource(String resourceName) { Exceptions.nullArgument("resourceName", resourceName); Configuration configuration; try { InputStream stream = null; try { stream = Utils.openResourceStream(resourceName); if ...
[ "public", "Configuration", "createFromResource", "(", "String", "resourceName", ")", "{", "Exceptions", ".", "nullArgument", "(", "\"resourceName\"", ",", "resourceName", ")", ";", "Configuration", "configuration", ";", "try", "{", "InputStream", "stream", "=", "nul...
Create the bb-processor using xml-configuration resource @param resourceName name of resource file @return bb-code processor @throws TextProcessorFactoryException when can't find or read the resource or illegal config file
[ "Create", "the", "bb", "-", "processor", "using", "xml", "-", "configuration", "resource" ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/ConfigurationFactory.java#L147-L171
2,180
kefirfromperm/kefirbb
src/org/kefirsf/bb/ConfigurationFactory.java
ConfigurationFactory.create
public Configuration create(File file) { try { Configuration configuration; InputStream stream = new BufferedInputStream(new FileInputStream(file)); try { configuration = create(stream); } finally { stream.close(); } ...
java
public Configuration create(File file) { try { Configuration configuration; InputStream stream = new BufferedInputStream(new FileInputStream(file)); try { configuration = create(stream); } finally { stream.close(); } ...
[ "public", "Configuration", "create", "(", "File", "file", ")", "{", "try", "{", "Configuration", "configuration", ";", "InputStream", "stream", "=", "new", "BufferedInputStream", "(", "new", "FileInputStream", "(", "file", ")", ")", ";", "try", "{", "configura...
Create the bb-code processor from file with XML-configuration. @param file file with configuration @return bb-code processor @throws TextProcessorFactoryException any problems
[ "Create", "the", "bb", "-", "code", "processor", "from", "file", "with", "XML", "-", "configuration", "." ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/ConfigurationFactory.java#L191-L204
2,181
kefirfromperm/kefirbb
src/org/kefirsf/bb/ConfigurationFactory.java
ConfigurationFactory.create
public Configuration create(InputStream stream) { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(false); factory.setIgnoringElementContentWhitespace(true); factory.setNamespaceAware(true); DocumentBui...
java
public Configuration create(InputStream stream) { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(false); factory.setIgnoringElementContentWhitespace(true); factory.setNamespaceAware(true); DocumentBui...
[ "public", "Configuration", "create", "(", "InputStream", "stream", ")", "{", "try", "{", "DocumentBuilderFactory", "factory", "=", "DocumentBuilderFactory", ".", "newInstance", "(", ")", ";", "factory", ".", "setValidating", "(", "false", ")", ";", "factory", "....
Create the bb-processor from XML InputStream @param stream the input stream with XML @return bb-code processor @throws TextProcessorFactoryException when can't build Document
[ "Create", "the", "bb", "-", "processor", "from", "XML", "InputStream" ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/ConfigurationFactory.java#L213-L229
2,182
kefirfromperm/kefirbb
src/org/kefirsf/bb/proc/BBProcessor.java
BBProcessor.setParams
public void setParams(Map<String, CharSequence> params) { if (this.params == null) { this.params = Collections.unmodifiableMap(params); } else { throw new IllegalStateException("Can't change parameters."); } }
java
public void setParams(Map<String, CharSequence> params) { if (this.params == null) { this.params = Collections.unmodifiableMap(params); } else { throw new IllegalStateException("Can't change parameters."); } }
[ "public", "void", "setParams", "(", "Map", "<", "String", ",", "CharSequence", ">", "params", ")", "{", "if", "(", "this", ".", "params", "==", "null", ")", "{", "this", ".", "params", "=", "Collections", ".", "unmodifiableMap", "(", "params", ")", ";"...
Set text processor parameters map. @param params parameters
[ "Set", "text", "processor", "parameters", "map", "." ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/proc/BBProcessor.java#L128-L134
2,183
kefirfromperm/kefirbb
src/org/kefirsf/bb/PatternElementFactory.java
PatternElementFactory.create
private PatternConstant create(Constant constant) { if (!constants.containsKey(constant)) { constants.put( constant, new PatternConstant(constant.getValue(), constant.isIgnoreCase(), constant.isGhost()) ); } return constants.get(con...
java
private PatternConstant create(Constant constant) { if (!constants.containsKey(constant)) { constants.put( constant, new PatternConstant(constant.getValue(), constant.isIgnoreCase(), constant.isGhost()) ); } return constants.get(con...
[ "private", "PatternConstant", "create", "(", "Constant", "constant", ")", "{", "if", "(", "!", "constants", ".", "containsKey", "(", "constant", ")", ")", "{", "constants", ".", "put", "(", "constant", ",", "new", "PatternConstant", "(", "constant", ".", "...
Create a constant element for text parsing @param constant constant definition @return pattern element for constant
[ "Create", "a", "constant", "element", "for", "text", "parsing" ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/PatternElementFactory.java#L73-L81
2,184
kefirfromperm/kefirbb
src/org/kefirsf/bb/DomConfigurationFactory.java
DomConfigurationFactory.create
public Configuration create(Document dc) { // Create configuration Configuration configuration = new Configuration(); parseNesting(configuration, dc); // Parse parameters configuration.setParams(parseParams(dc)); // Parse prefix and suffix configuration.setPref...
java
public Configuration create(Document dc) { // Create configuration Configuration configuration = new Configuration(); parseNesting(configuration, dc); // Parse parameters configuration.setParams(parseParams(dc)); // Parse prefix and suffix configuration.setPref...
[ "public", "Configuration", "create", "(", "Document", "dc", ")", "{", "// Create configuration", "Configuration", "configuration", "=", "new", "Configuration", "(", ")", ";", "parseNesting", "(", "configuration", ",", "dc", ")", ";", "// Parse parameters", "configur...
Create the bb-code processor from DOM Document @param dc document @return bb-code processor @throws TextProcessorFactoryException If invalid Document
[ "Create", "the", "bb", "-", "code", "processor", "from", "DOM", "Document" ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/DomConfigurationFactory.java#L100-L144
2,185
kefirfromperm/kefirbb
src/org/kefirsf/bb/DomConfigurationFactory.java
DomConfigurationFactory.parseNesting
private void parseNesting(Configuration configuration, Document dc) { NodeList list = dc.getElementsByTagNameNS(SCHEMA_LOCATION, TAG_NESTING); if (list.getLength() > 0) { Node el = list.item(0); configuration.setNestingLimit(nodeAttribute(el, TAG_NESTING_ATTR_LIMIT, Configuration...
java
private void parseNesting(Configuration configuration, Document dc) { NodeList list = dc.getElementsByTagNameNS(SCHEMA_LOCATION, TAG_NESTING); if (list.getLength() > 0) { Node el = list.item(0); configuration.setNestingLimit(nodeAttribute(el, TAG_NESTING_ATTR_LIMIT, Configuration...
[ "private", "void", "parseNesting", "(", "Configuration", "configuration", ",", "Document", "dc", ")", "{", "NodeList", "list", "=", "dc", ".", "getElementsByTagNameNS", "(", "SCHEMA_LOCATION", ",", "TAG_NESTING", ")", ";", "if", "(", "list", ".", "getLength", ...
Parse nesting element, which describes nesting behavior. @param configuration parser configuration @param dc DOM-document
[ "Parse", "nesting", "element", "which", "describes", "nesting", "behavior", "." ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/DomConfigurationFactory.java#L152-L161
2,186
kefirfromperm/kefirbb
src/org/kefirsf/bb/DomConfigurationFactory.java
DomConfigurationFactory.parseParams
private Map<String, CharSequence> parseParams(Document dc) { Map<String, CharSequence> params = new HashMap<String, CharSequence>(); NodeList paramsElements = dc.getElementsByTagNameNS(SCHEMA_LOCATION, TAG_PARAMS); if (paramsElements.getLength() > 0) { Element paramsElement = (Elemen...
java
private Map<String, CharSequence> parseParams(Document dc) { Map<String, CharSequence> params = new HashMap<String, CharSequence>(); NodeList paramsElements = dc.getElementsByTagNameNS(SCHEMA_LOCATION, TAG_PARAMS); if (paramsElements.getLength() > 0) { Element paramsElement = (Elemen...
[ "private", "Map", "<", "String", ",", "CharSequence", ">", "parseParams", "(", "Document", "dc", ")", "{", "Map", "<", "String", ",", "CharSequence", ">", "params", "=", "new", "HashMap", "<", "String", ",", "CharSequence", ">", "(", ")", ";", "NodeList"...
Parse configuration predefined parameters. @param dc DOM-document @return parameters
[ "Parse", "configuration", "predefined", "parameters", "." ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/DomConfigurationFactory.java#L169-L185
2,187
kefirfromperm/kefirbb
src/org/kefirsf/bb/DomConfigurationFactory.java
DomConfigurationFactory.parseFix
private Template parseFix(Document dc, String tagname) { Template fix; NodeList prefixElementList = dc.getElementsByTagNameNS(SCHEMA_LOCATION, tagname); if (prefixElementList.getLength() > 0) { fix = parseTemplate(prefixElementList.item(0)); } else { fix = new Tem...
java
private Template parseFix(Document dc, String tagname) { Template fix; NodeList prefixElementList = dc.getElementsByTagNameNS(SCHEMA_LOCATION, tagname); if (prefixElementList.getLength() > 0) { fix = parseTemplate(prefixElementList.item(0)); } else { fix = new Tem...
[ "private", "Template", "parseFix", "(", "Document", "dc", ",", "String", "tagname", ")", "{", "Template", "fix", ";", "NodeList", "prefixElementList", "=", "dc", ".", "getElementsByTagNameNS", "(", "SCHEMA_LOCATION", ",", "tagname", ")", ";", "if", "(", "prefi...
Parse prefix or suffix. @param dc DOM-document. @param tagname tag name. @return template.
[ "Parse", "prefix", "or", "suffix", "." ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/DomConfigurationFactory.java#L194-L203
2,188
kefirfromperm/kefirbb
src/org/kefirsf/bb/DomConfigurationFactory.java
DomConfigurationFactory.fillScopeCodes
private void fillScopeCodes( NodeList scopeNodeList, Map<String, Scope> scopes, Map<String, Code> codes ) { for (int i = 0; i < scopeNodeList.getLength(); i++) { Element scopeElement = (Element) scopeNodeList.item(i); Scope scope = scopes.get(scope...
java
private void fillScopeCodes( NodeList scopeNodeList, Map<String, Scope> scopes, Map<String, Code> codes ) { for (int i = 0; i < scopeNodeList.getLength(); i++) { Element scopeElement = (Element) scopeNodeList.item(i); Scope scope = scopes.get(scope...
[ "private", "void", "fillScopeCodes", "(", "NodeList", "scopeNodeList", ",", "Map", "<", "String", ",", "Scope", ">", "scopes", ",", "Map", "<", "String", ",", "Code", ">", "codes", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "scopeNode...
Fill codes of scopes. @param scopeNodeList node list with scopes definitions @param scopes scopes @param codes codes @throws TextProcessorFactoryException any problem
[ "Fill", "codes", "of", "scopes", "." ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/DomConfigurationFactory.java#L213-L248
2,189
kefirfromperm/kefirbb
src/org/kefirsf/bb/DomConfigurationFactory.java
DomConfigurationFactory.parseScopes
private Map<String, Scope> parseScopes(NodeList scopeNodeList) { Map<String, Scope> scopes = new HashMap<String, Scope>(); // Parse scopes for (int i = 0; i < scopeNodeList.getLength(); i++) { Element scopeElement = (Element) scopeNodeList.item(i); String name = scopeEle...
java
private Map<String, Scope> parseScopes(NodeList scopeNodeList) { Map<String, Scope> scopes = new HashMap<String, Scope>(); // Parse scopes for (int i = 0; i < scopeNodeList.getLength(); i++) { Element scopeElement = (Element) scopeNodeList.item(i); String name = scopeEle...
[ "private", "Map", "<", "String", ",", "Scope", ">", "parseScopes", "(", "NodeList", "scopeNodeList", ")", "{", "Map", "<", "String", ",", "Scope", ">", "scopes", "=", "new", "HashMap", "<", "String", ",", "Scope", ">", "(", ")", ";", "// Parse scopes", ...
Parse scopes from XML @param scopeNodeList list with scopes definitions @return scopes @throws TextProcessorFactoryException any problems
[ "Parse", "scopes", "from", "XML" ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/DomConfigurationFactory.java#L257-L303
2,190
kefirfromperm/kefirbb
src/org/kefirsf/bb/DomConfigurationFactory.java
DomConfigurationFactory.parseCodes
private Map<String, Code> parseCodes(Document dc, Map<String, Scope> scopes) { Map<String, Code> codes = new HashMap<String, Code>(); NodeList codeNodeList = dc.getDocumentElement().getElementsByTagNameNS(SCHEMA_LOCATION, TAG_CODE); for (int i = 0; i < codeNodeList.getLength(); i++) { ...
java
private Map<String, Code> parseCodes(Document dc, Map<String, Scope> scopes) { Map<String, Code> codes = new HashMap<String, Code>(); NodeList codeNodeList = dc.getDocumentElement().getElementsByTagNameNS(SCHEMA_LOCATION, TAG_CODE); for (int i = 0; i < codeNodeList.getLength(); i++) { ...
[ "private", "Map", "<", "String", ",", "Code", ">", "parseCodes", "(", "Document", "dc", ",", "Map", "<", "String", ",", "Scope", ">", "scopes", ")", "{", "Map", "<", "String", ",", "Code", ">", "codes", "=", "new", "HashMap", "<", "String", ",", "C...
Parse codes from XML @param dc DOM document with configuration @return codes @throws TextProcessorFactoryException any problem
[ "Parse", "codes", "from", "XML" ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/DomConfigurationFactory.java#L312-L320
2,191
kefirfromperm/kefirbb
src/org/kefirsf/bb/DomConfigurationFactory.java
DomConfigurationFactory.parseCode
private Code parseCode(Element codeElement, Map<String, Scope> scopes) { // Code name Code code = new Code(nodeAttribute(codeElement, TAG_CODE_ATTR_NAME, Utils.generateRandomName())); // Code priority code.setPriority(nodeAttribute(codeElement, TAG_CODE_ATTR_PRIORITY, Code.DEFAULT_PRIOR...
java
private Code parseCode(Element codeElement, Map<String, Scope> scopes) { // Code name Code code = new Code(nodeAttribute(codeElement, TAG_CODE_ATTR_NAME, Utils.generateRandomName())); // Code priority code.setPriority(nodeAttribute(codeElement, TAG_CODE_ATTR_PRIORITY, Code.DEFAULT_PRIOR...
[ "private", "Code", "parseCode", "(", "Element", "codeElement", ",", "Map", "<", "String", ",", "Scope", ">", "scopes", ")", "{", "// Code name", "Code", "code", "=", "new", "Code", "(", "nodeAttribute", "(", "codeElement", ",", "TAG_CODE_ATTR_NAME", ",", "Ut...
Parse bb-code from DOM Node @param codeElement node, represent code wich @return bb-code @throws TextProcessorFactoryException if error format
[ "Parse", "bb", "-", "code", "from", "DOM", "Node" ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/DomConfigurationFactory.java#L329-L359
2,192
kefirfromperm/kefirbb
src/org/kefirsf/bb/DomConfigurationFactory.java
DomConfigurationFactory.parsePattern
private Pattern parsePattern(Node node, Map<String, Scope> scopes) { List<PatternElement> elements = new ArrayList<PatternElement>(); NodeList patternList = node.getChildNodes(); int patternLength = patternList.getLength(); if (patternLength <= 0) { throw new TextProcessorFac...
java
private Pattern parsePattern(Node node, Map<String, Scope> scopes) { List<PatternElement> elements = new ArrayList<PatternElement>(); NodeList patternList = node.getChildNodes(); int patternLength = patternList.getLength(); if (patternLength <= 0) { throw new TextProcessorFac...
[ "private", "Pattern", "parsePattern", "(", "Node", "node", ",", "Map", "<", "String", ",", "Scope", ">", "scopes", ")", "{", "List", "<", "PatternElement", ">", "elements", "=", "new", "ArrayList", "<", "PatternElement", ">", "(", ")", ";", "NodeList", "...
Parse code pattern for parse text. @param node pattern node with pattern description @return list of pattern elements @throws TextProcessorFactoryException If invalid pattern format
[ "Parse", "code", "pattern", "for", "parse", "text", "." ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/DomConfigurationFactory.java#L368-L413
2,193
kefirfromperm/kefirbb
src/org/kefirsf/bb/DomConfigurationFactory.java
DomConfigurationFactory.parseUrl
private Url parseUrl(Node el) { return new Url( nodeAttribute(el, TAG_VAR_ATTR_NAME, Url.DEFAULT_NAME), nodeAttribute(el, TAG_ATTR_GHOST, PatternElement.DEFAULT_GHOST_VALUE), nodeAttribute(el, TAG_URL_ATTR_LOCAL, Url.DEFAULT_LOCAL), nodeAttribute(e...
java
private Url parseUrl(Node el) { return new Url( nodeAttribute(el, TAG_VAR_ATTR_NAME, Url.DEFAULT_NAME), nodeAttribute(el, TAG_ATTR_GHOST, PatternElement.DEFAULT_GHOST_VALUE), nodeAttribute(el, TAG_URL_ATTR_LOCAL, Url.DEFAULT_LOCAL), nodeAttribute(e...
[ "private", "Url", "parseUrl", "(", "Node", "el", ")", "{", "return", "new", "Url", "(", "nodeAttribute", "(", "el", ",", "TAG_VAR_ATTR_NAME", ",", "Url", ".", "DEFAULT_NAME", ")", ",", "nodeAttribute", "(", "el", ",", "TAG_ATTR_GHOST", ",", "PatternElement",...
Parse an URL tag. @param el tag element @return Configuration URL.
[ "Parse", "an", "URL", "tag", "." ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/DomConfigurationFactory.java#L421-L428
2,194
kefirfromperm/kefirbb
src/org/kefirsf/bb/DomConfigurationFactory.java
DomConfigurationFactory.parseEmail
private Email parseEmail(Node el){ return new Email( nodeAttribute(el, TAG_VAR_ATTR_NAME, Email.DEFAULT_NAME), nodeAttribute(el, TAG_ATTR_GHOST, PatternElement.DEFAULT_GHOST_VALUE) ); }
java
private Email parseEmail(Node el){ return new Email( nodeAttribute(el, TAG_VAR_ATTR_NAME, Email.DEFAULT_NAME), nodeAttribute(el, TAG_ATTR_GHOST, PatternElement.DEFAULT_GHOST_VALUE) ); }
[ "private", "Email", "parseEmail", "(", "Node", "el", ")", "{", "return", "new", "Email", "(", "nodeAttribute", "(", "el", ",", "TAG_VAR_ATTR_NAME", ",", "Email", ".", "DEFAULT_NAME", ")", ",", "nodeAttribute", "(", "el", ",", "TAG_ATTR_GHOST", ",", "PatternE...
Parse an email tag. @param el tag element @return Configuration EMAIL.
[ "Parse", "an", "email", "tag", "." ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/DomConfigurationFactory.java#L436-L441
2,195
kefirfromperm/kefirbb
src/org/kefirsf/bb/DomConfigurationFactory.java
DomConfigurationFactory.parseConstant
private Constant parseConstant(Node el, boolean ignoreCase) { return new Constant( nodeAttribute(el, TAG_CONSTANT_ATTR_VALUE), nodeAttribute(el, TAG_CONSTANT_ATTR_IGNORE_CASE, ignoreCase), nodeAttribute(el, TAG_ATTR_GHOST, PatternElement.DEFAULT_GHOST_VALUE) ...
java
private Constant parseConstant(Node el, boolean ignoreCase) { return new Constant( nodeAttribute(el, TAG_CONSTANT_ATTR_VALUE), nodeAttribute(el, TAG_CONSTANT_ATTR_IGNORE_CASE, ignoreCase), nodeAttribute(el, TAG_ATTR_GHOST, PatternElement.DEFAULT_GHOST_VALUE) ...
[ "private", "Constant", "parseConstant", "(", "Node", "el", ",", "boolean", "ignoreCase", ")", "{", "return", "new", "Constant", "(", "nodeAttribute", "(", "el", ",", "TAG_CONSTANT_ATTR_VALUE", ")", ",", "nodeAttribute", "(", "el", ",", "TAG_CONSTANT_ATTR_IGNORE_CA...
Parse constant pattern element @param el DOM element @param ignoreCase if true the constant must ignore case @return constant definition
[ "Parse", "constant", "pattern", "element" ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/DomConfigurationFactory.java#L454-L460
2,196
kefirfromperm/kefirbb
src/org/kefirsf/bb/DomConfigurationFactory.java
DomConfigurationFactory.parseNamedElement
private PatternElement parseNamedElement(Node el, Map<String, Scope> scopes) { PatternElement namedElement; if ( nodeAttribute(el, TAG_VAR_ATTR_PARSE, DEFAULT_PARSE_VALUE) && !nodeHasAttribute(el, TAG_VAR_ATTR_REGEX) && !nodeHasAttribute(el...
java
private PatternElement parseNamedElement(Node el, Map<String, Scope> scopes) { PatternElement namedElement; if ( nodeAttribute(el, TAG_VAR_ATTR_PARSE, DEFAULT_PARSE_VALUE) && !nodeHasAttribute(el, TAG_VAR_ATTR_REGEX) && !nodeHasAttribute(el...
[ "private", "PatternElement", "parseNamedElement", "(", "Node", "el", ",", "Map", "<", "String", ",", "Scope", ">", "scopes", ")", "{", "PatternElement", "namedElement", ";", "if", "(", "nodeAttribute", "(", "el", ",", "TAG_VAR_ATTR_PARSE", ",", "DEFAULT_PARSE_VA...
Parse a pattern named element. Text or Variable. @param el a DOM-element @param scopes map of scopes by name @return Text or Variable
[ "Parse", "a", "pattern", "named", "element", ".", "Text", "or", "Variable", "." ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/DomConfigurationFactory.java#L469-L481
2,197
kefirfromperm/kefirbb
src/org/kefirsf/bb/DomConfigurationFactory.java
DomConfigurationFactory.parseText
private Text parseText(Node el, Map<String, Scope> scopes) { Text text; if (nodeAttribute(el, TAG_VAR_ATTR_INHERIT, DEFAULT_INHERIT_VALUE)) { text = new Text( nodeAttribute(el, TAG_VAR_ATTR_NAME, Variable.DEFAULT_NAME), null, nodeAt...
java
private Text parseText(Node el, Map<String, Scope> scopes) { Text text; if (nodeAttribute(el, TAG_VAR_ATTR_INHERIT, DEFAULT_INHERIT_VALUE)) { text = new Text( nodeAttribute(el, TAG_VAR_ATTR_NAME, Variable.DEFAULT_NAME), null, nodeAt...
[ "private", "Text", "parseText", "(", "Node", "el", ",", "Map", "<", "String", ",", "Scope", ">", "scopes", ")", "{", "Text", "text", ";", "if", "(", "nodeAttribute", "(", "el", ",", "TAG_VAR_ATTR_INHERIT", ",", "DEFAULT_INHERIT_VALUE", ")", ")", "{", "te...
Parse text. Text is a part of pattern. @param el a DOM-element @param scopes map of scopes by name @return text
[ "Parse", "text", ".", "Text", "is", "a", "part", "of", "pattern", "." ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/DomConfigurationFactory.java#L490-L514
2,198
kefirfromperm/kefirbb
src/org/kefirsf/bb/DomConfigurationFactory.java
DomConfigurationFactory.parseVariable
private Variable parseVariable(Node el) { Variable variable; if (nodeHasAttribute(el, TAG_VAR_ATTR_REGEX)) { variable = new Variable( nodeAttribute(el, TAG_VAR_ATTR_NAME, Variable.DEFAULT_NAME), java.util.regex.Pattern.compile( ...
java
private Variable parseVariable(Node el) { Variable variable; if (nodeHasAttribute(el, TAG_VAR_ATTR_REGEX)) { variable = new Variable( nodeAttribute(el, TAG_VAR_ATTR_NAME, Variable.DEFAULT_NAME), java.util.regex.Pattern.compile( ...
[ "private", "Variable", "parseVariable", "(", "Node", "el", ")", "{", "Variable", "variable", ";", "if", "(", "nodeHasAttribute", "(", "el", ",", "TAG_VAR_ATTR_REGEX", ")", ")", "{", "variable", "=", "new", "Variable", "(", "nodeAttribute", "(", "el", ",", ...
Parse variable. The part of pattern. @param el DOM-element @return variable
[ "Parse", "variable", ".", "The", "part", "of", "pattern", "." ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/DomConfigurationFactory.java#L522-L540
2,199
kefirfromperm/kefirbb
src/org/kefirsf/bb/DomConfigurationFactory.java
DomConfigurationFactory.parseIf
private If parseIf(Node node) { return new If( nodeAttribute(node, TAG_VAR_ATTR_NAME, Variable.DEFAULT_NAME), parseTemplateElements(node) ); }
java
private If parseIf(Node node) { return new If( nodeAttribute(node, TAG_VAR_ATTR_NAME, Variable.DEFAULT_NAME), parseTemplateElements(node) ); }
[ "private", "If", "parseIf", "(", "Node", "node", ")", "{", "return", "new", "If", "(", "nodeAttribute", "(", "node", ",", "TAG_VAR_ATTR_NAME", ",", "Variable", ".", "DEFAULT_NAME", ")", ",", "parseTemplateElements", "(", "node", ")", ")", ";", "}" ]
Parse an IF expression.
[ "Parse", "an", "IF", "expression", "." ]
8c36fc3d3dc27459b0cdc179b87582df30420856
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/DomConfigurationFactory.java#L555-L560