Skip to content

Commit be1bf5f

Browse files
Merge pull request #96 from webfirmframework/dev-12.x.x
wffweb-12.0.4 release changes
2 parents 9bc15d4 + 90c1fcb commit be1bf5f

Some content is hidden

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

45 files changed

+6901
-361
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[![Build Status](https://img.shields.io/badge/build-passing-greensvg?style=flat)](https://app.circleci.com/pipelines/github/webfirmframework/wff?branch=master&filter=all)
22
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/410601e16dc54b0a973c03845ad790c2)](https://www.codacy.com/app/webfirm-framework/wff?utm_source=github.com&utm_medium=referral&utm_content=webfirmframework/wff&utm_campaign=Badge_Grade)
33
[![Stackoverflow](https://img.shields.io/badge/stackoverflow-wffweb-orange.svg)](https://stackoverflow.com/questions/tagged/wffweb)
4-
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.webfirmframework/wffweb/badge.svg)](https://search.maven.org/#artifactdetails%7Ccom.webfirmframework%7Cwffweb%7C12.0.3%7Cjar)
4+
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.webfirmframework/wffweb/badge.svg)](https://search.maven.org/#artifactdetails%7Ccom.webfirmframework%7Cwffweb%7C12.0.4%7Cjar)
55
[![javadoc](https://javadoc.io/badge2/com.webfirmframework/wffweb/javadoc.svg)](https://javadoc.io/doc/com.webfirmframework/wffweb)
66
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0)
77

wffweb/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>com.webfirmframework</groupId>
66
<artifactId>wffweb</artifactId>
7-
<version>12.0.3</version>
7+
<version>12.0.4</version>
88

99
<properties>
1010
<maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
@@ -147,7 +147,7 @@
147147
<dependency>
148148
<groupId>com.fasterxml.jackson.core</groupId>
149149
<artifactId>jackson-databind</artifactId>
150-
<version>2.18.2</version>
150+
<version>2.18.3</version>
151151
<scope>test</scope>
152152
</dependency>
153153
<dependency>
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* Copyright since 2014 Web Firm Framework
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.webfirmframework.wffweb.json;
17+
18+
import java.io.Serial;
19+
20+
import com.webfirmframework.wffweb.WffRuntimeException;
21+
22+
/**
23+
* @since 12.0.4
24+
*/
25+
public class IllegalJsonFormatException extends WffRuntimeException {
26+
27+
@Serial
28+
private static final long serialVersionUID = 1L;
29+
30+
public IllegalJsonFormatException() {
31+
}
32+
33+
public IllegalJsonFormatException(final String message, final Throwable cause, final boolean enableSuppression,
34+
final boolean writableStackTrace) {
35+
super(message, cause, enableSuppression, writableStackTrace);
36+
}
37+
38+
public IllegalJsonFormatException(final String message, final Throwable cause) {
39+
super(message, cause);
40+
}
41+
42+
public IllegalJsonFormatException(final String message) {
43+
super(message);
44+
}
45+
46+
public IllegalJsonFormatException(final Throwable cause) {
47+
super(cause);
48+
}
49+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright since 2014 Web Firm Framework
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.webfirmframework.wffweb.json;
17+
18+
/**
19+
* @since 12.0.4
20+
*/
21+
public enum JsonArrayType {
22+
/**
23+
* represents JsonList which is extended by ArrayList.
24+
*/
25+
JSON_LIST,
26+
/**
27+
* represents JsonLinkedList which is extended by LinkedList.
28+
*/
29+
JSON_LINKED_LIST,
30+
31+
/**
32+
* represents immutable List in Java
33+
*/
34+
UNMODIFIABLE_LIST;
35+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright since 2014 Web Firm Framework
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.webfirmframework.wffweb.json;
17+
18+
/**
19+
* @since 12.0.4
20+
*/
21+
public sealed interface JsonBaseNode extends JsonPart permits JsonMapNode, JsonListNode {
22+
23+
/**
24+
* @return the JSON string.
25+
* @since 12.0.4
26+
*/
27+
@Override
28+
String toJsonString();
29+
30+
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
/*
2+
* Copyright since 2014 Web Firm Framework
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.webfirmframework.wffweb.json;
17+
18+
import java.util.Arrays;
19+
20+
/**
21+
* @since 12.0.4
22+
*/
23+
public enum JsonBooleanValueType {
24+
25+
BOOLEAN {
26+
@Override
27+
Boolean parse(final int[] codePoints, final int[] startEndIndices) {
28+
return JsonBooleanValueType.parseBooleanOtherwiseNull(codePoints, startEndIndices);
29+
}
30+
},
31+
32+
JSON_VALUE {
33+
@Override
34+
JsonValue parse(final int[] codePoints, final int[] startEndIndices) {
35+
return new JsonValue(JsonCodePointUtil.cut(codePoints, startEndIndices), JsonValueType.BOOLEAN);
36+
}
37+
};
38+
39+
private static final int[] TRUE_CODE_POINTS = "true".codePoints().toArray();
40+
41+
private static final int[] FALSE_CODE_POINTS = "false".codePoints().toArray();
42+
43+
JsonBooleanValueType() {
44+
}
45+
46+
Object parse(final int[] codePoints, final int[] startEndIndices) {
47+
throw new AssertionError();
48+
}
49+
50+
private static boolean isBooleanValue(final int[] jsonCodePoints) {
51+
return Arrays.equals(TRUE_CODE_POINTS, jsonCodePoints) || Arrays.equals(FALSE_CODE_POINTS, jsonCodePoints);
52+
}
53+
54+
static boolean isBooleanValue(final int[] jsonCodePoints, final int[] startEndIndices) {
55+
if (startEndIndices == null) {
56+
return isBooleanValue(jsonCodePoints);
57+
}
58+
return Arrays.equals(JsonBooleanValueType.TRUE_CODE_POINTS, 0, JsonBooleanValueType.TRUE_CODE_POINTS.length,
59+
jsonCodePoints, startEndIndices[0], (startEndIndices[1] + 1))
60+
|| Arrays.equals(JsonBooleanValueType.FALSE_CODE_POINTS, 0,
61+
JsonBooleanValueType.FALSE_CODE_POINTS.length, jsonCodePoints, startEndIndices[0],
62+
(startEndIndices[1] + 1));
63+
}
64+
65+
static Boolean parseBooleanOtherwiseNull(final int[] jsonCodePoints, final int[] startEndIndices) {
66+
if (startEndIndices != null) {
67+
if (Arrays.equals(JsonBooleanValueType.TRUE_CODE_POINTS, 0, JsonBooleanValueType.TRUE_CODE_POINTS.length,
68+
jsonCodePoints, startEndIndices[0], (startEndIndices[1] + 1))) {
69+
return Boolean.TRUE;
70+
} else if (Arrays.equals(JsonBooleanValueType.FALSE_CODE_POINTS, 0,
71+
JsonBooleanValueType.FALSE_CODE_POINTS.length, jsonCodePoints, startEndIndices[0],
72+
(startEndIndices[1] + 1))) {
73+
return Boolean.FALSE;
74+
}
75+
return null;
76+
}
77+
if (Arrays.equals(TRUE_CODE_POINTS, jsonCodePoints)) {
78+
return Boolean.TRUE;
79+
} else if (Arrays.equals(FALSE_CODE_POINTS, jsonCodePoints)) {
80+
return Boolean.FALSE;
81+
}
82+
return null;
83+
}
84+
}

0 commit comments

Comments
 (0)