repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
algolia/algoliasearch-client-java
src/main/java/com/algolia/search/saas/Index.java
Index.clearIndex
public JSONObject clearIndex(RequestOptions requestOptions) throws AlgoliaException { return client.postRequest("/1/indexes/" + encodedIndexName + "/clear", "", true, false, requestOptions); }
java
public JSONObject clearIndex(RequestOptions requestOptions) throws AlgoliaException { return client.postRequest("/1/indexes/" + encodedIndexName + "/clear", "", true, false, requestOptions); }
[ "public", "JSONObject", "clearIndex", "(", "RequestOptions", "requestOptions", ")", "throws", "AlgoliaException", "{", "return", "client", ".", "postRequest", "(", "\"/1/indexes/\"", "+", "encodedIndexName", "+", "\"/clear\"", ",", "\"\"", ",", "true", ",", "false",...
Delete the index content without removing settings and index specific API keys. @param requestOptions Options to pass to this request
[ "Delete", "the", "index", "content", "without", "removing", "settings", "and", "index", "specific", "API", "keys", "." ]
a05da2f66c099fe6f77295c7b6a8a12c24e95f9b
https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L921-L923
train
algolia/algoliasearch-client-java
src/main/java/com/algolia/search/saas/Index.java
Index.setSettings
public JSONObject setSettings(JSONObject settings, RequestOptions requestOptions) throws AlgoliaException { return setSettings(settings, false, requestOptions); }
java
public JSONObject setSettings(JSONObject settings, RequestOptions requestOptions) throws AlgoliaException { return setSettings(settings, false, requestOptions); }
[ "public", "JSONObject", "setSettings", "(", "JSONObject", "settings", ",", "RequestOptions", "requestOptions", ")", "throws", "AlgoliaException", "{", "return", "setSettings", "(", "settings", ",", "false", ",", "requestOptions", ")", ";", "}" ]
Set settings for this index @param settings the settings for an index @param requestOptions Options to pass to this request
[ "Set", "settings", "for", "this", "index" ]
a05da2f66c099fe6f77295c7b6a8a12c24e95f9b
https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L940-L942
train
algolia/algoliasearch-client-java
src/main/java/com/algolia/search/saas/Index.java
Index.getApiKey
public JSONObject getApiKey(String key, RequestOptions requestOptions) throws AlgoliaException { return client.getRequest("/1/indexes/" + encodedIndexName + "/keys/" + key, false, requestOptions); }
java
public JSONObject getApiKey(String key, RequestOptions requestOptions) throws AlgoliaException { return client.getRequest("/1/indexes/" + encodedIndexName + "/keys/" + key, false, requestOptions); }
[ "public", "JSONObject", "getApiKey", "(", "String", "key", ",", "RequestOptions", "requestOptions", ")", "throws", "AlgoliaException", "{", "return", "client", ".", "getRequest", "(", "\"/1/indexes/\"", "+", "encodedIndexName", "+", "\"/keys/\"", "+", "key", ",", ...
Get ACL of an api key @param requestOptions Options to pass to this request
[ "Get", "ACL", "of", "an", "api", "key" ]
a05da2f66c099fe6f77295c7b6a8a12c24e95f9b
https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L997-L999
train
algolia/algoliasearch-client-java
src/main/java/com/algolia/search/saas/Index.java
Index.deleteApiKey
public JSONObject deleteApiKey(String key, RequestOptions requestOptions) throws AlgoliaException { return client.deleteRequest("/1/indexes/" + encodedIndexName + "/keys/" + key, requestOptions); }
java
public JSONObject deleteApiKey(String key, RequestOptions requestOptions) throws AlgoliaException { return client.deleteRequest("/1/indexes/" + encodedIndexName + "/keys/" + key, requestOptions); }
[ "public", "JSONObject", "deleteApiKey", "(", "String", "key", ",", "RequestOptions", "requestOptions", ")", "throws", "AlgoliaException", "{", "return", "client", ".", "deleteRequest", "(", "\"/1/indexes/\"", "+", "encodedIndexName", "+", "\"/keys/\"", "+", "key", "...
Delete an existing api key @param requestOptions Options to pass to this request
[ "Delete", "an", "existing", "api", "key" ]
a05da2f66c099fe6f77295c7b6a8a12c24e95f9b
https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L1021-L1023
train
algolia/algoliasearch-client-java
src/main/java/com/algolia/search/saas/Index.java
Index.clearSynonyms
public JSONObject clearSynonyms(boolean forwardToReplicas, RequestOptions requestOptions) throws AlgoliaException { return client.postRequest("/1/indexes/" + encodedIndexName + "/synonyms/clear?forwardToReplicas=" + forwardToReplicas, "", true, false, requestOptions); }
java
public JSONObject clearSynonyms(boolean forwardToReplicas, RequestOptions requestOptions) throws AlgoliaException { return client.postRequest("/1/indexes/" + encodedIndexName + "/synonyms/clear?forwardToReplicas=" + forwardToReplicas, "", true, false, requestOptions); }
[ "public", "JSONObject", "clearSynonyms", "(", "boolean", "forwardToReplicas", ",", "RequestOptions", "requestOptions", ")", "throws", "AlgoliaException", "{", "return", "client", ".", "postRequest", "(", "\"/1/indexes/\"", "+", "encodedIndexName", "+", "\"/synonyms/clear?...
Delete all synonym set @param forwardToReplicas Forward the operation to the replica indices @param requestOptions Options to pass to this request
[ "Delete", "all", "synonym", "set" ]
a05da2f66c099fe6f77295c7b6a8a12c24e95f9b
https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L1544-L1546
train
algolia/algoliasearch-client-java
src/main/java/com/algolia/search/saas/Index.java
Index.getRule
public JSONObject getRule(String objectID, RequestOptions requestOptions) throws AlgoliaException { if (objectID == null || objectID.length() == 0) { throw new AlgoliaException("Invalid objectID"); } try { return client.getRequest("/1/indexes/" + encodedIndexName + "/rules/" + URLEncoder.encode(...
java
public JSONObject getRule(String objectID, RequestOptions requestOptions) throws AlgoliaException { if (objectID == null || objectID.length() == 0) { throw new AlgoliaException("Invalid objectID"); } try { return client.getRequest("/1/indexes/" + encodedIndexName + "/rules/" + URLEncoder.encode(...
[ "public", "JSONObject", "getRule", "(", "String", "objectID", ",", "RequestOptions", "requestOptions", ")", "throws", "AlgoliaException", "{", "if", "(", "objectID", "==", "null", "||", "objectID", ".", "length", "(", ")", "==", "0", ")", "{", "throw", "new"...
Get a query rule @param objectID the objectID of the query rule to get @param requestOptions Options to pass to this request
[ "Get", "a", "query", "rule" ]
a05da2f66c099fe6f77295c7b6a8a12c24e95f9b
https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L1779-L1788
train
algolia/algoliasearch-client-java
src/main/java/com/algolia/search/saas/Query.java
Query.setOptionalWords
public Query setOptionalWords(List<String> words) { StringBuilder builder = new StringBuilder(); for (String word : words) { builder.append(word); builder.append(","); } this.optionalWords = builder.toString(); return this; }
java
public Query setOptionalWords(List<String> words) { StringBuilder builder = new StringBuilder(); for (String word : words) { builder.append(word); builder.append(","); } this.optionalWords = builder.toString(); return this; }
[ "public", "Query", "setOptionalWords", "(", "List", "<", "String", ">", "words", ")", "{", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "String", "word", ":", "words", ")", "{", "builder", ".", "append", "(", "word"...
Set the list of words that should be considered as optional when found in the query. @param words The list of optional words.
[ "Set", "the", "list", "of", "words", "that", "should", "be", "considered", "as", "optional", "when", "found", "in", "the", "query", "." ]
a05da2f66c099fe6f77295c7b6a8a12c24e95f9b
https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Query.java#L1113-L1121
train
algolia/algoliasearch-client-java
src/main/java/com/algolia/search/saas/APIClient.java
APIClient.getFallbackDomain
static String getFallbackDomain() { int javaVersion = getJavaVersion(); boolean javaHasSNI = javaVersion >= 7; final VersionInfo vi = VersionInfo.loadVersionInfo ("org.apache.http.client", APIClient.class.getClassLoader()); String version = vi.getRelease(); String[] split = version.split("\\....
java
static String getFallbackDomain() { int javaVersion = getJavaVersion(); boolean javaHasSNI = javaVersion >= 7; final VersionInfo vi = VersionInfo.loadVersionInfo ("org.apache.http.client", APIClient.class.getClassLoader()); String version = vi.getRelease(); String[] split = version.split("\\....
[ "static", "String", "getFallbackDomain", "(", ")", "{", "int", "javaVersion", "=", "getJavaVersion", "(", ")", ";", "boolean", "javaHasSNI", "=", "javaVersion", ">=", "7", ";", "final", "VersionInfo", "vi", "=", "VersionInfo", ".", "loadVersionInfo", "(", "\"o...
Get the appropriate fallback domain depending on the current SNI support. Checks Java version and Apache HTTP Client's version. @return algolianet.com if the current setup supports SNI, else algolia.net.
[ "Get", "the", "appropriate", "fallback", "domain", "depending", "on", "the", "current", "SNI", "support", ".", "Checks", "Java", "version", "and", "Apache", "HTTP", "Client", "s", "version", "." ]
a05da2f66c099fe6f77295c7b6a8a12c24e95f9b
https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/APIClient.java#L184-L204
train
algolia/algoliasearch-client-java
src/main/java/com/algolia/search/saas/APIClient.java
APIClient.setUserAgent
public void setUserAgent(String agent, String agentVersion) { userAgent = String.format("Algolia for Java (%s); JVM (%s); %s (%s)", version, System.getProperty("java.version"), agent, agentVersion); }
java
public void setUserAgent(String agent, String agentVersion) { userAgent = String.format("Algolia for Java (%s); JVM (%s); %s (%s)", version, System.getProperty("java.version"), agent, agentVersion); }
[ "public", "void", "setUserAgent", "(", "String", "agent", ",", "String", "agentVersion", ")", "{", "userAgent", "=", "String", ".", "format", "(", "\"Algolia for Java (%s); JVM (%s); %s (%s)\"", ",", "version", ",", "System", ".", "getProperty", "(", "\"java.version...
Allow to modify the user-agent in order to add the user agent of the integration
[ "Allow", "to", "modify", "the", "user", "-", "agent", "in", "order", "to", "add", "the", "user", "agent", "of", "the", "integration" ]
a05da2f66c099fe6f77295c7b6a8a12c24e95f9b
https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/APIClient.java#L225-L227
train
algolia/algoliasearch-client-java
src/main/java/com/algolia/search/saas/APIClient.java
APIClient.enableRateLimitForward
public void enableRateLimitForward(String adminAPIKey, String endUserIP, String rateLimitAPIKey) { this.forwardAdminAPIKey = adminAPIKey; this.forwardEndUserIP = endUserIP; this.forwardRateLimitAPIKey = rateLimitAPIKey; }
java
public void enableRateLimitForward(String adminAPIKey, String endUserIP, String rateLimitAPIKey) { this.forwardAdminAPIKey = adminAPIKey; this.forwardEndUserIP = endUserIP; this.forwardRateLimitAPIKey = rateLimitAPIKey; }
[ "public", "void", "enableRateLimitForward", "(", "String", "adminAPIKey", ",", "String", "endUserIP", ",", "String", "rateLimitAPIKey", ")", "{", "this", ".", "forwardAdminAPIKey", "=", "adminAPIKey", ";", "this", ".", "forwardEndUserIP", "=", "endUserIP", ";", "t...
Allow to use IP rate limit when you have a proxy between end-user and Algolia. This option will set the X-Forwarded-For HTTP header with the client IP and the X-Forwarded-API-Key with the API Key having rate limits. @param adminAPIKey the admin API Key you can find in your dashboard @param endUserIP the end ...
[ "Allow", "to", "use", "IP", "rate", "limit", "when", "you", "have", "a", "proxy", "between", "end", "-", "user", "and", "Algolia", ".", "This", "option", "will", "set", "the", "X", "-", "Forwarded", "-", "For", "HTTP", "header", "with", "the", "client"...
a05da2f66c099fe6f77295c7b6a8a12c24e95f9b
https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/APIClient.java#L237-L241
train
mikepenz/ItemAnimators
library/src/main/java/com/mikepenz/itemanimators/BaseItemAnimator.java
BaseItemAnimator.changeAnimation
public void changeAnimation(ViewHolder oldHolder, ViewHolder newHolder, int fromX, int fromY, int toX, int toY) { final float prevTranslationX = ViewCompat.getTranslationX(oldHolder.itemView); final float prevTranslationY = ViewCompat.getTranslationY(oldHolder.itemView); final float prevValue = ...
java
public void changeAnimation(ViewHolder oldHolder, ViewHolder newHolder, int fromX, int fromY, int toX, int toY) { final float prevTranslationX = ViewCompat.getTranslationX(oldHolder.itemView); final float prevTranslationY = ViewCompat.getTranslationY(oldHolder.itemView); final float prevValue = ...
[ "public", "void", "changeAnimation", "(", "ViewHolder", "oldHolder", ",", "ViewHolder", "newHolder", ",", "int", "fromX", ",", "int", "fromY", ",", "int", "toX", ",", "int", "toY", ")", "{", "final", "float", "prevTranslationX", "=", "ViewCompat", ".", "getT...
the whole change animation if we have to cross animate two views @param oldHolder @param newHolder @param fromX @param fromY @param toX @param toY
[ "the", "whole", "change", "animation", "if", "we", "have", "to", "cross", "animate", "two", "views" ]
dacfdbd7bfe8a281670e9378a74f54e362678c43
https://github.com/mikepenz/ItemAnimators/blob/dacfdbd7bfe8a281670e9378a74f54e362678c43/library/src/main/java/com/mikepenz/itemanimators/BaseItemAnimator.java#L461-L480
train
Breinify/brein-time-utilities
src/com/brein/time/timeintervals/indexes/IntervalTree.java
IntervalTree.determineBalance
protected long determineBalance(final IntervalTreeNode node) { if (node == null) { return 0L; } return (node.hasLeft() ? node.getLeft().getHeight() : 0) - (node.hasRight() ? node.getRight().getHeight() : 0); }
java
protected long determineBalance(final IntervalTreeNode node) { if (node == null) { return 0L; } return (node.hasLeft() ? node.getLeft().getHeight() : 0) - (node.hasRight() ? node.getRight().getHeight() : 0); }
[ "protected", "long", "determineBalance", "(", "final", "IntervalTreeNode", "node", ")", "{", "if", "(", "node", "==", "null", ")", "{", "return", "0L", ";", "}", "return", "(", "node", ".", "hasLeft", "(", ")", "?", "node", ".", "getLeft", "(", ")", ...
Get Balance factor of node N
[ "Get", "Balance", "factor", "of", "node", "N" ]
ec0165a50ec1951ec7730b72c85c801c2018f314
https://github.com/Breinify/brein-time-utilities/blob/ec0165a50ec1951ec7730b72c85c801c2018f314/src/com/brein/time/timeintervals/indexes/IntervalTree.java#L394-L401
train
Breinify/brein-time-utilities
src/com/brein/time/timeseries/BucketTimeSeries.java
BucketTimeSeries.fill
protected void fill(int fromIndex, int endIndex) { fromIndex = fromIndex == -1 ? 0 : fromIndex; endIndex = endIndex == -1 || endIndex > this.timeSeries.length ? this.timeSeries.length : endIndex; final T val; if (applyZero()) { val = zero(); } else { val ...
java
protected void fill(int fromIndex, int endIndex) { fromIndex = fromIndex == -1 ? 0 : fromIndex; endIndex = endIndex == -1 || endIndex > this.timeSeries.length ? this.timeSeries.length : endIndex; final T val; if (applyZero()) { val = zero(); } else { val ...
[ "protected", "void", "fill", "(", "int", "fromIndex", ",", "int", "endIndex", ")", "{", "fromIndex", "=", "fromIndex", "==", "-", "1", "?", "0", ":", "fromIndex", ";", "endIndex", "=", "endIndex", "==", "-", "1", "||", "endIndex", ">", "this", ".", "...
Resets the values from [fromIndex, endIndex). @param fromIndex the index to start from (included) @param endIndex the index to end (excluded)
[ "Resets", "the", "values", "from", "[", "fromIndex", "endIndex", ")", "." ]
ec0165a50ec1951ec7730b72c85c801c2018f314
https://github.com/Breinify/brein-time-utilities/blob/ec0165a50ec1951ec7730b72c85c801c2018f314/src/com/brein/time/timeseries/BucketTimeSeries.java#L125-L140
train
Breinify/brein-time-utilities
src/com/brein/time/timeseries/BucketTimeSeries.java
BucketTimeSeries.getEndPoints
public BucketEndPoints getEndPoints(final int bucketsFromNow) throws IllegalTimePoint { if (currentNowIdx == -1 || now == null) { throw new IllegalTimePoint("The now is not set yet, thus no end-points can be returned"); } return now.move(bucketsFromNow); }
java
public BucketEndPoints getEndPoints(final int bucketsFromNow) throws IllegalTimePoint { if (currentNowIdx == -1 || now == null) { throw new IllegalTimePoint("The now is not set yet, thus no end-points can be returned"); } return now.move(bucketsFromNow); }
[ "public", "BucketEndPoints", "getEndPoints", "(", "final", "int", "bucketsFromNow", ")", "throws", "IllegalTimePoint", "{", "if", "(", "currentNowIdx", "==", "-", "1", "||", "now", "==", "null", ")", "{", "throw", "new", "IllegalTimePoint", "(", "\"The now is no...
Gets the end-points by an offset to now, i.e., 0 means to get the now bucket, -1 gets the previous bucket, and +1 will get the next bucket. @param bucketsFromNow the amount of buckets to retrieve using now as anchor @return the end-point (bucket) with an offset of {@code bucketsFromNow} from now @throws IllegalTimeP...
[ "Gets", "the", "end", "-", "points", "by", "an", "offset", "to", "now", "i", ".", "e", ".", "0", "means", "to", "get", "the", "now", "bucket", "-", "1", "gets", "the", "previous", "bucket", "and", "+", "1", "will", "get", "the", "next", "bucket", ...
ec0165a50ec1951ec7730b72c85c801c2018f314
https://github.com/Breinify/brein-time-utilities/blob/ec0165a50ec1951ec7730b72c85c801c2018f314/src/com/brein/time/timeseries/BucketTimeSeries.java#L217-L224
train
Breinify/brein-time-utilities
src/com/brein/time/timeseries/BucketTimeSeries.java
BucketTimeSeries.getBucketSize
public int getBucketSize(final long diffInSeconds) { // convert one unit of this into seconds final long secondsPerBucket = TimeUnit.SECONDS.convert(config.getBucketSize(), config.getTimeUnit()); return (int) Math.ceil((double) diffInSeconds / secondsPerBucket); }
java
public int getBucketSize(final long diffInSeconds) { // convert one unit of this into seconds final long secondsPerBucket = TimeUnit.SECONDS.convert(config.getBucketSize(), config.getTimeUnit()); return (int) Math.ceil((double) diffInSeconds / secondsPerBucket); }
[ "public", "int", "getBucketSize", "(", "final", "long", "diffInSeconds", ")", "{", "// convert one unit of this into seconds", "final", "long", "secondsPerBucket", "=", "TimeUnit", ".", "SECONDS", ".", "convert", "(", "config", ".", "getBucketSize", "(", ")", ",", ...
Determines the number of buckets used to cover the seconds. @param diffInSeconds the difference in seconds @return the amount of buckets used to cover this amount
[ "Determines", "the", "number", "of", "buckets", "used", "to", "cover", "the", "seconds", "." ]
ec0165a50ec1951ec7730b72c85c801c2018f314
https://github.com/Breinify/brein-time-utilities/blob/ec0165a50ec1951ec7730b72c85c801c2018f314/src/com/brein/time/timeseries/BucketTimeSeries.java#L304-L309
train
Breinify/brein-time-utilities
src/com/brein/time/timeseries/BucketTimeSeries.java
BucketTimeSeries.setNow
public void setNow(final long unixTimeStamp) throws IllegalTimePointMovement { /* * "now" strongly depends on the TimeUnit used for the timeSeries, as * well as the bucketSize. If, e.g., the TimeUnit is MINUTES and the * bucketSize is 5, a unix time stamp representing 01/20/1981 08:0...
java
public void setNow(final long unixTimeStamp) throws IllegalTimePointMovement { /* * "now" strongly depends on the TimeUnit used for the timeSeries, as * well as the bucketSize. If, e.g., the TimeUnit is MINUTES and the * bucketSize is 5, a unix time stamp representing 01/20/1981 08:0...
[ "public", "void", "setNow", "(", "final", "long", "unixTimeStamp", ")", "throws", "IllegalTimePointMovement", "{", "/*\n * \"now\" strongly depends on the TimeUnit used for the timeSeries, as\n * well as the bucketSize. If, e.g., the TimeUnit is MINUTES and the\n * buck...
Modifies the "now" unix time stamp of the time-series. This modifies, the time-series, i.e., data might be removed if the data is pushed. @param unixTimeStamp the new now to be used @throws IllegalTimePointMovement if the new unix time stamp it moved into the past, e.g., if the current time stamp is newers
[ "Modifies", "the", "now", "unix", "time", "stamp", "of", "the", "time", "-", "series", ".", "This", "modifies", "the", "time", "-", "series", "i", ".", "e", ".", "data", "might", "be", "removed", "if", "the", "data", "is", "pushed", "." ]
ec0165a50ec1951ec7730b72c85c801c2018f314
https://github.com/Breinify/brein-time-utilities/blob/ec0165a50ec1951ec7730b72c85c801c2018f314/src/com/brein/time/timeseries/BucketTimeSeries.java#L475-L539
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/SerIteratorFactory.java
SerIteratorFactory.createIterable
public SerIterable createIterable(String metaTypeDescription, JodaBeanSer settings, Map<String, Class<?>> knownTypes) { if (metaTypeDescription.equals("Set")) { return set(Object.class, EMPTY_VALUE_TYPES); } if (metaTypeDescription.equals("List")) { return list(Object.cla...
java
public SerIterable createIterable(String metaTypeDescription, JodaBeanSer settings, Map<String, Class<?>> knownTypes) { if (metaTypeDescription.equals("Set")) { return set(Object.class, EMPTY_VALUE_TYPES); } if (metaTypeDescription.equals("List")) { return list(Object.cla...
[ "public", "SerIterable", "createIterable", "(", "String", "metaTypeDescription", ",", "JodaBeanSer", "settings", ",", "Map", "<", "String", ",", "Class", "<", "?", ">", ">", "knownTypes", ")", "{", "if", "(", "metaTypeDescription", ".", "equals", "(", "\"Set\"...
Creates an iterator wrapper for a meta-type description. @param metaTypeDescription the description of the collection type, not null @param settings the settings object, not null @param knownTypes the known types map, null if not using known type shortening @return the iterable, null if not a collection-like type
[ "Creates", "an", "iterator", "wrapper", "for", "a", "meta", "-", "type", "description", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/SerIteratorFactory.java#L191-L234
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/SerIteratorFactory.java
SerIteratorFactory.createIterable
public SerIterable createIterable(SerIterable iterable) { List<Class<?>> valueTypeTypes = iterable.valueTypeTypes(); if (valueTypeTypes.size() > 0) { Class<?> valueType = iterable.valueType(); if (NavigableSet.class.isAssignableFrom(valueType)) { return navigableS...
java
public SerIterable createIterable(SerIterable iterable) { List<Class<?>> valueTypeTypes = iterable.valueTypeTypes(); if (valueTypeTypes.size() > 0) { Class<?> valueType = iterable.valueType(); if (NavigableSet.class.isAssignableFrom(valueType)) { return navigableS...
[ "public", "SerIterable", "createIterable", "(", "SerIterable", "iterable", ")", "{", "List", "<", "Class", "<", "?", ">", ">", "valueTypeTypes", "=", "iterable", ".", "valueTypeTypes", "(", ")", ";", "if", "(", "valueTypeTypes", ".", "size", "(", ")", ">",...
Creates an iterator wrapper for a child where there are second level generic parameters. @param iterable the parent iterable, not null @return the iterable, null if not a collection-like type
[ "Creates", "an", "iterator", "wrapper", "for", "a", "child", "where", "there", "are", "second", "level", "generic", "parameters", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/SerIteratorFactory.java#L242-L285
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/SerIteratorFactory.java
SerIteratorFactory.array
public static final SerIterable array(final Class<?> valueType) { final List<Object> list = new ArrayList<>(); return new SerIterable() { @Override public SerIterator iterator() { return array(build(), Object.class, valueType); } @Override ...
java
public static final SerIterable array(final Class<?> valueType) { final List<Object> list = new ArrayList<>(); return new SerIterable() { @Override public SerIterator iterator() { return array(build(), Object.class, valueType); } @Override ...
[ "public", "static", "final", "SerIterable", "array", "(", "final", "Class", "<", "?", ">", "valueType", ")", "{", "final", "List", "<", "Object", ">", "list", "=", "new", "ArrayList", "<>", "(", ")", ";", "return", "new", "SerIterable", "(", ")", "{", ...
Gets an iterable wrapper for an object array. @param valueType the value type, not null @return the iterable, not null
[ "Gets", "an", "iterable", "wrapper", "for", "an", "object", "array", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/SerIteratorFactory.java#L680-L713
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/SerIteratorFactory.java
SerIteratorFactory.array
public static final SerIterator array( final Object[] array, final Class<?> declaredType, final Class<?> valueType) { return new SerIterator() { private int index = -1; @Override public String metaTypeName() { return metaTypeNameBase(valueType); ...
java
public static final SerIterator array( final Object[] array, final Class<?> declaredType, final Class<?> valueType) { return new SerIterator() { private int index = -1; @Override public String metaTypeName() { return metaTypeNameBase(valueType); ...
[ "public", "static", "final", "SerIterator", "array", "(", "final", "Object", "[", "]", "array", ",", "final", "Class", "<", "?", ">", "declaredType", ",", "final", "Class", "<", "?", ">", "valueType", ")", "{", "return", "new", "SerIterator", "(", ")", ...
Gets an iterator wrapper for an object array. @param array the array, not null @param declaredType the declared type, not null @param valueType the value type, not null @return the iterator, not null
[ "Gets", "an", "iterator", "wrapper", "for", "an", "object", "array", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/SerIteratorFactory.java#L767-L823
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/xml/JodaBeanXmlReader.java
JodaBeanXmlReader.advanceToStartElement
private StartElement advanceToStartElement() throws Exception { while (reader.hasNext()) { XMLEvent event = nextEvent("advnc "); if (event.isStartElement()) { return event.asStartElement(); } } throw new IllegalArgumentException("Unexpected end...
java
private StartElement advanceToStartElement() throws Exception { while (reader.hasNext()) { XMLEvent event = nextEvent("advnc "); if (event.isStartElement()) { return event.asStartElement(); } } throw new IllegalArgumentException("Unexpected end...
[ "private", "StartElement", "advanceToStartElement", "(", ")", "throws", "Exception", "{", "while", "(", "reader", ".", "hasNext", "(", ")", ")", "{", "XMLEvent", "event", "=", "nextEvent", "(", "\"advnc \"", ")", ";", "if", "(", "event", ".", "isStartElement...
reader can be anywhere, but normally at StartDocument
[ "reader", "can", "be", "anywhere", "but", "normally", "at", "StartDocument" ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/xml/JodaBeanXmlReader.java#L480-L488
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/xml/JodaBeanXmlReader.java
JodaBeanXmlReader.advanceAndParseText
private String advanceAndParseText() throws Exception { StringBuilder buf = new StringBuilder(); while (reader.hasNext()) { XMLEvent event = nextEvent("text "); if (event.isCharacters()) { buf.append(event.asCharacters().getData()); } else if (event.i...
java
private String advanceAndParseText() throws Exception { StringBuilder buf = new StringBuilder(); while (reader.hasNext()) { XMLEvent event = nextEvent("text "); if (event.isCharacters()) { buf.append(event.asCharacters().getData()); } else if (event.i...
[ "private", "String", "advanceAndParseText", "(", ")", "throws", "Exception", "{", "StringBuilder", "buf", "=", "new", "StringBuilder", "(", ")", ";", "while", "(", "reader", ".", "hasNext", "(", ")", ")", "{", "XMLEvent", "event", "=", "nextEvent", "(", "\...
reader must be at StartElement
[ "reader", "must", "be", "at", "StartElement" ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/xml/JodaBeanXmlReader.java#L491-L504
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/xml/JodaBeanXmlReader.java
JodaBeanXmlReader.nextEvent
private XMLEvent nextEvent(String location) throws Exception { XMLEvent event = reader.nextEvent(); // System.out.println(location + event.toString().replace('\n', ' ') + " " + event.getClass().getSimpleName()); return event; }
java
private XMLEvent nextEvent(String location) throws Exception { XMLEvent event = reader.nextEvent(); // System.out.println(location + event.toString().replace('\n', ' ') + " " + event.getClass().getSimpleName()); return event; }
[ "private", "XMLEvent", "nextEvent", "(", "String", "location", ")", "throws", "Exception", "{", "XMLEvent", "event", "=", "reader", ".", "nextEvent", "(", ")", ";", "// System.out.println(location + event.toString().replace('\\n', ' ') + \" \" + event.getClass().getSimpl...
provide for debugging
[ "provide", "for", "debugging" ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/xml/JodaBeanXmlReader.java#L507-L511
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/JodaBeanSer.java
JodaBeanSer.withIndent
public JodaBeanSer withIndent(String indent) { JodaBeanUtils.notNull(indent, "indent"); return new JodaBeanSer(indent, newLine, converter, iteratorFactory, shortTypes, deserializers, includeDerived); }
java
public JodaBeanSer withIndent(String indent) { JodaBeanUtils.notNull(indent, "indent"); return new JodaBeanSer(indent, newLine, converter, iteratorFactory, shortTypes, deserializers, includeDerived); }
[ "public", "JodaBeanSer", "withIndent", "(", "String", "indent", ")", "{", "JodaBeanUtils", ".", "notNull", "(", "indent", ",", "\"indent\"", ")", ";", "return", "new", "JodaBeanSer", "(", "indent", ",", "newLine", ",", "converter", ",", "iteratorFactory", ",",...
Returns a copy of this serializer with the specified pretty print indent. @param indent the indent, not null @return a copy of this object with the indent changed, not null
[ "Returns", "a", "copy", "of", "this", "serializer", "with", "the", "specified", "pretty", "print", "indent", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/JodaBeanSer.java#L117-L120
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/JodaBeanSer.java
JodaBeanSer.withNewLine
public JodaBeanSer withNewLine(String newLine) { JodaBeanUtils.notNull(newLine, "newLine"); return new JodaBeanSer(indent, newLine, converter, iteratorFactory, shortTypes, deserializers, includeDerived); }
java
public JodaBeanSer withNewLine(String newLine) { JodaBeanUtils.notNull(newLine, "newLine"); return new JodaBeanSer(indent, newLine, converter, iteratorFactory, shortTypes, deserializers, includeDerived); }
[ "public", "JodaBeanSer", "withNewLine", "(", "String", "newLine", ")", "{", "JodaBeanUtils", ".", "notNull", "(", "newLine", ",", "\"newLine\"", ")", ";", "return", "new", "JodaBeanSer", "(", "indent", ",", "newLine", ",", "converter", ",", "iteratorFactory", ...
Returns a copy of this serializer with the specified pretty print new line. @param newLine the new line, not null @return a copy of this object with the new line changed, not null
[ "Returns", "a", "copy", "of", "this", "serializer", "with", "the", "specified", "pretty", "print", "new", "line", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/JodaBeanSer.java#L137-L140
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/JodaBeanSer.java
JodaBeanSer.withIteratorFactory
public JodaBeanSer withIteratorFactory(SerIteratorFactory iteratorFactory) { JodaBeanUtils.notNull(iteratorFactory, "iteratorFactory"); return new JodaBeanSer(indent, newLine, converter, iteratorFactory, shortTypes, deserializers, includeDerived); }
java
public JodaBeanSer withIteratorFactory(SerIteratorFactory iteratorFactory) { JodaBeanUtils.notNull(iteratorFactory, "iteratorFactory"); return new JodaBeanSer(indent, newLine, converter, iteratorFactory, shortTypes, deserializers, includeDerived); }
[ "public", "JodaBeanSer", "withIteratorFactory", "(", "SerIteratorFactory", "iteratorFactory", ")", "{", "JodaBeanUtils", ".", "notNull", "(", "iteratorFactory", ",", "\"iteratorFactory\"", ")", ";", "return", "new", "JodaBeanSer", "(", "indent", ",", "newLine", ",", ...
Returns a copy of this serializer with the specified iterator factory. @param iteratorFactory the iterator factory, not null @return a copy of this object with the iterator factory changed, not null
[ "Returns", "a", "copy", "of", "this", "serializer", "with", "the", "specified", "iterator", "factory", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/JodaBeanSer.java#L181-L184
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/JodaBeanSer.java
JodaBeanSer.withShortTypes
public JodaBeanSer withShortTypes(boolean shortTypes) { return new JodaBeanSer(indent, newLine, converter, iteratorFactory, shortTypes, deserializers, includeDerived); }
java
public JodaBeanSer withShortTypes(boolean shortTypes) { return new JodaBeanSer(indent, newLine, converter, iteratorFactory, shortTypes, deserializers, includeDerived); }
[ "public", "JodaBeanSer", "withShortTypes", "(", "boolean", "shortTypes", ")", "{", "return", "new", "JodaBeanSer", "(", "indent", ",", "newLine", ",", "converter", ",", "iteratorFactory", ",", "shortTypes", ",", "deserializers", ",", "includeDerived", ")", ";", ...
Returns a copy of this serializer with the short types flag set. @param shortTypes whether to use short types, not null @return a copy of this object with the short types flag changed, not null
[ "Returns", "a", "copy", "of", "this", "serializer", "with", "the", "short", "types", "flag", "set", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/JodaBeanSer.java#L201-L203
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/JodaBeanSer.java
JodaBeanSer.isSerialized
public boolean isSerialized(MetaProperty<?> prop) { return prop.style().isSerializable() || (prop.style().isDerived() && includeDerived); }
java
public boolean isSerialized(MetaProperty<?> prop) { return prop.style().isSerializable() || (prop.style().isDerived() && includeDerived); }
[ "public", "boolean", "isSerialized", "(", "MetaProperty", "<", "?", ">", "prop", ")", "{", "return", "prop", ".", "style", "(", ")", ".", "isSerializable", "(", ")", "||", "(", "prop", ".", "style", "(", ")", ".", "isDerived", "(", ")", "&&", "includ...
Checks if the property is serialized. @param prop the property to check @return true if the property is seialized
[ "Checks", "if", "the", "property", "is", "serialized", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/JodaBeanSer.java#L263-L265
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/impl/BasicProperty.java
BasicProperty.of
public static <P> BasicProperty<P> of(Bean bean, MetaProperty<P> metaProperty) { return new BasicProperty<>(bean, metaProperty); }
java
public static <P> BasicProperty<P> of(Bean bean, MetaProperty<P> metaProperty) { return new BasicProperty<>(bean, metaProperty); }
[ "public", "static", "<", "P", ">", "BasicProperty", "<", "P", ">", "of", "(", "Bean", "bean", ",", "MetaProperty", "<", "P", ">", "metaProperty", ")", "{", "return", "new", "BasicProperty", "<>", "(", "bean", ",", "metaProperty", ")", ";", "}" ]
Factory to create a property avoiding duplicate generics. @param <P> the property type @param bean the bean that the property is bound to, not null @param metaProperty the meta property, not null @return the property, not null
[ "Factory", "to", "create", "a", "property", "avoiding", "duplicate", "generics", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/impl/BasicProperty.java#L47-L49
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/json/JsonOutput.java
JsonOutput.writeInt
void writeInt(int value) throws IOException { if ((value & 0xfffffff8) == 0) { output.append((char) (value + 48)); } else { output.append(Integer.toString(value)); } }
java
void writeInt(int value) throws IOException { if ((value & 0xfffffff8) == 0) { output.append((char) (value + 48)); } else { output.append(Integer.toString(value)); } }
[ "void", "writeInt", "(", "int", "value", ")", "throws", "IOException", "{", "if", "(", "(", "value", "&", "0xfffffff8", ")", "==", "0", ")", "{", "output", ".", "append", "(", "(", "char", ")", "(", "value", "+", "48", ")", ")", ";", "}", "else",...
Writes a JSON int. @param value the value @throws IOException if an error occurs
[ "Writes", "a", "JSON", "int", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/json/JsonOutput.java#L120-L126
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/json/JsonOutput.java
JsonOutput.writeString
void writeString(String value) throws IOException { output.append('"'); for (int i = 0; i < value.length(); i++) { char ch = value.charAt(i); if (ch < 128) { String replace = REPLACE[ch]; if (replace != null) { output.append(rep...
java
void writeString(String value) throws IOException { output.append('"'); for (int i = 0; i < value.length(); i++) { char ch = value.charAt(i); if (ch < 128) { String replace = REPLACE[ch]; if (replace != null) { output.append(rep...
[ "void", "writeString", "(", "String", "value", ")", "throws", "IOException", "{", "output", ".", "append", "(", "'", "'", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "value", ".", "length", "(", ")", ";", "i", "++", ")", "{", "ch...
Writes a JSON string. @param value the value @throws IOException if an error occurs
[ "Writes", "a", "JSON", "string", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/json/JsonOutput.java#L177-L197
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/json/JsonOutput.java
JsonOutput.writeArrayItemStart
void writeArrayItemStart() throws IOException { if (commaState.get(commaDepth)) { output.append(','); if (newLine.length() > 0) { output.append(' '); } } else { commaState.set(commaDepth); } }
java
void writeArrayItemStart() throws IOException { if (commaState.get(commaDepth)) { output.append(','); if (newLine.length() > 0) { output.append(' '); } } else { commaState.set(commaDepth); } }
[ "void", "writeArrayItemStart", "(", ")", "throws", "IOException", "{", "if", "(", "commaState", ".", "get", "(", "commaDepth", ")", ")", "{", "output", ".", "append", "(", "'", "'", ")", ";", "if", "(", "newLine", ".", "length", "(", ")", ">", "0", ...
Writes a JSON array item start. @throws IOException if an error occurs
[ "Writes", "a", "JSON", "array", "item", "start", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/json/JsonOutput.java#L216-L225
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/json/JsonOutput.java
JsonOutput.writeObjectStart
void writeObjectStart() throws IOException { output.append('{'); currentIndent = currentIndent + indent; commaDepth++; commaState.set(commaDepth, false); }
java
void writeObjectStart() throws IOException { output.append('{'); currentIndent = currentIndent + indent; commaDepth++; commaState.set(commaDepth, false); }
[ "void", "writeObjectStart", "(", ")", "throws", "IOException", "{", "output", ".", "append", "(", "'", "'", ")", ";", "currentIndent", "=", "currentIndent", "+", "indent", ";", "commaDepth", "++", ";", "commaState", ".", "set", "(", "commaDepth", ",", "fal...
Writes a JSON object start. @throws IOException if an error occurs
[ "Writes", "a", "JSON", "object", "start", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/json/JsonOutput.java#L243-L248
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/json/JsonOutput.java
JsonOutput.writeObjectKeyValue
void writeObjectKeyValue(String key, String value) throws IOException { writeObjectKey(key); writeString(value); }
java
void writeObjectKeyValue(String key, String value) throws IOException { writeObjectKey(key); writeString(value); }
[ "void", "writeObjectKeyValue", "(", "String", "key", ",", "String", "value", ")", "throws", "IOException", "{", "writeObjectKey", "(", "key", ")", ";", "writeString", "(", "value", ")", ";", "}" ]
Writes a JSON object key and value. @param key the item key @param value the item value @throws IOException if an error occurs
[ "Writes", "a", "JSON", "object", "key", "and", "value", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/json/JsonOutput.java#L280-L283
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/json/JsonOutput.java
JsonOutput.writeObjectEnd
void writeObjectEnd() throws IOException { currentIndent = currentIndent.substring(0, currentIndent.length() - indent.length()); if (commaState.get(commaDepth)) { output.append(newLine); output.append(currentIndent); } output.append('}'); commaDepth--; ...
java
void writeObjectEnd() throws IOException { currentIndent = currentIndent.substring(0, currentIndent.length() - indent.length()); if (commaState.get(commaDepth)) { output.append(newLine); output.append(currentIndent); } output.append('}'); commaDepth--; ...
[ "void", "writeObjectEnd", "(", ")", "throws", "IOException", "{", "currentIndent", "=", "currentIndent", ".", "substring", "(", "0", ",", "currentIndent", ".", "length", "(", ")", "-", "indent", ".", "length", "(", ")", ")", ";", "if", "(", "commaState", ...
Writes a JSON object end. @throws IOException if an error occurs
[ "Writes", "a", "JSON", "object", "end", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/json/JsonOutput.java#L290-L298
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/SerOptional.java
SerOptional.wrapValue
public static Object wrapValue(MetaProperty<?> metaProp, Class<?> beanType, Object value) { Object[] helpers = OPTIONALS.get(metaProp.propertyType()); if (helpers != null) { try { if (value != null) { value = ((Method) helpers[0]).invoke(null, value); ...
java
public static Object wrapValue(MetaProperty<?> metaProp, Class<?> beanType, Object value) { Object[] helpers = OPTIONALS.get(metaProp.propertyType()); if (helpers != null) { try { if (value != null) { value = ((Method) helpers[0]).invoke(null, value); ...
[ "public", "static", "Object", "wrapValue", "(", "MetaProperty", "<", "?", ">", "metaProp", ",", "Class", "<", "?", ">", "beanType", ",", "Object", "value", ")", "{", "Object", "[", "]", "helpers", "=", "OPTIONALS", ".", "get", "(", "metaProp", ".", "pr...
Wraps the value of a property if it is an optional. @param metaProp the property to query, not null @param beanType the type of the bean, not null @param value the value to wrap, may be null @return the value of the property, with any optional wrapper added
[ "Wraps", "the", "value", "of", "a", "property", "if", "it", "is", "an", "optional", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/SerOptional.java#L151-L165
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/SerDeserializers.java
SerDeserializers.register
public SerDeserializers register(Class<?> type, SerDeserializer deserializer) { deserializers.put(type, deserializer); return this; }
java
public SerDeserializers register(Class<?> type, SerDeserializer deserializer) { deserializers.put(type, deserializer); return this; }
[ "public", "SerDeserializers", "register", "(", "Class", "<", "?", ">", "type", ",", "SerDeserializer", "deserializer", ")", "{", "deserializers", ".", "put", "(", "type", ",", "deserializer", ")", ";", "return", "this", ";", "}" ]
Adds the deserializer to be used for the specified type. @param type the type, not null @param deserializer the deserializer, not null @return this, for chaining, not null
[ "Adds", "the", "deserializer", "to", "be", "used", "for", "the", "specified", "type", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/SerDeserializers.java#L134-L137
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/SerDeserializers.java
SerDeserializers.decodeType
public Class<?> decodeType( String typeStr, JodaBeanSer settings, String basePackage, Map<String, Class<?>> knownTypes, Class<?> defaultType) throws ClassNotFoundException { if (lenient) { return SerTypeMapper.decodeType( ...
java
public Class<?> decodeType( String typeStr, JodaBeanSer settings, String basePackage, Map<String, Class<?>> knownTypes, Class<?> defaultType) throws ClassNotFoundException { if (lenient) { return SerTypeMapper.decodeType( ...
[ "public", "Class", "<", "?", ">", "decodeType", "(", "String", "typeStr", ",", "JodaBeanSer", "settings", ",", "String", "basePackage", ",", "Map", "<", "String", ",", "Class", "<", "?", ">", ">", "knownTypes", ",", "Class", "<", "?", ">", "defaultType",...
Decodes the type @param typeStr the type, not null @param settings the settings, not null @param basePackage the base package, not null @param knownTypes the known types, not null @param defaultType the default type, not null @return the decoded type @throws ClassNotFoundException if the class is not found
[ "Decodes", "the", "type" ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/SerDeserializers.java#L194-L206
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/SerDeserializers.java
SerDeserializers.registerFromClasspath
private static void registerFromClasspath( String beanName, String deserName, Map<Class<?>, SerDeserializer> map) throws Exception { Class<? extends Bean> beanClass = Class.forName(beanName).asSubclass(Bean.class); Class<?> deserClass = Class.forName(deserName); Field field = null;...
java
private static void registerFromClasspath( String beanName, String deserName, Map<Class<?>, SerDeserializer> map) throws Exception { Class<? extends Bean> beanClass = Class.forName(beanName).asSubclass(Bean.class); Class<?> deserClass = Class.forName(deserName); Field field = null;...
[ "private", "static", "void", "registerFromClasspath", "(", "String", "beanName", ",", "String", "deserName", ",", "Map", "<", "Class", "<", "?", ">", ",", "SerDeserializer", ">", "map", ")", "throws", "Exception", "{", "Class", "<", "?", "extends", "Bean", ...
parses and registers the classes
[ "parses", "and", "registers", "the", "classes" ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/SerDeserializers.java#L266-L297
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/SerDeserializers.java
SerDeserializers.toLenient
private static SerDeserializer toLenient(SerDeserializer underlying) { return new SerDeserializer() { @Override public MetaBean findMetaBean(Class<?> beanType) { return underlying.findMetaBean(beanType); } @Override public BeanBuilder...
java
private static SerDeserializer toLenient(SerDeserializer underlying) { return new SerDeserializer() { @Override public MetaBean findMetaBean(Class<?> beanType) { return underlying.findMetaBean(beanType); } @Override public BeanBuilder...
[ "private", "static", "SerDeserializer", "toLenient", "(", "SerDeserializer", "underlying", ")", "{", "return", "new", "SerDeserializer", "(", ")", "{", "@", "Override", "public", "MetaBean", "findMetaBean", "(", "Class", "<", "?", ">", "beanType", ")", "{", "r...
makes the deserializer lenient
[ "makes", "the", "deserializer", "lenient" ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/SerDeserializers.java#L300-L333
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/impl/flexi/FlexiBean.java
FlexiBean.dataWritable
private Map<String, Object> dataWritable() { if (data == Collections.EMPTY_MAP) { data = new LinkedHashMap<>(); } return data; }
java
private Map<String, Object> dataWritable() { if (data == Collections.EMPTY_MAP) { data = new LinkedHashMap<>(); } return data; }
[ "private", "Map", "<", "String", ",", "Object", ">", "dataWritable", "(", ")", "{", "if", "(", "data", "==", "Collections", ".", "EMPTY_MAP", ")", "{", "data", "=", "new", "LinkedHashMap", "<>", "(", ")", ";", "}", "return", "data", ";", "}" ]
Gets the internal data map. @return the data, not null
[ "Gets", "the", "internal", "data", "map", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/impl/flexi/FlexiBean.java#L97-L102
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/impl/flexi/FlexiBean.java
FlexiBean.toMap
public Map<String, Object> toMap() { if (size() == 0) { return Collections.emptyMap(); } return Collections.unmodifiableMap(new LinkedHashMap<>(data)); }
java
public Map<String, Object> toMap() { if (size() == 0) { return Collections.emptyMap(); } return Collections.unmodifiableMap(new LinkedHashMap<>(data)); }
[ "public", "Map", "<", "String", ",", "Object", ">", "toMap", "(", ")", "{", "if", "(", "size", "(", ")", "==", "0", ")", "{", "return", "Collections", ".", "emptyMap", "(", ")", ";", "}", "return", "Collections", ".", "unmodifiableMap", "(", "new", ...
Returns a map representing the contents of the bean. @return a map representing the contents of the bean, not null
[ "Returns", "a", "map", "representing", "the", "contents", "of", "the", "bean", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/impl/flexi/FlexiBean.java#L424-L429
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/impl/light/LightMetaBean.java
LightMetaBean.build
@Deprecated private T build(Constructor<T> constructor, Object[] args) { try { return constructor.newInstance(args); } catch (IllegalArgumentException | IllegalAccessException | InstantiationException ex) { throw new IllegalArgumentException( "Bean cannot...
java
@Deprecated private T build(Constructor<T> constructor, Object[] args) { try { return constructor.newInstance(args); } catch (IllegalArgumentException | IllegalAccessException | InstantiationException ex) { throw new IllegalArgumentException( "Bean cannot...
[ "@", "Deprecated", "private", "T", "build", "(", "Constructor", "<", "T", ">", "constructor", ",", "Object", "[", "]", "args", ")", "{", "try", "{", "return", "constructor", ".", "newInstance", "(", "args", ")", ";", "}", "catch", "(", "IllegalArgumentEx...
Creates an instance of the bean. @param constructor the constructor @param args the arguments @return the created instance @deprecated Use method handles version of this method
[ "Creates", "an", "instance", "of", "the", "bean", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/impl/light/LightMetaBean.java#L197-L211
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/impl/light/LightMetaBean.java
LightMetaBean.fieldNames
private static String[] fieldNames(Class<?> beanType) { Field[] fields = Stream.of(beanType.getDeclaredFields()) .filter(f -> !Modifier.isStatic(f.getModifiers()) && f.getAnnotation(PropertyDefinition.class) != null) .toArray(Field[]::new); List<String> fieldNames = new A...
java
private static String[] fieldNames(Class<?> beanType) { Field[] fields = Stream.of(beanType.getDeclaredFields()) .filter(f -> !Modifier.isStatic(f.getModifiers()) && f.getAnnotation(PropertyDefinition.class) != null) .toArray(Field[]::new); List<String> fieldNames = new A...
[ "private", "static", "String", "[", "]", "fieldNames", "(", "Class", "<", "?", ">", "beanType", ")", "{", "Field", "[", "]", "fields", "=", "Stream", ".", "of", "(", "beanType", ".", "getDeclaredFields", "(", ")", ")", ".", "filter", "(", "f", "->", ...
determine the field names by reflection
[ "determine", "the", "field", "names", "by", "reflection" ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/impl/light/LightMetaBean.java#L266-L275
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/json/JsonInput.java
JsonInput.readEvent
JsonEvent readEvent() throws IOException { char next = readNext(); // whitespace while (next == ' ' || next == '\t' || next == '\n' || next == '\r') { next = readNext(); } // identify token switch (next) { case '{': return JsonEvent...
java
JsonEvent readEvent() throws IOException { char next = readNext(); // whitespace while (next == ' ' || next == '\t' || next == '\n' || next == '\r') { next = readNext(); } // identify token switch (next) { case '{': return JsonEvent...
[ "JsonEvent", "readEvent", "(", ")", "throws", "IOException", "{", "char", "next", "=", "readNext", "(", ")", ";", "// whitespace", "while", "(", "next", "==", "'", "'", "||", "next", "==", "'", "'", "||", "next", "==", "'", "'", "||", "next", "==", ...
Writes a JSON null. @throws IOException if an error occurs
[ "Writes", "a", "JSON", "null", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/json/JsonInput.java#L82-L125
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/json/JsonInput.java
JsonInput.acceptObjectKey
String acceptObjectKey(JsonEvent event) throws IOException { ensureEvent(event, JsonEvent.STRING); return parseObjectKey(); }
java
String acceptObjectKey(JsonEvent event) throws IOException { ensureEvent(event, JsonEvent.STRING); return parseObjectKey(); }
[ "String", "acceptObjectKey", "(", "JsonEvent", "event", ")", "throws", "IOException", "{", "ensureEvent", "(", "event", ",", "JsonEvent", ".", "STRING", ")", ";", "return", "parseObjectKey", "(", ")", ";", "}" ]
expect object key and parse it
[ "expect", "object", "key", "and", "parse", "it" ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/json/JsonInput.java#L150-L153
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/json/JsonInput.java
JsonInput.acceptObjectSeparator
JsonEvent acceptObjectSeparator() throws IOException { JsonEvent event = readEvent(); if (event == JsonEvent.COMMA) { return readEvent(); // leniently allow comma before objectEnd } else { return ensureEvent(event, JsonEvent.OBJECT_END); } }
java
JsonEvent acceptObjectSeparator() throws IOException { JsonEvent event = readEvent(); if (event == JsonEvent.COMMA) { return readEvent(); // leniently allow comma before objectEnd } else { return ensureEvent(event, JsonEvent.OBJECT_END); } }
[ "JsonEvent", "acceptObjectSeparator", "(", ")", "throws", "IOException", "{", "JsonEvent", "event", "=", "readEvent", "(", ")", ";", "if", "(", "event", "==", "JsonEvent", ".", "COMMA", ")", "{", "return", "readEvent", "(", ")", ";", "// leniently allow comma ...
accepts a comma or object end
[ "accepts", "a", "comma", "or", "object", "end" ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/json/JsonInput.java#L363-L370
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/json/JsonInput.java
JsonInput.acceptArraySeparator
JsonEvent acceptArraySeparator() throws IOException { JsonEvent event = readEvent(); if (event == JsonEvent.COMMA) { return readEvent(); // leniently allow comma before arrayEnd } else { return ensureEvent(event, JsonEvent.ARRAY_END); } }
java
JsonEvent acceptArraySeparator() throws IOException { JsonEvent event = readEvent(); if (event == JsonEvent.COMMA) { return readEvent(); // leniently allow comma before arrayEnd } else { return ensureEvent(event, JsonEvent.ARRAY_END); } }
[ "JsonEvent", "acceptArraySeparator", "(", ")", "throws", "IOException", "{", "JsonEvent", "event", "=", "readEvent", "(", ")", ";", "if", "(", "event", "==", "JsonEvent", ".", "COMMA", ")", "{", "return", "readEvent", "(", ")", ";", "// leniently allow comma b...
accepts a comma or array end
[ "accepts", "a", "comma", "or", "array", "end" ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/json/JsonInput.java#L373-L380
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/gen/BeanData.java
BeanData.ensureImport
public void ensureImport(Class<?> cls) { if (currentImports.contains(cls.getName()) == false) { newImports.add(cls.getName()); } }
java
public void ensureImport(Class<?> cls) { if (currentImports.contains(cls.getName()) == false) { newImports.add(cls.getName()); } }
[ "public", "void", "ensureImport", "(", "Class", "<", "?", ">", "cls", ")", "{", "if", "(", "currentImports", ".", "contains", "(", "cls", ".", "getName", "(", ")", ")", "==", "false", ")", "{", "newImports", ".", "add", "(", "cls", ".", "getName", ...
Ensures an import is present. @param cls the class, not null
[ "Ensures", "an", "import", "is", "present", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/gen/BeanData.java#L121-L125
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/gen/BeanData.java
BeanData.getEffectiveMetaScope
public String getEffectiveMetaScope() { String scope = beanMetaScope; if ("smart".equals(scope)) { scope = typeScope; } return "package".equals(scope) ? "" : scope + " "; }
java
public String getEffectiveMetaScope() { String scope = beanMetaScope; if ("smart".equals(scope)) { scope = typeScope; } return "package".equals(scope) ? "" : scope + " "; }
[ "public", "String", "getEffectiveMetaScope", "(", ")", "{", "String", "scope", "=", "beanMetaScope", ";", "if", "(", "\"smart\"", ".", "equals", "(", "scope", ")", ")", "{", "scope", "=", "typeScope", ";", "}", "return", "\"package\"", ".", "equals", "(", ...
Gets the effective scope to use in the meta. @return the scope
[ "Gets", "the", "effective", "scope", "to", "use", "in", "the", "meta", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/gen/BeanData.java#L251-L257
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/gen/BeanData.java
BeanData.getEffectiveBuilderScope
public String getEffectiveBuilderScope() { String scope = beanBuilderScope; if ("smart".equals(scope)) { scope = typeScope; } return "package".equals(scope) ? "" : scope + " "; }
java
public String getEffectiveBuilderScope() { String scope = beanBuilderScope; if ("smart".equals(scope)) { scope = typeScope; } return "package".equals(scope) ? "" : scope + " "; }
[ "public", "String", "getEffectiveBuilderScope", "(", ")", "{", "String", "scope", "=", "beanBuilderScope", ";", "if", "(", "\"smart\"", ".", "equals", "(", "scope", ")", ")", "{", "scope", "=", "typeScope", ";", "}", "return", "\"package\"", ".", "equals", ...
Gets the effective scope to use in the builder. @return the scope
[ "Gets", "the", "effective", "scope", "to", "use", "in", "the", "builder", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/gen/BeanData.java#L299-L305
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/gen/BeanData.java
BeanData.isConstructorScopeValid
public boolean isConstructorScopeValid() { return "smart".equals(constructorScope) || "private".equals(constructorScope) || "package".equals(constructorScope) || "protected".equals(constructorScope) || "public".equals(constructorScope) || ...
java
public boolean isConstructorScopeValid() { return "smart".equals(constructorScope) || "private".equals(constructorScope) || "package".equals(constructorScope) || "protected".equals(constructorScope) || "public".equals(constructorScope) || ...
[ "public", "boolean", "isConstructorScopeValid", "(", ")", "{", "return", "\"smart\"", ".", "equals", "(", "constructorScope", ")", "||", "\"private\"", ".", "equals", "(", "constructorScope", ")", "||", "\"package\"", ".", "equals", "(", "constructorScope", ")", ...
Is the constructor scope valid. @return true if valid
[ "Is", "the", "constructor", "scope", "valid", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/gen/BeanData.java#L537-L544
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/gen/BeanData.java
BeanData.getEffectiveConstructorScope
public String getEffectiveConstructorScope() { if ("smart".equals(constructorScope)) { return isTypeFinal() ? "private " : "protected "; } else if ("package".equals(constructorScope)) { return ""; } else if ("public@ConstructorProperties".equals(constructorScope)) { ...
java
public String getEffectiveConstructorScope() { if ("smart".equals(constructorScope)) { return isTypeFinal() ? "private " : "protected "; } else if ("package".equals(constructorScope)) { return ""; } else if ("public@ConstructorProperties".equals(constructorScope)) { ...
[ "public", "String", "getEffectiveConstructorScope", "(", ")", "{", "if", "(", "\"smart\"", ".", "equals", "(", "constructorScope", ")", ")", "{", "return", "isTypeFinal", "(", ")", "?", "\"private \"", ":", "\"protected \"", ";", "}", "else", "if", "(", "\"p...
Gets the effective scope to use in the constructor. @return the scope
[ "Gets", "the", "effective", "scope", "to", "use", "in", "the", "constructor", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/gen/BeanData.java#L550-L559
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/gen/BeanData.java
BeanData.setTypeParts
public void setTypeParts(String[] parts) { this.typeFinal = parts[0] != null; this.typeScope = parts[1]; this.typeFull = parts[2]; this.typeRaw = parts[3]; if (parts[8] != null) { this.typeGenericName = new String[] {parts[4], parts[6], parts[8]}; this.typ...
java
public void setTypeParts(String[] parts) { this.typeFinal = parts[0] != null; this.typeScope = parts[1]; this.typeFull = parts[2]; this.typeRaw = parts[3]; if (parts[8] != null) { this.typeGenericName = new String[] {parts[4], parts[6], parts[8]}; this.typ...
[ "public", "void", "setTypeParts", "(", "String", "[", "]", "parts", ")", "{", "this", ".", "typeFinal", "=", "parts", "[", "0", "]", "!=", "null", ";", "this", ".", "typeScope", "=", "parts", "[", "1", "]", ";", "this", ".", "typeFull", "=", "parts...
Sets the bean type. @param parts the type to set
[ "Sets", "the", "bean", "type", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/gen/BeanData.java#L687-L711
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/gen/BeanData.java
BeanData.setSuperTypeParts
public void setSuperTypeParts(String[] parts) { if (parts.length == 1) { this.root = true; this.immutable = "ImmutableBean".equals(parts[0]); this.superTypeFull = ""; this.superTypeRaw = ""; this.superTypeGeneric = ""; } else { this...
java
public void setSuperTypeParts(String[] parts) { if (parts.length == 1) { this.root = true; this.immutable = "ImmutableBean".equals(parts[0]); this.superTypeFull = ""; this.superTypeRaw = ""; this.superTypeGeneric = ""; } else { this...
[ "public", "void", "setSuperTypeParts", "(", "String", "[", "]", "parts", ")", "{", "if", "(", "parts", ".", "length", "==", "1", ")", "{", "this", ".", "root", "=", "true", ";", "this", ".", "immutable", "=", "\"ImmutableBean\"", ".", "equals", "(", ...
Sets the bean superclass type. @param parts the superclass to set
[ "Sets", "the", "bean", "superclass", "type", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/gen/BeanData.java#L717-L739
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/gen/BeanData.java
BeanData.isTypeGenerifiedBy
public boolean isTypeGenerifiedBy(String type) { if (typeGenericName.length > 2 && typeGenericName[2].equals(type)) { return true; } if (typeGenericName.length > 1 && typeGenericName[1].equals(type)) { return true; } if (typeGenericName.length > 0 && typeG...
java
public boolean isTypeGenerifiedBy(String type) { if (typeGenericName.length > 2 && typeGenericName[2].equals(type)) { return true; } if (typeGenericName.length > 1 && typeGenericName[1].equals(type)) { return true; } if (typeGenericName.length > 0 && typeG...
[ "public", "boolean", "isTypeGenerifiedBy", "(", "String", "type", ")", "{", "if", "(", "typeGenericName", ".", "length", ">", "2", "&&", "typeGenericName", "[", "2", "]", ".", "equals", "(", "type", ")", ")", "{", "return", "true", ";", "}", "if", "(",...
Checks if the type specified is one of the bean's type parameters. @param type the type @return true if a type parameter of this bean
[ "Checks", "if", "the", "type", "specified", "is", "one", "of", "the", "bean", "s", "type", "parameters", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/gen/BeanData.java#L963-L974
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/impl/direct/DirectMetaProperty.java
DirectMetaProperty.ofReadWrite
public static <P> DirectMetaProperty<P> ofReadWrite( MetaBean metaBean, String propertyName, Class<?> declaringType, Class<P> propertyType) { Field field = findField(metaBean, propertyName); return new DirectMetaProperty<>(metaBean, propertyName, declaringType, propertyType, PropertyStyle...
java
public static <P> DirectMetaProperty<P> ofReadWrite( MetaBean metaBean, String propertyName, Class<?> declaringType, Class<P> propertyType) { Field field = findField(metaBean, propertyName); return new DirectMetaProperty<>(metaBean, propertyName, declaringType, propertyType, PropertyStyle...
[ "public", "static", "<", "P", ">", "DirectMetaProperty", "<", "P", ">", "ofReadWrite", "(", "MetaBean", "metaBean", ",", "String", "propertyName", ",", "Class", "<", "?", ">", "declaringType", ",", "Class", "<", "P", ">", "propertyType", ")", "{", "Field",...
Factory to create a read-write meta-property avoiding duplicate generics. @param <P> the property type @param metaBean the meta-bean, not null @param propertyName the property name, not empty @param declaringType the type declaring the property, not null @param propertyType the property type, not null @return the...
[ "Factory", "to", "create", "a", "read", "-", "write", "meta", "-", "property", "avoiding", "duplicate", "generics", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/impl/direct/DirectMetaProperty.java#L61-L65
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/impl/direct/DirectMetaProperty.java
DirectMetaProperty.ofReadOnly
public static <P> DirectMetaProperty<P> ofReadOnly( MetaBean metaBean, String propertyName, Class<?> declaringType, Class<P> propertyType) { Field field = findField(metaBean, propertyName); return new DirectMetaProperty<>(metaBean, propertyName, declaringType, propertyType, PropertyStyle....
java
public static <P> DirectMetaProperty<P> ofReadOnly( MetaBean metaBean, String propertyName, Class<?> declaringType, Class<P> propertyType) { Field field = findField(metaBean, propertyName); return new DirectMetaProperty<>(metaBean, propertyName, declaringType, propertyType, PropertyStyle....
[ "public", "static", "<", "P", ">", "DirectMetaProperty", "<", "P", ">", "ofReadOnly", "(", "MetaBean", "metaBean", ",", "String", "propertyName", ",", "Class", "<", "?", ">", "declaringType", ",", "Class", "<", "P", ">", "propertyType", ")", "{", "Field", ...
Factory to create a read-only meta-property avoiding duplicate generics. @param <P> the property type @param metaBean the meta-bean, not null @param propertyName the property name, not empty @param declaringType the type declaring the property, not null @param propertyType the property type, not null @return the ...
[ "Factory", "to", "create", "a", "read", "-", "only", "meta", "-", "property", "avoiding", "duplicate", "generics", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/impl/direct/DirectMetaProperty.java#L77-L81
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/impl/direct/DirectMetaProperty.java
DirectMetaProperty.ofWriteOnly
public static <P> DirectMetaProperty<P> ofWriteOnly( MetaBean metaBean, String propertyName, Class<?> declaringType, Class<P> propertyType) { Field field = findField(metaBean, propertyName); return new DirectMetaProperty<>(metaBean, propertyName, declaringType, propertyType, PropertyStyle...
java
public static <P> DirectMetaProperty<P> ofWriteOnly( MetaBean metaBean, String propertyName, Class<?> declaringType, Class<P> propertyType) { Field field = findField(metaBean, propertyName); return new DirectMetaProperty<>(metaBean, propertyName, declaringType, propertyType, PropertyStyle...
[ "public", "static", "<", "P", ">", "DirectMetaProperty", "<", "P", ">", "ofWriteOnly", "(", "MetaBean", "metaBean", ",", "String", "propertyName", ",", "Class", "<", "?", ">", "declaringType", ",", "Class", "<", "P", ">", "propertyType", ")", "{", "Field",...
Factory to create a write-only meta-property avoiding duplicate generics. @param <P> the property type @param metaBean the meta-bean, not null @param propertyName the property name, not empty @param declaringType the type declaring the property, not null @param propertyType the property type, not null @return the...
[ "Factory", "to", "create", "a", "write", "-", "only", "meta", "-", "property", "avoiding", "duplicate", "generics", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/impl/direct/DirectMetaProperty.java#L93-L97
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/impl/direct/DirectMetaProperty.java
DirectMetaProperty.ofReadOnlyBuildable
public static <P> DirectMetaProperty<P> ofReadOnlyBuildable( MetaBean metaBean, String propertyName, Class<?> declaringType, Class<P> propertyType) { Field field = findField(metaBean, propertyName); return new DirectMetaProperty<>(metaBean, propertyName, declaringType, propertyType, Prope...
java
public static <P> DirectMetaProperty<P> ofReadOnlyBuildable( MetaBean metaBean, String propertyName, Class<?> declaringType, Class<P> propertyType) { Field field = findField(metaBean, propertyName); return new DirectMetaProperty<>(metaBean, propertyName, declaringType, propertyType, Prope...
[ "public", "static", "<", "P", ">", "DirectMetaProperty", "<", "P", ">", "ofReadOnlyBuildable", "(", "MetaBean", "metaBean", ",", "String", "propertyName", ",", "Class", "<", "?", ">", "declaringType", ",", "Class", "<", "P", ">", "propertyType", ")", "{", ...
Factory to create a buildable read-only meta-property avoiding duplicate generics. @param <P> the property type @param metaBean the meta-bean, not null @param propertyName the property name, not empty @param declaringType the type declaring the property, not null @param propertyType the property type, not null @r...
[ "Factory", "to", "create", "a", "buildable", "read", "-", "only", "meta", "-", "property", "avoiding", "duplicate", "generics", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/impl/direct/DirectMetaProperty.java#L109-L113
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/impl/direct/DirectMetaProperty.java
DirectMetaProperty.ofDerived
public static <P> DirectMetaProperty<P> ofDerived( MetaBean metaBean, String propertyName, Class<?> declaringType, Class<P> propertyType) { Field field = findField(metaBean, propertyName); return new DirectMetaProperty<>(metaBean, propertyName, declaringType, propertyType, PropertyStyle.D...
java
public static <P> DirectMetaProperty<P> ofDerived( MetaBean metaBean, String propertyName, Class<?> declaringType, Class<P> propertyType) { Field field = findField(metaBean, propertyName); return new DirectMetaProperty<>(metaBean, propertyName, declaringType, propertyType, PropertyStyle.D...
[ "public", "static", "<", "P", ">", "DirectMetaProperty", "<", "P", ">", "ofDerived", "(", "MetaBean", "metaBean", ",", "String", "propertyName", ",", "Class", "<", "?", ">", "declaringType", ",", "Class", "<", "P", ">", "propertyType", ")", "{", "Field", ...
Factory to create a derived read-only meta-property avoiding duplicate generics. @param <P> the property type @param metaBean the meta-bean, not null @param propertyName the property name, not empty @param declaringType the type declaring the property, not null @param propertyType the property type, not null @ret...
[ "Factory", "to", "create", "a", "derived", "read", "-", "only", "meta", "-", "property", "avoiding", "duplicate", "generics", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/impl/direct/DirectMetaProperty.java#L125-L129
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/impl/direct/DirectMetaProperty.java
DirectMetaProperty.ofImmutable
public static <P> DirectMetaProperty<P> ofImmutable( MetaBean metaBean, String propertyName, Class<?> declaringType, Class<P> propertyType) { Field field = findField(metaBean, propertyName); return new DirectMetaProperty<>(metaBean, propertyName, declaringType, propertyType, PropertyStyle...
java
public static <P> DirectMetaProperty<P> ofImmutable( MetaBean metaBean, String propertyName, Class<?> declaringType, Class<P> propertyType) { Field field = findField(metaBean, propertyName); return new DirectMetaProperty<>(metaBean, propertyName, declaringType, propertyType, PropertyStyle...
[ "public", "static", "<", "P", ">", "DirectMetaProperty", "<", "P", ">", "ofImmutable", "(", "MetaBean", "metaBean", ",", "String", "propertyName", ",", "Class", "<", "?", ">", "declaringType", ",", "Class", "<", "P", ">", "propertyType", ")", "{", "Field",...
Factory to create an imutable meta-property avoiding duplicate generics. @param <P> the property type @param metaBean the meta-bean, not null @param propertyName the property name, not empty @param declaringType the type declaring the property, not null @param propertyType the property type, not null @return the ...
[ "Factory", "to", "create", "an", "imutable", "meta", "-", "property", "avoiding", "duplicate", "generics", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/impl/direct/DirectMetaProperty.java#L141-L145
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/json/JodaBeanJsonWriter.java
JodaBeanJsonWriter.write
public String write(Bean bean, boolean rootType) { StringBuilder buf = new StringBuilder(1024); try { write(bean, rootType, buf); } catch (IOException ex) { throw new IllegalStateException(ex); } return buf.toString(); }
java
public String write(Bean bean, boolean rootType) { StringBuilder buf = new StringBuilder(1024); try { write(bean, rootType, buf); } catch (IOException ex) { throw new IllegalStateException(ex); } return buf.toString(); }
[ "public", "String", "write", "(", "Bean", "bean", ",", "boolean", "rootType", ")", "{", "StringBuilder", "buf", "=", "new", "StringBuilder", "(", "1024", ")", ";", "try", "{", "write", "(", "bean", ",", "rootType", ",", "buf", ")", ";", "}", "catch", ...
Writes the bean to a string specifying whether to include the type at the root. @param bean the bean to output, not null @param rootType true to output the root type @return the JSON, not null
[ "Writes", "the", "bean", "to", "a", "string", "specifying", "whether", "to", "include", "the", "type", "at", "the", "root", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/json/JodaBeanJsonWriter.java#L132-L140
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/bin/MsgPackInput.java
MsgPackInput.readAll
void readAll() { try { try { int b = input.read(); while (b >= 0) { readObject(b); b = input.read(); } } finally { input.close(); } } catch (IOException ex) { ...
java
void readAll() { try { try { int b = input.read(); while (b >= 0) { readObject(b); b = input.read(); } } finally { input.close(); } } catch (IOException ex) { ...
[ "void", "readAll", "(", ")", "{", "try", "{", "try", "{", "int", "b", "=", "input", ".", "read", "(", ")", ";", "while", "(", "b", ">=", "0", ")", "{", "readObject", "(", "b", ")", ";", "b", "=", "input", ".", "read", "(", ")", ";", "}", ...
Reads all the data in the stream, closing the stream.
[ "Reads", "all", "the", "data", "in", "the", "stream", "closing", "the", "stream", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/MsgPackInput.java#L64-L78
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/gen/PropertyData.java
PropertyData.resolveType
public void resolveType() { if (getTypeStyle() == null) { setTypeStyle(""); } final String fieldType = getFieldType(); String generics = ""; if (fieldType.contains("<")) { generics = fieldType.substring(fieldType.indexOf('<')); } if (getTyp...
java
public void resolveType() { if (getTypeStyle() == null) { setTypeStyle(""); } final String fieldType = getFieldType(); String generics = ""; if (fieldType.contains("<")) { generics = fieldType.substring(fieldType.indexOf('<')); } if (getTyp...
[ "public", "void", "resolveType", "(", ")", "{", "if", "(", "getTypeStyle", "(", ")", "==", "null", ")", "{", "setTypeStyle", "(", "\"\"", ")", ";", "}", "final", "String", "fieldType", "=", "getFieldType", "(", ")", ";", "String", "generics", "=", "\"\...
Resolves the field type.
[ "Resolves", "the", "field", "type", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/gen/PropertyData.java#L285-L307
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/gen/PropertyData.java
PropertyData.resolveBuilderType
public void resolveBuilderType() { if (getBuilderTypeStyle() == null) { setBuilderTypeStyle(""); } final String fieldType = getFieldType(); String generics = ""; if (fieldType.contains("<")) { generics = fieldType.substring(fieldType.indexOf('<')); ...
java
public void resolveBuilderType() { if (getBuilderTypeStyle() == null) { setBuilderTypeStyle(""); } final String fieldType = getFieldType(); String generics = ""; if (fieldType.contains("<")) { generics = fieldType.substring(fieldType.indexOf('<')); ...
[ "public", "void", "resolveBuilderType", "(", ")", "{", "if", "(", "getBuilderTypeStyle", "(", ")", "==", "null", ")", "{", "setBuilderTypeStyle", "(", "\"\"", ")", ";", "}", "final", "String", "fieldType", "=", "getFieldType", "(", ")", ";", "String", "gen...
Resolves the field builder type.
[ "Resolves", "the", "field", "builder", "type", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/gen/PropertyData.java#L312-L334
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/gen/PropertyData.java
PropertyData.resolveEqualsHashCodeStyle
public void resolveEqualsHashCodeStyle(File file, int lineIndex) { if (equalsHashCodeStyle.equals("smart")) { equalsHashCodeStyle = (bean.isImmutable() ? "field" : "getter"); } if (equalsHashCodeStyle.equals("omit") || equalsHashCodeStyle.equals("getter") || ...
java
public void resolveEqualsHashCodeStyle(File file, int lineIndex) { if (equalsHashCodeStyle.equals("smart")) { equalsHashCodeStyle = (bean.isImmutable() ? "field" : "getter"); } if (equalsHashCodeStyle.equals("omit") || equalsHashCodeStyle.equals("getter") || ...
[ "public", "void", "resolveEqualsHashCodeStyle", "(", "File", "file", ",", "int", "lineIndex", ")", "{", "if", "(", "equalsHashCodeStyle", ".", "equals", "(", "\"smart\"", ")", ")", "{", "equalsHashCodeStyle", "=", "(", "bean", ".", "isImmutable", "(", ")", "...
Resolves the equals hashCode generator. @param file the file @param lineIndex the line index
[ "Resolves", "the", "equals", "hashCode", "generator", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/gen/PropertyData.java#L453-L464
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/gen/PropertyData.java
PropertyData.resolveToStringStyle
public void resolveToStringStyle(File file, int lineIndex) { if (toStringStyle.equals("smart")) { toStringStyle = (bean.isImmutable() ? "field" : "getter"); } if (toStringStyle.equals("omit") || toStringStyle.equals("getter") || toStringStyle.equals("f...
java
public void resolveToStringStyle(File file, int lineIndex) { if (toStringStyle.equals("smart")) { toStringStyle = (bean.isImmutable() ? "field" : "getter"); } if (toStringStyle.equals("omit") || toStringStyle.equals("getter") || toStringStyle.equals("f...
[ "public", "void", "resolveToStringStyle", "(", "File", "file", ",", "int", "lineIndex", ")", "{", "if", "(", "toStringStyle", ".", "equals", "(", "\"smart\"", ")", ")", "{", "toStringStyle", "=", "(", "bean", ".", "isImmutable", "(", ")", "?", "\"field\"",...
Resolves the toString generator. @param file the file @param lineIndex the line index
[ "Resolves", "the", "toString", "generator", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/gen/PropertyData.java#L487-L498
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/gen/PropertyData.java
PropertyData.getFieldTypeRaw
public String getFieldTypeRaw() { int pos = fieldType.indexOf("<"); return (pos < 0 ? fieldType : fieldType.substring(0, pos)); }
java
public String getFieldTypeRaw() { int pos = fieldType.indexOf("<"); return (pos < 0 ? fieldType : fieldType.substring(0, pos)); }
[ "public", "String", "getFieldTypeRaw", "(", ")", "{", "int", "pos", "=", "fieldType", ".", "indexOf", "(", "\"<\"", ")", ";", "return", "(", "pos", "<", "0", "?", "fieldType", ":", "fieldType", ".", "substring", "(", "0", ",", "pos", ")", ")", ";", ...
Gets the raw type of the property. @return the raw type
[ "Gets", "the", "raw", "type", "of", "the", "property", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/gen/PropertyData.java#L696-L699
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/gen/PropertyData.java
PropertyData.resolveSetterGen
public void resolveSetterGen(File file, int lineIndex) { if (getSetStyle() == null) { setSetStyle(""); } String style = getSetStyle().replace("\\n", "\n"); String access = "public"; if (style.equals("private")) { style = "smart"; access = "priv...
java
public void resolveSetterGen(File file, int lineIndex) { if (getSetStyle() == null) { setSetStyle(""); } String style = getSetStyle().replace("\\n", "\n"); String access = "public"; if (style.equals("private")) { style = "smart"; access = "priv...
[ "public", "void", "resolveSetterGen", "(", "File", "file", ",", "int", "lineIndex", ")", "{", "if", "(", "getSetStyle", "(", ")", "==", "null", ")", "{", "setSetStyle", "(", "\"\"", ")", ";", "}", "String", "style", "=", "getSetStyle", "(", ")", ".", ...
Resolves the setter generator. @param file the file @param lineIndex the line index
[ "Resolves", "the", "setter", "generator", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/gen/PropertyData.java#L854-L913
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/gen/PropertyData.java
PropertyData.getStyle
public PropertyStyle getStyle() { if (isDerived()) { return PropertyStyle.DERIVED; } if (getBean().isImmutable()) { return PropertyStyle.IMMUTABLE; } if (getGetStyle().length() > 0 && getSetStyle().length() > 0 && (getSetterGen().isSetterGenerated(this) ||...
java
public PropertyStyle getStyle() { if (isDerived()) { return PropertyStyle.DERIVED; } if (getBean().isImmutable()) { return PropertyStyle.IMMUTABLE; } if (getGetStyle().length() > 0 && getSetStyle().length() > 0 && (getSetterGen().isSetterGenerated(this) ||...
[ "public", "PropertyStyle", "getStyle", "(", ")", "{", "if", "(", "isDerived", "(", ")", ")", "{", "return", "PropertyStyle", ".", "DERIVED", ";", "}", "if", "(", "getBean", "(", ")", ".", "isImmutable", "(", ")", ")", "{", "return", "PropertyStyle", "....
Gets the read-write flag. @return the read write
[ "Gets", "the", "read", "-", "write", "flag", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/gen/PropertyData.java#L1075-L1097
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/gen/PropertyData.java
PropertyData.getValidationMethodName
public String getValidationMethodName() { if (isValidated() == false) { throw new IllegalStateException(); } if (getValidation().equals("notNull") || getValidation().equals("notEmpty") || getValidation().equals("notBlank")) { return "JodaBe...
java
public String getValidationMethodName() { if (isValidated() == false) { throw new IllegalStateException(); } if (getValidation().equals("notNull") || getValidation().equals("notEmpty") || getValidation().equals("notBlank")) { return "JodaBe...
[ "public", "String", "getValidationMethodName", "(", ")", "{", "if", "(", "isValidated", "(", ")", "==", "false", ")", "{", "throw", "new", "IllegalStateException", "(", ")", ";", "}", "if", "(", "getValidation", "(", ")", ".", "equals", "(", "\"notNull\"",...
Gets the validation method name. @return the method name
[ "Gets", "the", "validation", "method", "name", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/gen/PropertyData.java#L1139-L1149
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/JodaBeanUtils.java
JodaBeanUtils.equal
public static boolean equal(Object obj1, Object obj2) { if (obj1 == obj2) { return true; } if (obj1 == null || obj2 == null) { return false; } if (obj1.getClass().isArray()) { return equalsArray(obj1, obj2); } // this does not h...
java
public static boolean equal(Object obj1, Object obj2) { if (obj1 == obj2) { return true; } if (obj1 == null || obj2 == null) { return false; } if (obj1.getClass().isArray()) { return equalsArray(obj1, obj2); } // this does not h...
[ "public", "static", "boolean", "equal", "(", "Object", "obj1", ",", "Object", "obj2", ")", "{", "if", "(", "obj1", "==", "obj2", ")", "{", "return", "true", ";", "}", "if", "(", "obj1", "==", "null", "||", "obj2", "==", "null", ")", "{", "return", ...
Checks if two objects are equal handling null. @param obj1 the first object, may be null @param obj2 the second object, may be null @return true if equal
[ "Checks", "if", "two", "objects", "are", "equal", "handling", "null", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/JodaBeanUtils.java#L140-L153
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/impl/BufferingBeanBuilder.java
BufferingBeanBuilder.get
@Override @SuppressWarnings("unchecked") public <P> P get(MetaProperty<P> metaProperty) { return (P) getBuffer().get(metaProperty); }
java
@Override @SuppressWarnings("unchecked") public <P> P get(MetaProperty<P> metaProperty) { return (P) getBuffer().get(metaProperty); }
[ "@", "Override", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "P", ">", "P", "get", "(", "MetaProperty", "<", "P", ">", "metaProperty", ")", "{", "return", "(", "P", ")", "getBuffer", "(", ")", ".", "get", "(", "metaProperty", ")"...
Gets the buffered value associated with the specified property name. @param metaProperty the meta-property, not null @return the current value in the builder, null if not found or value is null
[ "Gets", "the", "buffered", "value", "associated", "with", "the", "specified", "property", "name", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/impl/BufferingBeanBuilder.java#L110-L114
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/SerTypeMapper.java
SerTypeMapper.decodeType0
private static Class<?> decodeType0( String className, JodaBeanSer settings, String basePackage, Map<String, Class<?>> knownTypes, Class<?> defaultType) throws ClassNotFoundException { // basic type Class<?> result = BASIC_TYPES_REVERSED.get(c...
java
private static Class<?> decodeType0( String className, JodaBeanSer settings, String basePackage, Map<String, Class<?>> knownTypes, Class<?> defaultType) throws ClassNotFoundException { // basic type Class<?> result = BASIC_TYPES_REVERSED.get(c...
[ "private", "static", "Class", "<", "?", ">", "decodeType0", "(", "String", "className", ",", "JodaBeanSer", "settings", ",", "String", "basePackage", ",", "Map", "<", "String", ",", "Class", "<", "?", ">", ">", "knownTypes", ",", "Class", "<", "?", ">", ...
internal type decode
[ "internal", "type", "decode" ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/SerTypeMapper.java#L193-L261
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/map/JodaBeanSimpleMapWriter.java
JodaBeanSimpleMapWriter.write
public Map<String, Object> write(Bean bean) { JodaBeanUtils.notNull(bean, "bean"); return writeBean(bean, bean.getClass()); }
java
public Map<String, Object> write(Bean bean) { JodaBeanUtils.notNull(bean, "bean"); return writeBean(bean, bean.getClass()); }
[ "public", "Map", "<", "String", ",", "Object", ">", "write", "(", "Bean", "bean", ")", "{", "JodaBeanUtils", ".", "notNull", "(", "bean", ",", "\"bean\"", ")", ";", "return", "writeBean", "(", "bean", ",", "bean", ".", "getClass", "(", ")", ")", ";",...
Writes the bean to a string. @param bean the bean to output, not null @return the JSON, not null
[ "Writes", "the", "bean", "to", "a", "string", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/map/JodaBeanSimpleMapWriter.java#L76-L79
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/bin/MsgPackOutput.java
MsgPackOutput.writeBoolean
void writeBoolean(boolean value) throws IOException { if (value) { output.writeByte(TRUE); } else { output.writeByte(FALSE); } }
java
void writeBoolean(boolean value) throws IOException { if (value) { output.writeByte(TRUE); } else { output.writeByte(FALSE); } }
[ "void", "writeBoolean", "(", "boolean", "value", ")", "throws", "IOException", "{", "if", "(", "value", ")", "{", "output", ".", "writeByte", "(", "TRUE", ")", ";", "}", "else", "{", "output", ".", "writeByte", "(", "FALSE", ")", ";", "}", "}" ]
Writes a MessagePack boolean. @param value the value @throws IOException if an error occurs
[ "Writes", "a", "MessagePack", "boolean", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/MsgPackOutput.java#L66-L72
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/bin/MsgPackOutput.java
MsgPackOutput.writeInt
void writeInt(int value) throws IOException { if (value < MIN_FIX_INT) { // large negative if (value >= Byte.MIN_VALUE) { output.writeByte(SINT_8); output.writeByte((byte) value); } else if (value >= Short.MIN_VALUE) { output.wr...
java
void writeInt(int value) throws IOException { if (value < MIN_FIX_INT) { // large negative if (value >= Byte.MIN_VALUE) { output.writeByte(SINT_8); output.writeByte((byte) value); } else if (value >= Short.MIN_VALUE) { output.wr...
[ "void", "writeInt", "(", "int", "value", ")", "throws", "IOException", "{", "if", "(", "value", "<", "MIN_FIX_INT", ")", "{", "// large negative", "if", "(", "value", ">=", "Byte", ".", "MIN_VALUE", ")", "{", "output", ".", "writeByte", "(", "SINT_8", ")...
Writes a MessagePack int. @param value the value @throws IOException if an error occurs
[ "Writes", "a", "MessagePack", "int", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/MsgPackOutput.java#L80-L109
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/bin/MsgPackOutput.java
MsgPackOutput.writeLong
void writeLong(long value) throws IOException { if (value < MIN_FIX_INT) { // large negative if (value >= Byte.MIN_VALUE) { output.writeByte(SINT_8); output.writeByte((byte) value); } else if (value >= Short.MIN_VALUE) { output....
java
void writeLong(long value) throws IOException { if (value < MIN_FIX_INT) { // large negative if (value >= Byte.MIN_VALUE) { output.writeByte(SINT_8); output.writeByte((byte) value); } else if (value >= Short.MIN_VALUE) { output....
[ "void", "writeLong", "(", "long", "value", ")", "throws", "IOException", "{", "if", "(", "value", "<", "MIN_FIX_INT", ")", "{", "// large negative", "if", "(", "value", ">=", "Byte", ".", "MIN_VALUE", ")", "{", "output", ".", "writeByte", "(", "SINT_8", ...
Writes a MessagePack long. @param value the value @throws IOException if an error occurs
[ "Writes", "a", "MessagePack", "long", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/MsgPackOutput.java#L117-L152
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/bin/MsgPackOutput.java
MsgPackOutput.writeBytes
void writeBytes(byte[] bytes) throws IOException { int size = bytes.length; if (size < 256) { output.writeByte(BIN_8); output.writeByte(size); } else if (size < 65536) { output.writeByte(BIN_16); output.writeShort(size); } else { ...
java
void writeBytes(byte[] bytes) throws IOException { int size = bytes.length; if (size < 256) { output.writeByte(BIN_8); output.writeByte(size); } else if (size < 65536) { output.writeByte(BIN_16); output.writeShort(size); } else { ...
[ "void", "writeBytes", "(", "byte", "[", "]", "bytes", ")", "throws", "IOException", "{", "int", "size", "=", "bytes", ".", "length", ";", "if", "(", "size", "<", "256", ")", "{", "output", ".", "writeByte", "(", "BIN_8", ")", ";", "output", ".", "w...
Writes a MessagePack byte block. @param bytes the bytes, not null @throws IOException if an error occurs
[ "Writes", "a", "MessagePack", "byte", "block", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/MsgPackOutput.java#L182-L195
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/bin/MsgPackOutput.java
MsgPackOutput.writeString
void writeString(String value) throws IOException { byte[] bytes = toUTF8(value); int size = bytes.length; if (size < 32) { output.writeByte(MIN_FIX_STR + size); } else if (size < 256) { output.writeByte(STR_8); output.writeByte(size); } else i...
java
void writeString(String value) throws IOException { byte[] bytes = toUTF8(value); int size = bytes.length; if (size < 32) { output.writeByte(MIN_FIX_STR + size); } else if (size < 256) { output.writeByte(STR_8); output.writeByte(size); } else i...
[ "void", "writeString", "(", "String", "value", ")", "throws", "IOException", "{", "byte", "[", "]", "bytes", "=", "toUTF8", "(", "value", ")", ";", "int", "size", "=", "bytes", ".", "length", ";", "if", "(", "size", "<", "32", ")", "{", "output", "...
Writes a MessagePack string. @param value the value @throws IOException if an error occurs
[ "Writes", "a", "MessagePack", "string", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/MsgPackOutput.java#L203-L219
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/bin/MsgPackOutput.java
MsgPackOutput.writeArrayHeader
void writeArrayHeader(int size) throws IOException { if (size < 16) { output.writeByte(MIN_FIX_ARRAY + size); } else if (size < 65536) { output.writeByte(ARRAY_16); output.writeShort(size); } else { output.writeByte(ARRAY_32); output.wr...
java
void writeArrayHeader(int size) throws IOException { if (size < 16) { output.writeByte(MIN_FIX_ARRAY + size); } else if (size < 65536) { output.writeByte(ARRAY_16); output.writeShort(size); } else { output.writeByte(ARRAY_32); output.wr...
[ "void", "writeArrayHeader", "(", "int", "size", ")", "throws", "IOException", "{", "if", "(", "size", "<", "16", ")", "{", "output", ".", "writeByte", "(", "MIN_FIX_ARRAY", "+", "size", ")", ";", "}", "else", "if", "(", "size", "<", "65536", ")", "{"...
Writes a MessagePack array header. @param size the size @throws IOException if an error occurs
[ "Writes", "a", "MessagePack", "array", "header", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/MsgPackOutput.java#L242-L252
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/bin/MsgPackOutput.java
MsgPackOutput.writeMapHeader
void writeMapHeader(int size) throws IOException { if (size < 16) { output.writeByte(MIN_FIX_MAP + size); } else if (size < 65536) { output.writeByte(MAP_16); output.writeShort(size); } else { output.writeByte(MAP_32); output.writeInt(s...
java
void writeMapHeader(int size) throws IOException { if (size < 16) { output.writeByte(MIN_FIX_MAP + size); } else if (size < 65536) { output.writeByte(MAP_16); output.writeShort(size); } else { output.writeByte(MAP_32); output.writeInt(s...
[ "void", "writeMapHeader", "(", "int", "size", ")", "throws", "IOException", "{", "if", "(", "size", "<", "16", ")", "{", "output", ".", "writeByte", "(", "MIN_FIX_MAP", "+", "size", ")", ";", "}", "else", "if", "(", "size", "<", "65536", ")", "{", ...
Writes a MessagePack map header. @param size the size @throws IOException if an error occurs
[ "Writes", "a", "MessagePack", "map", "header", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/MsgPackOutput.java#L260-L270
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/bin/MsgPackOutput.java
MsgPackOutput.writeExtensionByte
void writeExtensionByte(int extensionType, int value) throws IOException { output.write(FIX_EXT_1); output.write(extensionType); output.write(value); }
java
void writeExtensionByte(int extensionType, int value) throws IOException { output.write(FIX_EXT_1); output.write(extensionType); output.write(value); }
[ "void", "writeExtensionByte", "(", "int", "extensionType", ",", "int", "value", ")", "throws", "IOException", "{", "output", ".", "write", "(", "FIX_EXT_1", ")", ";", "output", ".", "write", "(", "extensionType", ")", ";", "output", ".", "write", "(", "val...
Writes an extension string using FIX_EXT_1. @param extensionType the type @param value the value to write as the data @throws IOException if an error occurs
[ "Writes", "an", "extension", "string", "using", "FIX_EXT_1", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/MsgPackOutput.java#L279-L283
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/bin/MsgPackOutput.java
MsgPackOutput.writeExtensionString
void writeExtensionString(int extensionType, String str) throws IOException { byte[] bytes = str.getBytes(UTF_8); if (bytes.length > 256) { throw new IllegalArgumentException("String too long"); } output.write(EXT_8); output.write(bytes.length); output.write(e...
java
void writeExtensionString(int extensionType, String str) throws IOException { byte[] bytes = str.getBytes(UTF_8); if (bytes.length > 256) { throw new IllegalArgumentException("String too long"); } output.write(EXT_8); output.write(bytes.length); output.write(e...
[ "void", "writeExtensionString", "(", "int", "extensionType", ",", "String", "str", ")", "throws", "IOException", "{", "byte", "[", "]", "bytes", "=", "str", ".", "getBytes", "(", "UTF_8", ")", ";", "if", "(", "bytes", ".", "length", ">", "256", ")", "{...
Writes an extension string using EXT_8. @param extensionType the type @param str the string to write as the data @throws IOException if an error occurs
[ "Writes", "an", "extension", "string", "using", "EXT_8", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/MsgPackOutput.java#L292-L301
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/bin/MsgPackOutput.java
MsgPackOutput.writePositiveExtensionInt
void writePositiveExtensionInt(int extensionType, int reference) throws IOException { if (reference < 0) { throw new IllegalArgumentException("Can only serialize positive references: " + reference); } if (reference < 0xFF) { output.write(FIX_EXT_1); output.wri...
java
void writePositiveExtensionInt(int extensionType, int reference) throws IOException { if (reference < 0) { throw new IllegalArgumentException("Can only serialize positive references: " + reference); } if (reference < 0xFF) { output.write(FIX_EXT_1); output.wri...
[ "void", "writePositiveExtensionInt", "(", "int", "extensionType", ",", "int", "reference", ")", "throws", "IOException", "{", "if", "(", "reference", "<", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Can only serialize positive references: \"", "...
Writes an extension reference of a positive integer using FIX_EXT data types. @param extensionType the type @param reference the positive integer reference to write as the data @throws IOException if an error occurs
[ "Writes", "an", "extension", "reference", "of", "a", "positive", "integer", "using", "FIX_EXT", "data", "types", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/MsgPackOutput.java#L310-L327
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/bin/JodaBeanReferencingBinReader.java
JodaBeanReferencingBinReader.parseClassDescriptions
private void parseClassDescriptions() throws Exception { int refCount = acceptInteger(input.readByte()); if (refCount < 0) { throw new IllegalArgumentException("Invalid binary data: Expected count of references, but was: " + refCount); } refs = new Object[refCount]; ...
java
private void parseClassDescriptions() throws Exception { int refCount = acceptInteger(input.readByte()); if (refCount < 0) { throw new IllegalArgumentException("Invalid binary data: Expected count of references, but was: " + refCount); } refs = new Object[refCount]; ...
[ "private", "void", "parseClassDescriptions", "(", ")", "throws", "Exception", "{", "int", "refCount", "=", "acceptInteger", "(", "input", ".", "readByte", "(", ")", ")", ";", "if", "(", "refCount", "<", "0", ")", "{", "throw", "new", "IllegalArgumentExceptio...
parses the references
[ "parses", "the", "references" ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/JodaBeanReferencingBinReader.java#L96-L112
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/bin/JodaBeanReferencingBinReader.java
JodaBeanReferencingBinReader.parseClassInfo
private ClassInfo parseClassInfo() throws Exception { String className = acceptString(input.readByte()); Class<?> type = SerTypeMapper.decodeType(className, settings, overrideBasePackage, null); int propertyCount = acceptArray(input.readByte()); if (propertyCount < 0) { throw...
java
private ClassInfo parseClassInfo() throws Exception { String className = acceptString(input.readByte()); Class<?> type = SerTypeMapper.decodeType(className, settings, overrideBasePackage, null); int propertyCount = acceptArray(input.readByte()); if (propertyCount < 0) { throw...
[ "private", "ClassInfo", "parseClassInfo", "(", ")", "throws", "Exception", "{", "String", "className", "=", "acceptString", "(", "input", ".", "readByte", "(", ")", ")", ";", "Class", "<", "?", ">", "type", "=", "SerTypeMapper", ".", "decodeType", "(", "cl...
parses the class information
[ "parses", "the", "class", "information" ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/JodaBeanReferencingBinReader.java#L115-L135
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/bin/JodaBeanReferencingBinReader.java
JodaBeanReferencingBinReader.parseBean
private Object parseBean(int propertyCount, ClassInfo classInfo) { String propName = ""; if (classInfo.metaProperties.length != propertyCount) { throw new IllegalArgumentException("Invalid binary data: Expected " + classInfo.metaProperties.length + " properties but was: " + propertyCount); ...
java
private Object parseBean(int propertyCount, ClassInfo classInfo) { String propName = ""; if (classInfo.metaProperties.length != propertyCount) { throw new IllegalArgumentException("Invalid binary data: Expected " + classInfo.metaProperties.length + " properties but was: " + propertyCount); ...
[ "private", "Object", "parseBean", "(", "int", "propertyCount", ",", "ClassInfo", "classInfo", ")", "{", "String", "propName", "=", "\"\"", ";", "if", "(", "classInfo", ".", "metaProperties", ".", "length", "!=", "propertyCount", ")", "{", "throw", "new", "Il...
parses the bean using the class information
[ "parses", "the", "bean", "using", "the", "class", "information" ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/JodaBeanReferencingBinReader.java#L138-L161
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/bin/AbstractBinWriter.java
AbstractBinWriter.getAndSerializeEffectiveTypeIfRequired
Class<?> getAndSerializeEffectiveTypeIfRequired(Object value, Class<?> declaredType) throws IOException { Class<?> realType = value.getClass(); Class<?> effectiveType = declaredType; if (declaredType == Object.class) { if (realType != String.class) { effectiveType = s...
java
Class<?> getAndSerializeEffectiveTypeIfRequired(Object value, Class<?> declaredType) throws IOException { Class<?> realType = value.getClass(); Class<?> effectiveType = declaredType; if (declaredType == Object.class) { if (realType != String.class) { effectiveType = s...
[ "Class", "<", "?", ">", "getAndSerializeEffectiveTypeIfRequired", "(", "Object", "value", ",", "Class", "<", "?", ">", "declaredType", ")", "throws", "IOException", "{", "Class", "<", "?", ">", "realType", "=", "value", ".", "getClass", "(", ")", ";", "Cla...
needs to handle no declared type and subclass instances
[ "needs", "to", "handle", "no", "declared", "type", "and", "subclass", "instances" ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/AbstractBinWriter.java#L273-L292
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/bin/AbstractBinWriter.java
AbstractBinWriter.writeObjectAsString
void writeObjectAsString(Object value, Class<?> effectiveType) throws IOException { String converted = settings.getConverter().convertToString(effectiveType, value); if (converted == null) { throw new IllegalArgumentException("Unable to write because converter returned a null string: " + val...
java
void writeObjectAsString(Object value, Class<?> effectiveType) throws IOException { String converted = settings.getConverter().convertToString(effectiveType, value); if (converted == null) { throw new IllegalArgumentException("Unable to write because converter returned a null string: " + val...
[ "void", "writeObjectAsString", "(", "Object", "value", ",", "Class", "<", "?", ">", "effectiveType", ")", "throws", "IOException", "{", "String", "converted", "=", "settings", ".", "getConverter", "(", ")", ".", "convertToString", "(", "effectiveType", ",", "v...
called after discerning that the value is not a simple type
[ "called", "after", "discerning", "that", "the", "value", "is", "not", "a", "simple", "type" ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/AbstractBinWriter.java#L296-L302
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/MetaBeans.java
MetaBeans.metaBeanLookup
private static MetaBean metaBeanLookup(Class<?> cls) { // handle dynamic beans if (cls == FlexiBean.class) { return new FlexiBean().metaBean(); } else if (cls == MapBean.class) { return new MapBean().metaBean(); } else if (DynamicBean.class.isAssignableFrom(cls)) ...
java
private static MetaBean metaBeanLookup(Class<?> cls) { // handle dynamic beans if (cls == FlexiBean.class) { return new FlexiBean().metaBean(); } else if (cls == MapBean.class) { return new MapBean().metaBean(); } else if (DynamicBean.class.isAssignableFrom(cls)) ...
[ "private", "static", "MetaBean", "metaBeanLookup", "(", "Class", "<", "?", ">", "cls", ")", "{", "// handle dynamic beans", "if", "(", "cls", "==", "FlexiBean", ".", "class", ")", "{", "return", "new", "FlexiBean", "(", ")", ".", "metaBean", "(", ")", ";...
lookup the MetaBean outside the fast path, aiding hotspot inlining
[ "lookup", "the", "MetaBean", "outside", "the", "fast", "path", "aiding", "hotspot", "inlining" ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/MetaBeans.java#L63-L90
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/gen/BeanCodeGen.java
BeanCodeGen.findFiles
private static List<File> findFiles(final File parent, boolean recurse) { final List<File> result = new ArrayList<>(); if (parent.isDirectory()) { File[] files = parent.listFiles(); files = (files != null ? files : new File[0]); for (File child : files) { ...
java
private static List<File> findFiles(final File parent, boolean recurse) { final List<File> result = new ArrayList<>(); if (parent.isDirectory()) { File[] files = parent.listFiles(); files = (files != null ? files : new File[0]); for (File child : files) { ...
[ "private", "static", "List", "<", "File", ">", "findFiles", "(", "final", "File", "parent", ",", "boolean", "recurse", ")", "{", "final", "List", "<", "File", ">", "result", "=", "new", "ArrayList", "<>", "(", ")", ";", "if", "(", "parent", ".", "isD...
Finds the set of files to process. @param parent the root, not null @param recurse whether to recurse @return the files, not null
[ "Finds", "the", "set", "of", "files", "to", "process", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/gen/BeanCodeGen.java#L157-L180
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/gen/BeanCodeGen.java
BeanCodeGen.processFile
private File processFile(File file) throws Exception { List<String> original = readFile(file); List<String> content = new ArrayList<>(original); BeanGen gen; try { BeanParser parser = new BeanParser(file, content, config); gen = parser.parse(); } ca...
java
private File processFile(File file) throws Exception { List<String> original = readFile(file); List<String> content = new ArrayList<>(original); BeanGen gen; try { BeanParser parser = new BeanParser(file, content, config); gen = parser.parse(); } ca...
[ "private", "File", "processFile", "(", "File", "file", ")", "throws", "Exception", "{", "List", "<", "String", ">", "original", "=", "readFile", "(", "file", ")", ";", "List", "<", "String", ">", "content", "=", "new", "ArrayList", "<>", "(", "original",...
Processes the bean, generating the code. @param file the file to process, not null @return not-null if changed @throws Exception if an error occurs
[ "Processes", "the", "bean", "generating", "the", "code", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/gen/BeanCodeGen.java#L257-L320
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/bin/JodaBeanReferencingBinWriter.java
JodaBeanReferencingBinWriter.writeClassDescriptions
private void writeClassDescriptions(BeanReferences references) throws IOException { // write out ref count first, which is the number of instances that are referenced output.writeInt(references.getReferences().size()); // write map of class name to a list of metatype names (which is empty if no...
java
private void writeClassDescriptions(BeanReferences references) throws IOException { // write out ref count first, which is the number of instances that are referenced output.writeInt(references.getReferences().size()); // write map of class name to a list of metatype names (which is empty if no...
[ "private", "void", "writeClassDescriptions", "(", "BeanReferences", "references", ")", "throws", "IOException", "{", "// write out ref count first, which is the number of instances that are referenced", "output", ".", "writeInt", "(", "references", ".", "getReferences", "(", ")...
determines what beans occur more than once and setup references
[ "determines", "what", "beans", "occur", "more", "than", "once", "and", "setup", "references" ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/JodaBeanReferencingBinWriter.java#L58-L75
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/impl/StandaloneMetaProperty.java
StandaloneMetaProperty.of
public static <R> StandaloneMetaProperty<R> of(String propertyName, MetaBean metaBean, Class<R> clazz) { return new StandaloneMetaProperty<>(propertyName, metaBean, clazz, clazz); }
java
public static <R> StandaloneMetaProperty<R> of(String propertyName, MetaBean metaBean, Class<R> clazz) { return new StandaloneMetaProperty<>(propertyName, metaBean, clazz, clazz); }
[ "public", "static", "<", "R", ">", "StandaloneMetaProperty", "<", "R", ">", "of", "(", "String", "propertyName", ",", "MetaBean", "metaBean", ",", "Class", "<", "R", ">", "clazz", ")", "{", "return", "new", "StandaloneMetaProperty", "<>", "(", "propertyName"...
Creates a non-generified property. @param <R> the property type @param propertyName the property name, not empty @param metaBean the meta-bean, which does not have to refer to this property, not null @param clazz the type of the property, not null @return the meta-property, not null
[ "Creates", "a", "non", "-", "generified", "property", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/impl/StandaloneMetaProperty.java#L59-L61
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/bin/JodaBeanBinWriter.java
JodaBeanBinWriter.write
public byte[] write(Bean bean, boolean rootType) { ByteArrayOutputStream baos = new ByteArrayOutputStream(1024); try { write(bean, rootType, baos); } catch (IOException ex) { throw new IllegalStateException(ex); } return baos.toByteArray(); }
java
public byte[] write(Bean bean, boolean rootType) { ByteArrayOutputStream baos = new ByteArrayOutputStream(1024); try { write(bean, rootType, baos); } catch (IOException ex) { throw new IllegalStateException(ex); } return baos.toByteArray(); }
[ "public", "byte", "[", "]", "write", "(", "Bean", "bean", ",", "boolean", "rootType", ")", "{", "ByteArrayOutputStream", "baos", "=", "new", "ByteArrayOutputStream", "(", "1024", ")", ";", "try", "{", "write", "(", "bean", ",", "rootType", ",", "baos", "...
Writes the bean to an array of bytes. @param bean the bean to output, not null @param rootType true to output the root type @return the binary data, not null
[ "Writes", "the", "bean", "to", "an", "array", "of", "bytes", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/JodaBeanBinWriter.java#L144-L152
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/impl/direct/DirectMetaBean.java
DirectMetaBean.propertySet
protected void propertySet(Bean bean, String propertyName, Object value, boolean quiet) { // used to enable 100% test coverage in beans if (quiet) { return; } throw new NoSuchElementException("Unknown property: " + propertyName); }
java
protected void propertySet(Bean bean, String propertyName, Object value, boolean quiet) { // used to enable 100% test coverage in beans if (quiet) { return; } throw new NoSuchElementException("Unknown property: " + propertyName); }
[ "protected", "void", "propertySet", "(", "Bean", "bean", ",", "String", "propertyName", ",", "Object", "value", ",", "boolean", "quiet", ")", "{", "// used to enable 100% test coverage in beans", "if", "(", "quiet", ")", "{", "return", ";", "}", "throw", "new", ...
Sets the value of the property. @param bean the bean to update, not null @param propertyName the property name, not null @param value the value of the property, may be null @param quiet true to take no action if unable to write @throws NoSuchElementException if the property name is invalid
[ "Sets", "the", "value", "of", "the", "property", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/impl/direct/DirectMetaBean.java#L100-L106
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/BeanIterator.java
BeanIterator.findChildBeans
private void findChildBeans(Object obj, MetaProperty<?> mp, Class<?> beanClass, Deque<Bean> temp) { if (obj != null) { if (obj instanceof Bean) { temp.addFirst((Bean) obj); } else { SerIterator it = SerIteratorFactory.INSTANCE.create(obj, mp, beanClass); ...
java
private void findChildBeans(Object obj, MetaProperty<?> mp, Class<?> beanClass, Deque<Bean> temp) { if (obj != null) { if (obj instanceof Bean) { temp.addFirst((Bean) obj); } else { SerIterator it = SerIteratorFactory.INSTANCE.create(obj, mp, beanClass); ...
[ "private", "void", "findChildBeans", "(", "Object", "obj", ",", "MetaProperty", "<", "?", ">", "mp", ",", "Class", "<", "?", ">", "beanClass", ",", "Deque", "<", "Bean", ">", "temp", ")", "{", "if", "(", "obj", "!=", "null", ")", "{", "if", "(", ...
find child beans, including those in collections
[ "find", "child", "beans", "including", "those", "in", "collections" ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/BeanIterator.java#L70-L86
train
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/bin/BeanReferences.java
BeanReferences.findReferences
private void findReferences(ImmutableBean root) { // handle root bean classes.put(root.getClass(), classInfoFromMetaBean(root.metaBean(), root.getClass())); classSerializationCount.put(root.getClass(), 1); // recursively check object graph Map<Object, Integer> objects = new Link...
java
private void findReferences(ImmutableBean root) { // handle root bean classes.put(root.getClass(), classInfoFromMetaBean(root.metaBean(), root.getClass())); classSerializationCount.put(root.getClass(), 1); // recursively check object graph Map<Object, Integer> objects = new Link...
[ "private", "void", "findReferences", "(", "ImmutableBean", "root", ")", "{", "// handle root bean", "classes", ".", "put", "(", "root", ".", "getClass", "(", ")", ",", "classInfoFromMetaBean", "(", "root", ".", "metaBean", "(", ")", ",", "root", ".", "getCla...
finds classes and references within the bean
[ "finds", "classes", "and", "references", "within", "the", "bean" ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/BeanReferences.java#L80-L123
train