@Component(value="cuba_DynamicAttributesTools")
public class DynamicAttributesTools
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected AttributeOptionsLoaderService |
attributeOptionsLoader |
protected DynamicAttributes |
dynamicAttributes |
protected MetadataTools |
metadataTools |
static java.lang.String |
NAME |
Constructor and Description |
---|
DynamicAttributesTools() |
Modifier and Type | Method and Description |
---|---|
java.util.Collection<CategoryAttribute> |
getDependentCategoryAttributes(CategoryAttribute attribute)
Returns collection of dependent attributes for given category attribute.
|
java.lang.String |
getDynamicAttributeValueAsString(MetaProperty metaProperty,
java.lang.Object value)
For collection dynamic attributes the method returns a list of formatted collection items joined with the comma,
for non-collection dynamic attribute a formatted value is returned
|
java.util.Collection<CategoryAttribute> |
getIndependentCategoryAttributes(BaseGenericIdEntity entity)
Returns all independent (that does not have any 'depends on' attributes) dynamic attributes for given entity.
|
MetaPropertyPath |
getMetaPropertyPath(MetaClass metaClass,
java.lang.String attributeCode)
Get special meta property path object for dynamic attribute by code
|
MetaPropertyPath |
getMetaPropertyPath(MetaClass metaClass,
java.util.UUID attributeId)
Get special meta property path object for dynamic attribute id
|
java.util.List |
loadOptions(BaseGenericIdEntity entity,
CategoryAttribute attribute) |
public static final java.lang.String NAME
@Inject protected DynamicAttributes dynamicAttributes
@Inject protected MetadataTools metadataTools
@Inject protected AttributeOptionsLoaderService attributeOptionsLoader
@Nullable public MetaPropertyPath getMetaPropertyPath(MetaClass metaClass, java.lang.String attributeCode)
@Nullable public MetaPropertyPath getMetaPropertyPath(MetaClass metaClass, java.util.UUID attributeId)
public java.lang.String getDynamicAttributeValueAsString(MetaProperty metaProperty, java.lang.Object value)
public java.util.Collection<CategoryAttribute> getIndependentCategoryAttributes(BaseGenericIdEntity entity)
public java.util.Collection<CategoryAttribute> getDependentCategoryAttributes(CategoryAttribute attribute)
public java.util.List loadOptions(BaseGenericIdEntity entity, CategoryAttribute attribute)