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) Get entity instance name defined byInstanceName
annotationprotected 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
).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
-
getInstanceName
Description copied from interface:InstanceNameProvider
Get entity instance name defined byInstanceName
annotation- Specified by:
getInstanceName
in interfaceInstanceNameProvider
- Parameters:
instance
- instance- 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
-