Package io.jmix.core
Interface InstanceNameProvider
- All Known Implementing Classes:
InstanceNameProviderImpl
public interface InstanceNameProvider
Provide instance name and instance name properties.
-
Method Summary
Modifier and TypeMethodDescriptiongetInstanceName
(Object instance) Gets entity instance name defined byInstanceName
annotation.getInstanceNameRelatedProperties
(MetaClass metaClass, boolean useOriginal) Return a collection of properties included into entity's name pattern (seeInstanceName
).boolean
isInstanceNameDefined
(Class<?> aClass) Checks ifInstanceName
annotation is present in an entity class, i.e.
-
Method Details
-
isInstanceNameDefined
Checks ifInstanceName
annotation is present in an entity class, i.e. whether instance name can be obtained for entity instances.- Parameters:
aClass
- an entity class to check- Returns:
true
ifInstanceName
annotation is present,false
otherwise
-
getInstanceName
Gets entity instance name defined byInstanceName
annotation. IfInstanceName
annotation is not defined, returnsentity.toString()
.- Parameters:
instance
- an entity instance to get instance name- Returns:
- instance name
-
getInstanceNameRelatedProperties
Return a collection of properties included into entity's name pattern (seeInstanceName
).- Parameters:
metaClass
- entity metaclassuseOriginal
- if true, and if the given metaclass doesn't define aInstanceName
and if it is an extended entity, this method tries to find a name pattern in an original entity- Returns:
- collection of the name pattern properties
-