| Constructor and Description |
|---|
ValueUtil() |
| Modifier and Type | Method and Description |
|---|---|
static IValueMap |
generateValue(IDataModel dataModel,
Map<String,Object> data,
boolean autoCoerce)
Construct the value object according to provided
DataModel structured based on result (Java Object) of operation execution. |
static IValueMap |
generateValue(IDataModel dataModel,
Map<String,Object> data,
boolean autoCoerce,
boolean generateNullForPropsNotInData)
Construct the value object according to provided
DataModel structured based on result (Java Object) of operation execution. |
static IValueMap |
generateValue(IDataModel dataModel,
Map<String,Object> data,
boolean autoCoerce,
boolean generateNullForPropsNotInData,
boolean removeComputedAttributes)
Construct the value object according to provided
DataModel structured based on result (Java Object) of operation execution. |
static IValue |
generateValue(IProperty property,
Object data,
boolean autoCoerce)
Construct the value object according to provided
Property and based on result (Java Object) of operation execution. |
static IValue |
generateValue(IProperty property,
Object data,
boolean autoCoerce,
boolean generateNullForPropsNotInData)
Construct the value object according to provided
Property and based on result (Java Object) of operation execution. |
static IValue |
generateValue(IProperty property,
Object data,
boolean autoCoerce,
boolean generateNullForPropsNotInData,
boolean removeComputedAttributes)
Construct the value object according to provided
Property and based on result (Java Object) of operation execution. |
static org.apache.commons.beanutils.ConvertUtilsBean |
getConversionUtil()
Utility method to provided the Conversion provider
|
static Object |
getFormattedValue(Object value)
Return formatted value for provided input.
|
static IValue |
getValue(IValueMap valueMap,
String name)
Get the value object associated with a key.
|
static IValueList |
jsonListToValue(org.apache.sling.commons.json.JSONArray array)
Construct the value object based on the provided
JSONArray. |
static IValueMap |
jsonObjectToValue(org.apache.sling.commons.json.JSONObject data)
Construct the value object based on the provided
JSONObject. |
static IValue |
jsonToValue(Object data)
Construct the value object based on the provided json object or array.
|
static IValue |
jsonToValue(String jsonString,
IProperty property)
Construct the value object based on the provided json string.
|
public static IValue generateValue(IProperty property, Object data, boolean autoCoerce) throws DermisException
Property and based on result (Java Object) of operation execution.
if autoCoerce is false if any type/value is mismatched then DermisExceptionCodes.PROPERTY_TYPE_MISS_MATCH exception is thrown and if its true it will try to convert the value according to property typeproperty - - Property according to which value object is constructed.data - - Result of operation execution.autoCoerce - - boolean value represent to auto coerce the value according to typeIValue representing the output of operation.{@link - DermisException}DermisExceptionpublic static IValue generateValue(IProperty property, Object data, boolean autoCoerce, boolean generateNullForPropsNotInData) throws DermisException
Property and based on result (Java Object) of operation execution.
if autoCoerce is false if any type/value is mismatched then DermisExceptionCodes.PROPERTY_TYPE_MISS_MATCH exception is thrown and if its true it will try to convert the value according to property typeproperty - - Property according to which value object is constructed.data - - Result of operation execution.autoCoerce - - boolean value represent to auto coerce the value according to typegenerateNullForPropsNotInData - - boolean if this is true, properties for which no value is present in data, are included in the output with value null. If value of this parameter is false, null valued properties are omitted entirely from the outputIValue representing the output of operation.{@link - DermisException}DermisExceptionpublic static IValue generateValue(IProperty property, Object data, boolean autoCoerce, boolean generateNullForPropsNotInData, boolean removeComputedAttributes) throws DermisException
Property and based on result (Java Object) of operation execution.
if autoCoerce is false if any type/value is mismatched then DermisExceptionCodes.PROPERTY_TYPE_MISS_MATCH exception is thrown and if its true it will try to convert the value according to property typeproperty - - Property according to which value object is constructed.data - - Result of operation execution.autoCoerce - - boolean value represent to auto coerce the value according to typegenerateNullForPropsNotInData - - boolean if this is true, properties for which no value is present in data, are included in the output with value null. If value of this parameter is false, null valued properties are omitted entirely from the outputremoveComputedAttributes - - boolean if this is true, computed attributes will be removed from the outputIValue representing the output of operation.{@link - DermisException}DermisExceptionpublic static IValueMap generateValue(IDataModel dataModel, Map<String,Object> data, boolean autoCoerce) throws DermisException
DataModel structured based on result (Java Object) of operation execution.dataModel - - DataModel according to which value object is constructed.data - - Result of operation execution.autoCoerce - - boolean value represent to auto coerce the value according to typeDermisExceptionpublic static IValueMap generateValue(IDataModel dataModel, Map<String,Object> data, boolean autoCoerce, boolean generateNullForPropsNotInData) throws DermisException
DataModel structured based on result (Java Object) of operation execution.dataModel - - DataModel according to which value object is constructed.data - - Result of operation execution.autoCoerce - - boolean value represent to auto coerce the value according to typegenerateNullForPropsNotInData - - boolean if this is true, child properties for which no value is present in data, are included in the output with value null. If value of this parameter is false, null valued properties are omitted entirely from the outputDermisExceptionpublic static IValueMap generateValue(IDataModel dataModel, Map<String,Object> data, boolean autoCoerce, boolean generateNullForPropsNotInData, boolean removeComputedAttributes) throws DermisException
DataModel structured based on result (Java Object) of operation execution.dataModel - - DataModel according to which value object is constructed.data - - Result of operation execution.autoCoerce - - boolean value represent to auto coerce the value according to typegenerateNullForPropsNotInData - - boolean if this is true, child properties for which no value is present in data, are included in the output with value null. If value of this parameter is false, null valued properties are omitted entirely from the outputremoveComputedAttributes - - boolean if this is true, computed attributes will be removed from the outputDermisExceptionpublic static org.apache.commons.beanutils.ConvertUtilsBean getConversionUtil()
public static IValue jsonToValue(String jsonString, IProperty property) throws DermisException, org.apache.sling.commons.json.JSONException
jsonString - - input json string.IValue representing the output of operation.{@link - JSONException}DermisExceptionorg.apache.sling.commons.json.JSONExceptionpublic static IValue jsonToValue(Object data) throws DermisException, org.apache.sling.commons.json.JSONException
data - - data representing JSONArray or JSONObjectIValue representing the output of operation.{@link - JSONException}DermisExceptionorg.apache.sling.commons.json.JSONExceptionpublic static IValueMap jsonObjectToValue(org.apache.sling.commons.json.JSONObject data) throws DermisException, org.apache.sling.commons.json.JSONException
JSONObject.data - - data representing JSONObjectIValue representing the output of operation.{@link - JSONException}DermisExceptionorg.apache.sling.commons.json.JSONExceptionpublic static IValueList jsonListToValue(org.apache.sling.commons.json.JSONArray array) throws DermisException, org.apache.sling.commons.json.JSONException
JSONArray.array - - data representing JSONArrayIValue representing the output of operation.{@link - JSONException}DermisExceptionorg.apache.sling.commons.json.JSONExceptionpublic static Object getFormattedValue(Object value)
value - - input value to format.Copyright © 1982–2022 Adobe Systems Inc.. All rights reserved.