public final class DynamicAttributesUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
decodeAttributeCode(java.lang.String attributeCode)
Remove dynamic attribute marker (+) from attribute code (if exists)
|
static java.lang.String |
encodeAttributeCode(java.lang.String attributeCode)
Add dynamic attribute marker (+) to attribute code (if does not exist)
|
static java.lang.Class |
getAttributeClass(CategoryAttribute attribute)
Resolve attribute value's Java class
|
static CategoryAttribute |
getCategoryAttribute(MetaProperty metaProperty) |
static 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
|
static MetaPropertyPath |
getMetaPropertyPath(MetaClass metaClass,
CategoryAttribute attribute)
Get special meta property path object for dynamic attribute
|
static MetaPropertyPath |
getMetaPropertyPath(MetaClass metaClass,
java.lang.String attributeCode)
Get special meta property path object for dynamic attribute by code
|
static MetaPropertyPath |
getMetaPropertyPath(MetaClass metaClass,
java.util.UUID attributeId)
Get special meta property path object for dynamic attribute id
|
static boolean |
isDynamicAttribute(MetaProperty metaProperty)
Check if the meta property is dynamic attribute property
|
static boolean |
isDynamicAttribute(java.lang.String name)
Check if the name has dynamic attribute marker
|
public static MetaPropertyPath getMetaPropertyPath(MetaClass metaClass, CategoryAttribute attribute)
@Nullable public static MetaPropertyPath getMetaPropertyPath(MetaClass metaClass, java.lang.String attributeCode)
@Nullable public static MetaPropertyPath getMetaPropertyPath(MetaClass metaClass, java.util.UUID attributeId)
public static java.lang.String decodeAttributeCode(java.lang.String attributeCode)
public static java.lang.String encodeAttributeCode(java.lang.String attributeCode)
public static boolean isDynamicAttribute(java.lang.String name)
public static boolean isDynamicAttribute(MetaProperty metaProperty)
public static CategoryAttribute getCategoryAttribute(MetaProperty metaProperty)
public static java.lang.Class getAttributeClass(CategoryAttribute attribute)
public static java.lang.String getDynamicAttributeValueAsString(MetaProperty metaProperty, java.lang.Object value)