Skip to content

Commit b35abec

Browse files
committed
addressing more review comments
1 parent b9ed660 commit b35abec

File tree

6 files changed

+25
-48
lines changed

6 files changed

+25
-48
lines changed

pico/api/src/main/java/io/helidon/pico/api/Contract.java

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
*
3030
* If the developer does not have access to the source to place this annotation on the interface definition then consider using
3131
* {@link ExternalContracts} instead - this annotation can be placed on the implementation class implementing the given interface.
32-
*
3332
* See io.helidon.pico.spi.ServiceInfo#getContractsImplemented()
3433
*/
3534
@Documented

pico/api/src/main/java/io/helidon/pico/api/ExternalContracts.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
/**
2525
* Placed on the implementation of a service as an alternative to using a {@link Contract}.
26-
*
26+
* <p>
2727
* Use this annotation when it is impossible to place an annotation on the interface itself - for instance of the interface comes
2828
* from a 3rd party library/provider.
2929
*/

pico/types/pom.xml

-9
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,4 @@
3131
<name>Helidon Pico Types</name>
3232
<description>Provides the runtime types (a subset of SPI) useful for Pico</description>
3333

34-
<dependencies>
35-
<dependency>
36-
<!-- for @JsonIgnore use only -->
37-
<groupId>com.fasterxml.jackson.core</groupId>
38-
<artifactId>jackson-annotations</artifactId>
39-
<scope>provided</scope>
40-
</dependency>
41-
</dependencies>
42-
4334
</project>

pico/types/src/main/java/io/helidon/pico/types/AnnotationAndValue.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -25,41 +25,41 @@
2525
public interface AnnotationAndValue {
2626

2727
/**
28-
* The type name, e.g., {@link jakarta.inject.Named} -> "jakarta.inject.Named".
28+
* The type name, e.g., {@link java.util.Objects} -> "java.util.Objects".
2929
*
3030
* @return the annotation type name
3131
*/
32-
TypeName getTypeName();
32+
TypeName typeName();
3333

3434
/**
3535
* The value property.
3636
*
3737
* @return The string value of value property, or null if no value is present
3838
*/
39-
String getValue();
39+
String value();
4040

4141
/**
4242
* Get a value of an annotation property.
4343
*
4444
* @param name name of the annotation property
4545
* @return string value of the property
4646
*/
47-
String getValue(String name);
47+
String valueOf(String name);
4848

4949
/**
5050
* Get a key-value of all the annotation properties.
5151
*
5252
* @return key-value pairs of all the properties present
5353
*/
54-
Map<String, String> getValues();
54+
Map<String, String> values();
5555

5656
/**
57-
* Determines whether the {@link #getValue()} is a non-null and non-blank value.
57+
* Determines whether the {@link #value()} is a non-null and non-blank value.
5858
*
5959
* @return true if the value provided is non-null and non-blank (i.e., {@link String#isBlank()})
6060
*/
61-
default boolean hasValue() {
62-
return hasValue(getValue());
61+
default boolean hasNonBlankValue() {
62+
return hasNonBlankValue(value());
6363
}
6464

6565
/**
@@ -68,7 +68,7 @@ default boolean hasValue() {
6868
* @param val the value to check
6969
* @return true if the value provided is non-null and non-blank.
7070
*/
71-
static boolean hasValue(String val) {
71+
static boolean hasNonBlankValue(String val) {
7272
return Objects.nonNull(val) && !val.isBlank();
7373
}
7474

pico/types/src/main/java/io/helidon/pico/types/TypeName.java

+15-26
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,25 @@
1818

1919
import java.util.List;
2020

21-
import com.fasterxml.jackson.annotation.JsonIgnore;
22-
2321
/**
2422
* TypeName is similar to {@link java.lang.reflect.Type} in its most basic use case. The {@link #getName()} returns the package +
2523
* class name tuple for the given type (i.e., the canonical type name).
2624
* <p>
2725
*
2826
* This class also provides a number of methods that are typically found in {@link java.lang.Class} that can be used to avoid
2927
* classloading resolution:
30-
* <li>{@link #getPackageName()} and {@link #getClassName()} - access to the package and simple class names.
31-
* <li>{@link #isPrimitive()} and {@link #isArray()} - access to flags that is typically found in {@link java.lang.Class}.
28+
* <li>{@link #packageName()} and {@link #className()} - access to the package and simple class names.
29+
* <li>{@link #primitive()} and {@link #array()} - access to flags that is typically found in {@link java.lang.Class}.
3230
* <p>
3331
*
3432
* Additionally, this class offers a number of additional methods that are useful for handling generics:
35-
* <li>{@link #isGeneric()} - true when this type is declared to include generics (i.e., has type arguments).
36-
* <li>{@link #isWildcard()} - true if using wildcard generics usage.
37-
* <li>{@link #getTypeArguments()} - access to generics / parametrized type information.
33+
* <li>{@link #generic()} - true when this type is declared to include generics (i.e., has type arguments).
34+
* <li>{@link #wildcard()} - true if using wildcard generics usage.
35+
* <li>{@link #typeArguments()} - access to generics / parametrized type information.
3836
* <p>
3937
*
4038
* Finally, this class offers a number of methods that are helpful for code generation:
41-
* <li>{@link #getDeclaredName()} and {@link #getFQName()}.
39+
* <li>{@link #declaredName()} and {@link #fqName()}.
4240
*/
4341
public interface TypeName extends Comparable<TypeName> {
4442

@@ -47,64 +45,55 @@ public interface TypeName extends Comparable<TypeName> {
4745
*
4846
* @return the package name
4947
*/
50-
@JsonIgnore
51-
String getPackageName();
48+
String packageName();
5249

5350
/**
5451
* Functions the same as {@link Class#getSimpleName()}.
5552
*
5653
* @return the simple class name
5754
*/
58-
@JsonIgnore
59-
String getClassName();
55+
String className();
6056

6157
/**
6258
* Functions the same as {@link Class#isPrimitive()}.
6359
*
6460
* @return true if this type represents a primitive type.
6561
*/
66-
@JsonIgnore
67-
boolean isPrimitive();
62+
boolean primitive();
6863

6964
/**
7065
* Functions the same as {@link Class#isArray()}.
7166
*
7267
* @return true if this type represents a primitive array [].
7368
*/
74-
@JsonIgnore
75-
boolean isArray();
69+
boolean array();
7670

7771
/**
7872
* @return used to represent a generic (e.g., "Optional<CB>").
7973
*/
80-
@JsonIgnore
81-
boolean isGeneric();
74+
boolean generic();
8275

8376
/**
8477
* @return used to represent a wildcard (e.g., "? extends SomeType").
8578
*/
86-
@JsonIgnore
87-
boolean isWildcard();
79+
boolean wildcard();
8880

8981
/**
9082
* @return the type arguments of this type, if this type supports generics/parameterized type.
9183
*/
92-
@JsonIgnore
93-
List<TypeName> getTypeArguments();
84+
List<TypeName> typeArguments();
9485

9586
/**
9687
* Typically used as part of code-gen, when ".class" is tacked onto the suffix of what this returns.
9788
*
9889
* @return same as getName() unless the type is an array, and then will add "[]" to the return.
9990
*/
100-
@JsonIgnore
101-
String getDeclaredName();
91+
String declaredName();
10292

10393
/**
10494
* @return the fully qualified name which includes the use of generics/parameterized types, arrays, etc.
10595
*/
106-
@JsonIgnore
107-
String getFQName();
96+
String fqName();
10897

10998
/**
11099
* @return the base type name given the set package and class name, but not including the generics/parameterized types.

pico/types/src/main/java/module-info.java

-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,5 @@
1818
* Pico minimal (spi) types module.
1919
*/
2020
module io.helidon.pico.types {
21-
requires static com.fasterxml.jackson.annotation;
22-
2321
exports io.helidon.pico.types;
2422
}

0 commit comments

Comments
 (0)