java.lang.Object
org.fuin.ddd4j.core.JandexEntityIdFactory
- All Implemented Interfaces:
EntityIdFactory
Registry that is built up by scanning for classes that are annotated with:
HasPublicStaticIsValidMethodHasPublicStaticValueOfMethod(with String parameter)HasEntityTypeConstant
EntityId.-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.JandexEntityIdFactory(File... classesDirs) Constructor with classes directories. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsType(String type) Verifies if the given type string is a valid one.createEntityId(String type, String id) Creates an entity id by type and string identifier.Returns a list of knownEntityIdclasses.booleanDetermines if an identifier of the given type is valid.typeConstant(Class<?> entityIdClass)
-
Constructor Details
-
JandexEntityIdFactory
public JandexEntityIdFactory()Default constructor. -
JandexEntityIdFactory
Constructor with classes directories. Most likely only used in tests.- Parameters:
classesDirs- Directories with class files.
-
-
Method Details
-
createEntityId
Description copied from interface:EntityIdFactoryCreates an entity id by type and string identifier.- Specified by:
createEntityIdin interfaceEntityIdFactory- Parameters:
type- Type of the identifier.id- Identifier.- Returns:
- Entity identifier.
-
containsType
Description copied from interface:EntityIdFactoryVerifies if the given type string is a valid one.- Specified by:
containsTypein interfaceEntityIdFactory- Parameters:
type- Type to be verified.- Returns:
- TRUE if the factory can create identifiers for the given type.
-
isValid
Description copied from interface:EntityIdFactoryDetermines if an identifier of the given type is valid.- Specified by:
isValidin interfaceEntityIdFactory- Parameters:
type- Type of the identifier.id- Identifier to be verified.- Returns:
- TRUE if the factory can create and identifier for the given type and value.
-
getIdClasses
Returns a list of knownEntityIdclasses.- Returns:
- Entity ID classes.
-
typeConstant
-