Class AccessorFirstStrategy
java.lang.Object
org.spongepowered.eventimplgen.eventgencore.AccessorFirstStrategy
- All Implemented Interfaces:
PropertySearchStrategy
Finds properties by enumerating accessors and then later finding the
closest matching mutator.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionAccessorFirstStrategy(Types types, Elements elements, Descriptors descriptors, boolean allowFluentStyle) -
Method Summary
Modifier and TypeMethodDescriptionprotected @Nullable ExecutableElementfindMutator(ExecutableElement accessor, @Nullable Collection<ExecutableElement> candidates, DeclaredType implementedBy) Find the corresponding mutator for an accessor method from a collection of candidates.findProperties(TypeElement type) Enumerate a list of properties on a class, considering super types and implemented interfaces.static StringgetPropertyName(CharSequence name) Clean up the property name.
-
Constructor Details
-
AccessorFirstStrategy
@AssistedInject public AccessorFirstStrategy(Types types, Elements elements, Descriptors descriptors, @Assisted boolean allowFluentStyle)
-
-
Method Details
-
getPropertyName
Clean up the property name.- Parameters:
name- The name- Returns:
- The cleaned up name
-
findMutator
@Nullable protected @Nullable ExecutableElement findMutator(ExecutableElement accessor, @Nullable @Nullable Collection<ExecutableElement> candidates, DeclaredType implementedBy) Find the corresponding mutator for an accessor method from a collection of candidates.- Parameters:
accessor- The accessorcandidates- The collection of candidatesimplementedBy- The abstract super type implementation to consider- Returns:
- A mutator, if found
-
findProperties
Description copied from interface:PropertySearchStrategyEnumerate a list of properties on a class, considering super types and implemented interfaces.The returned list is sorted lexographically by property name
- Specified by:
findPropertiesin interfacePropertySearchStrategy- Parameters:
type- The class- Returns:
- A set of properties
-