Package io.jmix.core

Interface InstanceNameProvider

All Known Implementing Classes:
InstanceNameProviderImpl

public interface InstanceNameProvider
Provide instance name and instance name properties.
  • Method Details

    • getInstanceName

      String getInstanceName(Object instance)
      Get entity instance name defined by InstanceName annotation
      Parameters:
      instance - instance
      Returns:
      instance name
    • getInstanceName

      String getInstanceName(Object instance, MetaClass metaClass)
      Gets entity instance name defined by InstanceName annotation in metaClass or its ancestor if CoreProperties.instanceNameFallbackEnabled is true.
      Parameters:
      instance - instance
      metaClass - class to get @InstanceName definition from
      Returns:
      instance name
      See Also:
      • CoreProperties.instanceNameFallbackEnabled
    • getInstanceName

      String getInstanceName(Object instance, Class<?> entityClass)
      Gets entity instance name defined by InstanceName annotation in entityClass or its ancestor if CoreProperties.instanceNameFallbackEnabled is true.
      Parameters:
      instance - instance
      entityClass - class to get @InstanceName definition from
      Returns:
      instance name
      See Also:
      • CoreProperties.instanceNameFallbackEnabled
    • getInstanceNameRelatedProperties

      Collection<MetaProperty> getInstanceNameRelatedProperties(MetaClass metaClass, boolean useOriginal)
      Return a collection of properties included into entity's name pattern (see InstanceName).
      Parameters:
      metaClass - entity metaclass
      useOriginal - if true, and if the given metaclass doesn't define a InstanceName 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