Package com.adobe.aem.dermis.util
Class DataModelUtils
- java.lang.Object
-
- com.adobe.aem.dermis.util.DataModelUtils
-
public class DataModelUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description DataModelUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IDataModelgetDatamodelByNameAndSchema(java.util.List<? extends IDataModel> dataModels, java.lang.String entityName, java.lang.String schema)Convenience method for retrieving an entity by its name and schema if schema is not empty else, only check for entity name in data model list.static java.lang.ClassgetJavaClassForTypeAndFormat(PropertyType propertyType, PropertyFormatType formatType)Translates dermis PropertyType and a FormatType into corresponding Java class type Currently it supports only primitive types (and not 'ARRAY' and 'OBJECT')static IDataModelgetRefDatamodel(java.util.List<? extends IDataModel> dataModels, IProperty property)Return the referenced datamodel by property using the provided datamodels liststatic IDataModelresolveType(java.util.List<? extends IDataModel> dataModels, java.util.Map data)
-
-
-
Method Detail
-
getJavaClassForTypeAndFormat
public static java.lang.Class getJavaClassForTypeAndFormat(PropertyType propertyType, PropertyFormatType formatType)
Translates dermis PropertyType and a FormatType into corresponding Java class type Currently it supports only primitive types (and not 'ARRAY' and 'OBJECT')- Parameters:
propertyType-formatType-- Returns:
-
resolveType
public static IDataModel resolveType(java.util.List<? extends IDataModel> dataModels, java.util.Map data)
- Parameters:
dataModels-data- input data value for the property- Throws:
DermisException
-
getDatamodelByNameAndSchema
public static IDataModel getDatamodelByNameAndSchema(java.util.List<? extends IDataModel> dataModels, java.lang.String entityName, java.lang.String schema)
Convenience method for retrieving an entity by its name and schema if schema is not empty else, only check for entity name in data model list.- Parameters:
entityName- the name of the entityschema- schema of the entity- Returns:
- the
IDataModelwith the given name. Returns null if no such entity is found.
-
getRefDatamodel
public static IDataModel getRefDatamodel(java.util.List<? extends IDataModel> dataModels, IProperty property)
Return the referenced datamodel by property using the provided datamodels list- Parameters:
dataModels-property-- Returns:
- referenced datamodel by property
-
-