You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @throws Exception if calling of some {@link PropertyDescriptor}s write method fails (should not happen often) or when something went wrong during deserialization!
1062
+
* @throws Exception if calling of some {@link PropertyDescriptor}s write method fails (should not happen often) or when something went very wrong during deserialization!
1068
1063
* @throws IntrospectionException when there were no PropertyDescriptor found for obj class!
1064
+
* @throws RuntimeException in case of something went wrong during deserialization process and {@link LogProvider#isReThrowException()} is set to true!
Copy file name to clipboardExpand all lines: SerialX-core/src/main/java/org/ugp/serialx/Utils.java
+47-17Lines changed: 47 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -468,42 +468,65 @@ public static StringBuilder multilpy(CharSequence str, int times)
468
468
* @param s | String to split and check some syntax.
469
469
* @param splitter | Chars where string will be split!
470
470
*
471
-
* @return String splitted after splitters. If there is more than one splitter in row, it will be taken as one whole!
471
+
* @return String splitted after splitters. More than one splitter in rowwill be take as 1. Each resulting token will be {@link String#trim() trim}<code>med</code>!
* @param s | String to split and check some syntax.
482
482
* @param limit | If 0 or less = no limit, 1 = no splitting, more than 1 = count of results!
483
-
* @param oneOrMore | If true, string will be splitted after one or more splitters in row, if false splitting will occur only after single splitter (this is similar to "+" in regex)!
483
+
* @param splittingStrategy | <b>If 0</b>, splitting will occur after each splitter!
484
+
* <b>If 1</b>, string will be splitted after only one splitter, more than one splitters in row will be ignored!
485
+
* <b>If 2</b>, splitting will occur after any number of splitters, n number of splitters in row will be treated as 1!
484
486
* @param splitter | Chars where string will be split!
485
487
*
486
-
* @return String splitted after splitters according to arguments. If there is more than one splitter in row, it will be taken as one whole!
488
+
* @return String splitted after splitters according to arguments. Each resulting token will be {@link String#trim() trim}<code>med</code>!
* @param s | String to split and check some syntax.
497
499
* @param limit | If 0 or less = no limit, 1 = no splitting, more than 1 = count of results!
498
-
* @param oneOrMore | If true, string will be splitted after one or more splitters in row, if false splitting will occur only after single splitter (this is similar to "+" in regex)!
500
+
* @param splittingStrategy | <b>If 0</b>, splitting will occur after each splitter!
501
+
* <b>If 1</b>, string will be splitted after only one splitter, more than one splitters in row will be ignored!
502
+
* <b>If 2</b>, splitting will occur after any number of splitters, n number of splitters in row will be treated as 1!
499
503
* @param splitBreaks | When some of these characters is encountered, splitting is terminated for the rest of the string!
500
504
* @param splitter | Chars where string will be split!
501
505
*
502
-
* @return String splitted after splitters according to arguments. If there is more than one splitter in row, it will be taken as one whole!
506
+
* @return String splitted after splitters according to arguments. Each resulting token will be {@link String#trim() trim}<code>med</code>!
503
507
*
504
508
* @since 1.3.5
505
509
*/
506
-
publicstaticString[] splitValues(Strings, intlimit, booleanoneOrMore, char[] splitBreaks, char... splitter) //TODO: This bs is terribly broken! Idk what I was doing back then but its not doing what I would assume at all...
eachVar: for (inti = 0; i < iVal; i++) // Support for assigning multiple vars to the same value...
81
+
eachVar: for (inti = 0; i < iVal; i++) // Support for assigning multiple vars to the same value... Yea this is not the prettiest code but it does the job and mainly it does it fast so shut up!
78
82
{
79
83
Stringvar = vars[i];
80
-
if (!genericVar && contains(var, ' '))
84
+
if (!genericVar && contains(var, ' '))
81
85
LogProvider.instance.logErr("Variable name \"" + var + "\" is invalid, blank characters are not allowed!", null);
@@ -188,11 +192,11 @@ public void setJsonStyle(boolean jsonStyle)
188
192
/**
189
193
* @param s | CharSequence to search!
190
194
*
191
-
* @return true if inserted expression is variable assignment expression such as <code>variable = 4</code> otherwise false!
195
+
* @return Index of first assignment operator ('=' or ':') if inserted expression is variable assignment expression such as <code>variable = 4</code>, otherwise -1!
192
196
*
193
197
* @since 1.3.0
194
198
*/
195
-
publicstaticbooleanisVarAssignment(CharSequences)
199
+
publicstaticintisVarAssignment(CharSequences)
196
200
{
197
201
for (inti = 0, brackets = 0, quote = 0, len = s.length(), oldCh = -1, chNext; i < len; i++)
198
202
{
@@ -203,9 +207,9 @@ public static boolean isVarAssignment(CharSequence s)
0 commit comments