Skip to content

Commit 324f2a1

Browse files
committed
feat!: Add event iterator interface
BREAKING CHANGE This is a major refactor. It introduces the org.jsonurl.stream package which defines an iterator that transforms a sequence of characters into an sequence of events. The parser has been moved to the factory artifact. It's been refactored to parse a sequence of events. All of this makes it easier to implement the AQF syntax. It'll just be a new concrete iterator.
1 parent 193b621 commit 324f2a1

File tree

113 files changed

+9864
-6345
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+9864
-6345
lines changed

config/pmd-ruleset.xml

Lines changed: 4 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ruleset xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
name="M2Eclipse PMD RuleSet"
4+
name="jsonurl-pmd-ruleset"
55
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
6-
<description>M2Eclipse PMD RuleSet</description>
6+
<description>jsonurl-pmd-ruleset</description>
77
<rule ref="category/java/bestpractices.xml/AbstractClassWithoutAbstractMethod"/>
88
<rule ref="category/java/bestpractices.xml/AccessorClassGeneration"/>
99
<rule ref="category/java/bestpractices.xml/AccessorMethodGeneration"/>
@@ -18,7 +18,6 @@
1818
<rule ref="category/java/bestpractices.xml/CheckResultSet"/>
1919
<rule ref="category/java/bestpractices.xml/ConstantsInInterface"/>
2020
<rule ref="category/java/bestpractices.xml/DefaultLabelNotLastInSwitchStmt"/>
21-
<rule ref="category/jsp/bestpractices.xml/DontNestJsfInJstlIteration"/>
2221
<rule ref="category/java/bestpractices.xml/DoubleBraceInitialization"/>
2322
<rule ref="category/java/bestpractices.xml/ForLoopCanBeForeach"/>
2423
<rule ref="category/java/bestpractices.xml/ForLoopVariableCount"/>
@@ -34,9 +33,6 @@
3433
<rule ref="category/java/bestpractices.xml/LooseCoupling"/>
3534
<rule ref="category/java/bestpractices.xml/MethodReturnsInternalArray"/>
3635
<rule ref="category/java/bestpractices.xml/MissingOverride"/>
37-
<rule ref="category/jsp/bestpractices.xml/NoClassAttribute"/>
38-
<rule ref="category/jsp/bestpractices.xml/NoHtmlComments"/>
39-
<rule ref="category/jsp/bestpractices.xml/NoJspForward"/>
4036
<rule ref="category/java/bestpractices.xml/OneDeclarationPerLine"/>
4137
<rule ref="category/java/bestpractices.xml/PreserveStackTrace"/>
4238
<rule ref="category/java/bestpractices.xml/ReplaceEnumerationWithIterator"/>
@@ -63,15 +59,11 @@
6359
<rule ref="category/java/codestyle.xml/AvoidProtectedMethodInFinalClassNotExtending"/>
6460
<rule ref="category/java/codestyle.xml/AvoidUsingNativeCode"/>
6561
<rule ref="category/java/codestyle.xml/BooleanGetMethodName"/>
66-
<!--
67-
<rule ref="category/java/codestyle.xml/CallSuperInConstructor"/>
68-
-->
6962
<rule ref="category/java/codestyle.xml/ClassNamingConventions"/>
7063
<rule ref="category/java/codestyle.xml/ConfusingTernary"/>
7164
<rule ref="category/java/codestyle.xml/ControlStatementBraces"/>
7265
<rule ref="category/java/codestyle.xml/DontImportJavaLang"/>
7366
<rule ref="category/java/codestyle.xml/DuplicateImports"/>
74-
<rule ref="category/jsp/codestyle.xml/DuplicateJspImports"/>
7567
<rule ref="category/java/codestyle.xml/EmptyMethodInAbstractClassShouldBeAbstract"/>
7668
<rule ref="category/java/codestyle.xml/ExtendsObject"/>
7769
<rule ref="category/java/codestyle.xml/FieldDeclarationsShouldBeAtStartOfClass"/>
@@ -87,9 +79,6 @@
8779
<rule ref="category/java/codestyle.xml/MDBAndSessionBeanNamingConvention"/>
8880
<rule ref="category/java/codestyle.xml/MethodNamingConventions"/>
8981
<rule ref="category/java/codestyle.xml/NoPackage"/>
90-
<!--
91-
<rule ref="category/java/codestyle.xml/OnlyOneReturn"/>
92-
-->
9382
<rule ref="category/java/codestyle.xml/PackageCase"/>
9483
<rule ref="category/java/codestyle.xml/PrematureDeclaration"/>
9584
<rule ref="category/java/codestyle.xml/RemoteInterfaceNamingConvention"/>
@@ -108,7 +97,6 @@
10897
<rule ref="category/java/codestyle.xml/UselessParentheses"/>
10998
<rule ref="category/java/codestyle.xml/UselessQualifiedThis"/>
11099
<rule ref="category/java/codestyle.xml/UseShortArrayInitializer"/>
111-
<rule ref="category/java/codestyle.xml/UseUnderscoresInNumericLiterals"/>
112100
<rule ref="category/java/design.xml/AbstractClassWithoutAnyMethod"/>
113101
<rule ref="category/java/design.xml/AvoidCatchingGenericException"/>
114102
<rule ref="category/java/design.xml/AvoidDeeplyNestedIfStmts"/>
@@ -125,31 +113,14 @@
125113
<rule ref="category/java/design.xml/DoNotExtendJavaLangError"/>
126114
<rule ref="category/java/design.xml/ExceptionAsFlowControl"/>
127115
<!--
128-
<rule ref="category/java/design.xml/ExcessiveClassLength"/>
129-
-->
130116
<rule ref="category/java/design.xml/ExcessiveImports"/>
131-
<!--
132-
<rule ref="category/java/design.xml/ExcessiveMethodLength"/>
133117
-->
134118
<rule ref="category/java/design.xml/ExcessiveParameterList"/>
135119
<rule ref="category/java/design.xml/ExcessivePublicCount"/>
136120
<rule ref="category/java/design.xml/FinalFieldCouldBeStatic"/>
137-
<!--
138-
<rule ref="category/java/design.xml/GodClass"/>
139-
-->
140121
<rule ref="category/java/design.xml/ImmutableField"/>
141-
<!--
142-
<rule ref="category/java/design.xml/LawOfDemeter"/>
143-
-->
144122
<rule ref="category/java/design.xml/LogicInversion"/>
145-
<!--
146-
<rule ref="category/java/design.xml/LoosePackageCoupling"/>
147-
-->
148123
<rule ref="category/java/design.xml/NcssCount"/>
149-
<rule ref="category/jsp/design.xml/NoInlineScript"/>
150-
<rule ref="category/jsp/design.xml/NoInlineStyleInformation"/>
151-
<rule ref="category/jsp/design.xml/NoLongScripts"/>
152-
<rule ref="category/jsp/design.xml/NoScriptlets"/>
153124
<rule ref="category/java/design.xml/NPathComplexity"/>
154125
<rule ref="category/java/design.xml/SignatureDeclareThrowsException"/>
155126
<rule ref="category/java/design.xml/SimplifiedTernary"/>
@@ -160,9 +131,6 @@
160131
<rule ref="category/java/design.xml/SingularField"/>
161132
<rule ref="category/java/design.xml/SwitchDensity"/>
162133
<rule ref="category/java/design.xml/TooManyFields"/>
163-
<!--
164-
<rule ref="category/java/design.xml/TooManyMethods"/>
165-
-->
166134
<rule ref="category/java/design.xml/UselessOverridingMethod"/>
167135
<rule ref="category/java/design.xml/UseObjectForClearerAPI"/>
168136
<rule ref="category/java/design.xml/UseUtilityClass"/>
@@ -181,17 +149,16 @@
181149
<rule ref="category/java/errorprone.xml/AvoidDecimalLiteralsInBigDecimalConstructor"/>
182150
<rule ref="category/java/errorprone.xml/AvoidDuplicateLiterals"/>
183151
<rule ref="category/java/errorprone.xml/AvoidEnumAsIdentifier"/>
152+
<!--
184153
<rule ref="category/java/errorprone.xml/AvoidFieldNameMatchingMethodName"/>
154+
-->
185155
<rule ref="category/java/errorprone.xml/AvoidFieldNameMatchingTypeName"/>
186156
<rule ref="category/java/errorprone.xml/AvoidInstanceofChecksInCatchClause"/>
187157
<rule ref="category/java/errorprone.xml/AvoidLiteralsInIfCondition"/>
188158
<rule ref="category/java/errorprone.xml/AvoidLosingExceptionInformation"/>
189159
<rule ref="category/java/errorprone.xml/AvoidMultipleUnaryOperators"/>
190160
<rule ref="category/java/errorprone.xml/AvoidUsingOctalValues"/>
191161
<rule ref="category/java/errorprone.xml/BadComparison"/>
192-
<!--
193-
<rule ref="category/java/errorprone.xml/BeanMembersShouldSerialize"/>
194-
-->
195162
<rule ref="category/java/errorprone.xml/BrokenNullCheck"/>
196163
<rule ref="category/java/errorprone.xml/CallSuperFirst"/>
197164
<rule ref="category/java/errorprone.xml/CallSuperLast"/>
@@ -206,7 +173,6 @@
206173
<rule ref="category/java/errorprone.xml/ConstructorCallsOverridableMethod"/>
207174
<rule ref="category/java/errorprone.xml/DetachedTestCase"/>
208175
<rule ref="category/java/errorprone.xml/DoNotCallGarbageCollectionExplicitly"/>
209-
<rule ref="category/java/errorprone.xml/DoNotCallSystemExit"/>
210176
<rule ref="category/java/errorprone.xml/DoNotExtendJavaLangThrowable"/>
211177
<rule ref="category/java/errorprone.xml/DoNotHardCodeSDCard"/>
212178
<rule ref="category/java/errorprone.xml/DoNotThrowExceptionInFinally"/>
@@ -231,11 +197,7 @@
231197
<rule ref="category/java/errorprone.xml/IdempotentOperations"/>
232198
<rule ref="category/java/errorprone.xml/ImportFromSamePackage"/>
233199
<rule ref="category/java/errorprone.xml/InstantiationToGetClass"/>
234-
<!-- error when running from CLI
235-
<rule ref="category/pom/errorprone.xml/InvalidDependencyTypes"/>
236-
-->
237200
<rule ref="category/java/errorprone.xml/InvalidLogMessageFormat"/>
238-
<rule ref="category/jsp/errorprone.xml/JspEncoding"/>
239201
<rule ref="category/java/errorprone.xml/JumbledIncrementer"/>
240202
<rule ref="category/java/errorprone.xml/JUnitSpelling"/>
241203
<rule ref="category/java/errorprone.xml/JUnitStaticSuite"/>
@@ -249,9 +211,6 @@
249211
<rule ref="category/java/errorprone.xml/NonStaticInitializer"/>
250212
<rule ref="category/java/errorprone.xml/NullAssignment"/>
251213
<rule ref="category/java/errorprone.xml/OverrideBothEqualsAndHashcode"/>
252-
<!-- error when running from CLI
253-
<rule ref="category/pom/errorprone.xml/ProjectVersionAsDependencyVersion"/>
254-
-->
255214
<rule ref="category/java/errorprone.xml/ProperCloneImplementation"/>
256215
<rule ref="category/java/errorprone.xml/ProperLogger"/>
257216
<rule ref="category/java/errorprone.xml/ReturnEmptyArrayRatherThanNull"/>
@@ -283,9 +242,6 @@
283242
<rule ref="category/java/multithreading.xml/DoubleCheckedLocking"/>
284243
<rule ref="category/java/multithreading.xml/NonThreadSafeSingleton"/>
285244
<rule ref="category/java/multithreading.xml/UnsynchronizedStaticFormatter"/>
286-
<!--
287-
<rule ref="category/java/multithreading.xml/UseConcurrentHashMap"/>
288-
-->
289245
<rule ref="category/java/multithreading.xml/UseNotifyAllInsteadOfNotify"/>
290246
<rule ref="category/java/performance.xml/AddEmptyString"/>
291247
<rule ref="category/java/performance.xml/AppendCharacterWithChar"/>
@@ -307,7 +263,6 @@
307263
<rule ref="category/java/performance.xml/OptimizableToArrayCall"/>
308264
<rule ref="category/java/performance.xml/RedundantFieldInitializer"/>
309265
<rule ref="category/java/performance.xml/ShortInstantiation"/>
310-
<rule ref="category/java/performance.xml/SimplifyStartsWith"/>
311266
<rule ref="category/java/performance.xml/StringInstantiation"/>
312267
<rule ref="category/java/performance.xml/StringToString"/>
313268
<rule ref="category/java/performance.xml/TooFewBranchesForASwitchStatement"/>
@@ -321,6 +276,5 @@
321276
<rule ref="category/java/performance.xml/UseStringBufferLength"/>
322277
<rule ref="category/java/security.xml/HardCodedCryptoKey"/>
323278
<rule ref="category/jsp/security.xml/IframeMissingSrcAttribute"/>
324-
<rule ref="category/java/security.xml/InsecureCryptoIv"/>
325279
<rule ref="category/jsp/security.xml/NoUnsanitizedJSPExpression"/>
326280
</ruleset>

module/jsonurl-core/src/main/java/org/jsonurl/BaseJsonUrlOptions.java

Lines changed: 0 additions & 188 deletions
This file was deleted.

module/jsonurl-core/src/main/java/org/jsonurl/BigMathProvider.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,14 @@ enum BigIntegerOverflow {
115115
* @return a valid BigIntegerOverflow or null
116116
*/
117117
BigIntegerOverflow getBigIntegerOverflow();
118+
119+
/**
120+
* Cast the given object to a valid BigMathProvider or {@code null}.
121+
* @param obj any object or {@code null}
122+
* @return a valid BigMathProvider or {@code null}
123+
*/
124+
static BigMathProvider forObject(Object obj) {
125+
return obj instanceof BigMathProvider
126+
? (BigMathProvider)obj : null;
127+
}
118128
}

0 commit comments

Comments
 (0)