Interface FindStaticAttribute
This interface provides functionality to find static attribute names and fields from various contexts including mapping contexts, type maps, and DynO objects. It helps in resolving attribute references during object mapping and validation operations.
-
Method Summary
Modifier and TypeMethodDescriptionbooleancheckIfFieldExists(DynO dynO, String fieldName) Checks if a field exists in a DynO object.findStaticAttributeFieldFromDynOClass(Class<? extends DynO> clazz, String fieldName) Finds a static attribute field from a DynO class.findStaticAttributeNameFromDynO(DynO sourceDynO, String fieldName) Finds a static attribute name from a DynO object.findStaticAttributeNameFromMapping(TypeMap<?, ?> typeMap, String fieldName) Finds a static attribute name from a ModelMapper type map.findStaticAttributeNameFromMappingContext(MappingContext<?, ?> context, String fieldName) Finds a static attribute name from a ModelMapper mapping context.
-
Method Details
-
findStaticAttributeNameFromMappingContext
Finds a static attribute name from a ModelMapper mapping context.This method extracts the static attribute name corresponding to the given field name from the provided mapping context.
- Parameters:
context- the ModelMapper mapping context containing source and destination informationfieldName- the field name to find the corresponding static attribute for- Returns:
- the name of the static attribute, or null if not found
-
findStaticAttributeNameFromMapping
Finds a static attribute name from a ModelMapper type map.This method extracts the static attribute name corresponding to the given field name from the provided type map.
- Parameters:
typeMap- the ModelMapper type map containing mapping definitionsfieldName- the field name to find the corresponding static attribute for- Returns:
- the name of the static attribute, or null if not found
-
findStaticAttributeNameFromDynO
Finds a static attribute name from a DynO object.This method extracts the static attribute name corresponding to the given field name from the provided DynO object.
- Parameters:
sourceDynO- the DynO object to search withinfieldName- the field name to find the corresponding static attribute for- Returns:
- the name of the static attribute, or null if not found
-
findStaticAttributeFieldFromDynOClass
Finds a static attribute field from a DynO class.This method locates the Field object corresponding to the given field name within the specified DynO class.
- Parameters:
clazz- the DynO class to search withinfieldName- the name of the field to find- Returns:
- the Field object representing the static attribute, or null if not found
-
checkIfFieldExists
Checks if a field exists in a DynO object.This method verifies whether the specified field name corresponds to an existing field within the provided DynO object.
- Parameters:
dynO- the DynO object to checkfieldName- the name of the field to check for existence- Returns:
- true if the field exists, false otherwise
-