public class

CustomFieldUtils

extends Object
java.lang.Object
   ↳ org.mule.module.netsuite.util.CustomFieldUtils

Summary

Public Constructors
CustomFieldUtils()
Public Methods
static void addCustomFieldToList(Map<String, CustomFieldRef> customFields, CustomizationFieldType rec, String internalId, String label, String scriptId)
static boolean appliesToEntity(RecordType type, ItemCustomField field)
static boolean appliesToEntity(RecordType type, TransactionBodyCustomField field)
static boolean appliesToEntity(RecordType type, EntityCustomField field)
static boolean appliesToEntity(RecordType type, CrmCustomField field)
static boolean appliesToEntity(RecordType type, ItemOptionCustomField field)
static boolean appliesToEntity(RecordType type, TransactionColumnCustomField field)
static void formatCustomFieldMap(String separator, CustomFieldList list, Map<String, Object> pojo)
static CustomFieldList fromMap(Map<String, Object> customFields, String separator)
In order to show meta-data correctly, the customFieldList is being displayed as a MAP of string Object, there the values are instances of the custom fields type.
static CustomizationRef getCustomizationRef(String metaDataKey, String separator)
static DataType getDataType(CustomFieldRef ref)
static Class<?> getFromCustomizationFieldClass(CustomizationFieldType type)
static String getMetadataFieldKey(String label, CustomFieldRef ref, String separator)
static CustomFieldRef getMetadataFieldRef(String key, String separator, Object value)
static String getMetadataKey(CustomizationRef customField, String separator)
Generate a custom key that identifies the custom records.
static CustomRecord getRecordRef(String metaDataKey, String separator)
static boolean needsToConvertCustomFieldListField(Map<String, Object> attributes)
Check that the map has a field named customFieldList and that it is a Map that has a CustomFieldRef object or a Map
static void updateCustomFieldMapToList(Map<String, Object> attributes, String separator)
This method checks if there is a custom field Map used to represent the custom field List and updates the content of the map by creating a custom field list object and overriding the object
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public CustomFieldUtils ()

Public Methods

public static void addCustomFieldToList (Map<String, CustomFieldRef> customFields, CustomizationFieldType rec, String internalId, String label, String scriptId)

Parameters
customFields
rec
internalId
label
scriptId
Throws
IllegalAccessException
InstantiationException

public static boolean appliesToEntity (RecordType type, ItemCustomField field)

Parameters
type
field

public static boolean appliesToEntity (RecordType type, TransactionBodyCustomField field)

Parameters
type
field

public static boolean appliesToEntity (RecordType type, EntityCustomField field)

Parameters
type
field

public static boolean appliesToEntity (RecordType type, CrmCustomField field)

Parameters
type
field

public static boolean appliesToEntity (RecordType type, ItemOptionCustomField field)

Parameters
type
field

public static boolean appliesToEntity (RecordType type, TransactionColumnCustomField field)

Parameters
type
field

public static void formatCustomFieldMap (String separator, CustomFieldList list, Map<String, Object> pojo)

Parameters
separator
list
pojo
Throws
ClassNotFoundException
IllegalAccessException
InstantiationException

public static CustomFieldList fromMap (Map<String, Object> customFields, String separator)

In order to show meta-data correctly, the customFieldList is being displayed as a MAP of string Object, there the values are instances of the custom fields type. In order to correctly handle this when un-mapping the attributes we need to convert the entry map to a CustomFieldList.

Parameters
customFields Map that contains CustomFieldRef objects
separator

public static CustomizationRef getCustomizationRef (String metaDataKey, String separator)

Parameters
metaDataKey
separator

public static DataType getDataType (CustomFieldRef ref)

Parameters
ref

public static Class<?> getFromCustomizationFieldClass (CustomizationFieldType type)

Parameters
type

public static String getMetadataFieldKey (String label, CustomFieldRef ref, String separator)

Parameters
label
ref
separator

public static CustomFieldRef getMetadataFieldRef (String key, String separator, Object value)

Parameters
key
separator
value
Throws
ClassNotFoundException
IllegalAccessException
InstantiationException

public static String getMetadataKey (CustomizationRef customField, String separator)

Generate a custom key that identifies the custom records. This kill will be used to retrieve the meta-data dynamically

Parameters
customField
separator

public static CustomRecord getRecordRef (String metaDataKey, String separator)

Parameters
metaDataKey
separator

public static boolean needsToConvertCustomFieldListField (Map<String, Object> attributes)

Check that the map has a field named customFieldList and that it is a Map that has a CustomFieldRef object or a Map

Parameters
attributes

public static void updateCustomFieldMapToList (Map<String, Object> attributes, String separator)

This method checks if there is a custom field Map used to represent the custom field List and updates the content of the map by creating a custom field list object and overriding the object

Parameters
attributes
separator