java.lang.Object
io.helidon.codegen.ElementInfoPredicates
Commonly used predicates to filter typed element info.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Predicate
<TypedElementInfo> A predicate that accepts all. -
Method Summary
Modifier and TypeMethodDescriptionstatic Predicate
<TypedElementInfo> elementName
(String name) Predicate for element name (such as method name, or field name).static Predicate
<TypedElementInfo> hasAnnotation
(TypeName annotation) Predicate for an existence of an annotation.static boolean
hasNoArgs
(TypedElementInfo element) Predicate for element with no arguments (suitable for methods).static Predicate
<TypedElementInfo> Predicate for element with the specified parameters types (suitable for methods).static Predicate
<TypedElementInfo> Predicate for element with the specified parameters types (suitable for methods).static boolean
isDefault
(TypedElementInfo element) Predicate for default modifier (default methods on interfaces).static boolean
isField
(TypedElementInfo element) Predicate for field element kind.static boolean
isMethod
(TypedElementInfo element) Predicate for method element kind.static boolean
isPrivate
(TypedElementInfo element) Predicate for private modifier.static boolean
isPublic
(TypedElementInfo element) Predicate for public modifier.static boolean
isStatic
(TypedElementInfo element) Predicate for static modifier.static boolean
isVoid
(TypedElementInfo element) Predicate for void methods.
-
Field Details
-
ALL_PREDICATE
A predicate that accepts all.
-
-
Method Details
-
isMethod
Predicate for method element kind.- Parameters:
element
- typed element info to test- Returns:
- whether the element represents a method
-
isField
Predicate for field element kind.- Parameters:
element
- typed element info to test- Returns:
- whether the element represents a field
-
isStatic
Predicate for static modifier.- Parameters:
element
- typed element info to test- Returns:
- whether the element has static modifier
-
isPrivate
Predicate for private modifier.- Parameters:
element
- typed element info to test- Returns:
- whether the element has private modifier
-
isPublic
Predicate for public modifier.- Parameters:
element
- typed element info to test- Returns:
- whether the element has public modifier
-
isDefault
Predicate for default modifier (default methods on interfaces).- Parameters:
element
- typed element info to test- Returns:
- whether the element has default modifier
-
isVoid
Predicate for void methods.- Parameters:
element
- typed element info to test- Returns:
- whether the element has void return type (both primitive and boxed)
-
hasNoArgs
Predicate for element with no arguments (suitable for methods).- Parameters:
element
- typed element info to test- Returns:
- whether the element has no arguments
-
hasAnnotation
Predicate for an existence of an annotation.- Parameters:
annotation
- Annotation to check for- Returns:
- a new predicate for the provided annotation
-
elementName
Predicate for element name (such as method name, or field name).- Parameters:
name
- name of the element to check for- Returns:
- a new predicate for the provided element name
-
hasParams
Predicate for element with the specified parameters types (suitable for methods). The method must have exactly the same number and types of parameters.- Parameters:
paramTypes
- expected parameter types- Returns:
- a new predicate for the provided parameter types
-
hasParams
Predicate for element with the specified parameters types (suitable for methods). The method must have exactly the same number and types of parameters.- Parameters:
paramTypes
- expected parameter types- Returns:
- a new predicate for the provided parameter types
-