code: private DataModel createDataModel()
      {
          Object value = getValue();
  
          if (value == null)
          {
              return EMPTY_DATA_MODEL;
          }
          else if (value instanceof DataModel)
          {
              return (DataModel) value;
          }
          else if (value instanceof List)
          {
              return new ListDataModel((List<?>) value);
          }
          else if (OBJECT_ARRAY_CLASS.isAssignableFrom(value.getClass()))
          {
              return new ArrayDataModel((Object[]) value);
          }
          else if (value instanceof ResultSet)
          {
              return new ResultSetDataModel((ResultSet) value);
          }
          else if (value instanceof Result)
          {
              return new ResultDataModel((Result) value);
          }
          else if (value instanceof Collection)
          {
              return new CollectionDataModel((Collection) value);
          }
          else
          {
              return new ScalarDataModel(value);
          }
      }
docs: Evaluate this object's value property and convert the result into a DataModel. Normally this object's value
  property will be a value-binding which will cause the value to be fetched from some backing bean.
  <p>
  The result of fetching the value may be a DataModel object, in which case that object is returned directly. If
  the value is of type List, Array, ResultSet, Result, other object or null then an appropriate wrapper is created
  and returned.
  <p>
  Null is never returned by this method.