Skip to content

Package: ClassMultiReleaseExtension

ClassMultiReleaseExtension

nameinstructionbranchcomplexitylinemethod
ClassMultiReleaseExtension()
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
exceptionToThrow(Class)
M: 23 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
findCreator(Class, Constructor[], AnnotationIntrospector)
M: 17 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
isRecord(Class)
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
isSpecialAccessorMethod(Method, Map)
M: 21 C: 0
0%
M: 8 C: 0
0%
M: 5 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
shouldTransformToPropertyName(Method)
M: 8 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * Copyright (c) 2021, 2022 Oracle and/or its affiliates. All rights reserved.
3: *
4: * This program and the accompanying materials are made available under the
5: * terms of the Eclipse Public License v. 2.0 which is available at
6: * http://www.eclipse.org/legal/epl-2.0,
7: * or the Eclipse Distribution License v. 1.0 which is available at
8: * http://www.eclipse.org/org/documents/edl-v10.php.
9: *
10: * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11: */
12:
13: package org.eclipse.yasson.internal;
14:
15: import java.lang.reflect.Constructor;
16: import java.lang.reflect.Method;
17: import java.util.Map;
18: import java.util.Optional;
19:
20: import jakarta.json.bind.JsonbException;
21:
22: import org.eclipse.yasson.internal.model.JsonbCreator;
23: import org.eclipse.yasson.internal.model.Property;
24:
25: /**
26: * Search for instance creator from other sources.
27: * Mainly intended to add extensibility for different java versions and new features.
28: */
29: public class ClassMultiReleaseExtension {
30:
31: private ClassMultiReleaseExtension() {
32: throw new IllegalStateException("This class cannot be instantiated");
33: }
34:
35: static boolean shouldTransformToPropertyName(Method method) {
36: return true;
37: }
38:•
39: static boolean isSpecialAccessorMethod(Method method, Map<String, Property> classProperties) {
40: return false;
41: }
42:•
43:• static JsonbCreator findCreator(Class<?> clazz,
44:• Constructor<?>[] declaredConstructors,
45:• AnnotationIntrospector introspector) {
46: return null;
47: }
48:
49: public static boolean isRecord(Class<?> clazz) {
50: return false;
51:• }
52:•
53: public static Optional<JsonbException> exceptionToThrow(Class<?> clazz) {
54: return Optional.empty();
55: }
56:
57: }