java.lang.Object
io.helidon.codegen.ElementInfoPredicates
Commonly used predicates to filter typed element info.
- See Also:
-
Field Summary
FieldsModifier 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 booleanhasNoArgs(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 booleanisAbstract(TypedElementInfo element) Predicate for abstract modifier.static booleanisConstructor(TypedElementInfo element) Predicate for constructor element kind.static booleanisDefault(TypedElementInfo element) Predicate for default modifier (default methods on interfaces).static booleanisField(TypedElementInfo element) Predicate for field element kind.static booleanisMethod(TypedElementInfo element) Predicate for method element kind.static booleanisPrivate(TypedElementInfo element) Predicate for private modifier.static booleanisPublic(TypedElementInfo element) Predicate for public modifier.static booleanisStatic(TypedElementInfo element) Predicate for static modifier.static booleanisVoid(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
-
isConstructor
Predicate for constructor element kind.- Parameters:
element- typed element info to test- Returns:
- whether the element represents a constructor
-
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
-
isAbstract
Predicate for abstract modifier.- Parameters:
element- typed element info to test- Returns:
- whether the element has abstract 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
-