Package io.jmix.core.impl
Class InstanceNameProviderImpl
java.lang.Object
io.jmix.core.impl.InstanceNameProviderImpl
- All Implemented Interfaces:
InstanceNameProvider
@Component("core_InstanceNameProvider")
public class InstanceNameProviderImpl
extends Object
implements InstanceNameProvider
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected DatatypeRegistry
protected ExtendedEntities
protected com.google.common.cache.LoadingCache<MetaClass,
Optional<InstanceNameProviderImpl.InstanceNameRec>> protected Messages
protected Metadata
protected MetadataTools
protected MethodArgumentsProvider
protected ContextArgumentResolverComposite
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetInstanceName
(Object instance) Gets entity instance name defined byInstanceName
annotation.protected Collection<MetaProperty>
getInstanceNameProperties
(MetaClass metaClass, Method nameMethod, MetaProperty nameProperty) 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.parseNamePattern
(MetaClass metaClass) void
setResolvers
(ContextArgumentResolverComposite resolvers)
-
Field Details
-
metadata
-
extendedEntities
-
datatypeRegistry
-
messages
-
metadataTools
-
resolvers
-
methodArgumentsProvider
-
instanceNameRecCache
protected com.google.common.cache.LoadingCache<MetaClass,Optional<InstanceNameProviderImpl.InstanceNameRec>> instanceNameRecCache
-
-
Constructor Details
-
InstanceNameProviderImpl
public InstanceNameProviderImpl()
-
-
Method Details
-
getResolvers
-
setResolvers
-
isInstanceNameDefined
Description copied from interface:InstanceNameProvider
Checks ifInstanceName
annotation is present in an entity class, i.e. whether instance name can be obtained for entity instances.- Specified by:
isInstanceNameDefined
in interfaceInstanceNameProvider
- Parameters:
aClass
- an entity class to check- Returns:
true
ifInstanceName
annotation is present,false
otherwise
-
getInstanceName
Description copied from interface:InstanceNameProvider
Gets entity instance name defined byInstanceName
annotation. IfInstanceName
annotation is not defined, returnsentity.toString()
.- Specified by:
getInstanceName
in interfaceInstanceNameProvider
- Parameters:
instance
- an entity instance to get instance name- Returns:
- instance name
-
getInstanceNameRelatedProperties
public Collection<MetaProperty> getInstanceNameRelatedProperties(MetaClass metaClass, boolean useOriginal) Description copied from interface:InstanceNameProvider
Return a collection of properties included into entity's name pattern (seeInstanceName
).- Specified by:
getInstanceNameRelatedProperties
in interfaceInstanceNameProvider
- 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
-
getInstanceNameProperties
protected Collection<MetaProperty> getInstanceNameProperties(MetaClass metaClass, @Nullable Method nameMethod, @Nullable MetaProperty nameProperty) -
parseNamePattern
-