com.smartgwt.client.data

## Class MockDataSource

- java.lang.Object
- - com.smartgwt.client.core.BaseClass
  - - com.smartgwt.client.data.DataSource
    - - com.smartgwt.client.data.MockDataSource

- All Implemented Interfaces:
    com.google.gwt.event.shared.HasHandlers, HasHandleErrorHandlers

      public class MockDataSource
      extends DataSource

  A special kind of `client-only DataSource` that can be configured with `"mock data"` - a simple text format for table or tree data.

  MockDataSources are produces by the Reify Mockup Importer when starting from mockup formats that use the mock data format. The docs for the `Reify Mockup Importer` explain various steps for converting a `MockupDataSource` to a real DataSource.

  `MockupDataSource` is primarily intended as a temporary form of DataSource used during the process of converting a mockup into a real application. Generally, if creating a client-only DataSource in Java, there is no reason to use the mock data format, as the mock data is not especially readable when written as a String literal. The mock data format can be a slightly more compact and readable as compared to declaring `testData` in XML.

- - ### Field Summary

    - ### Fields inherited from class com.smartgwt.client.core.BaseClass

      `config, factoryCreated, factoryProperties, id, scClassName`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MockDataSource()`
    `MockDataSource(com.google.gwt.core.client.JavaScriptObject jsObj)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `com.google.gwt.core.client.JavaScriptObject` | `create()`
    `java.lang.String` | `getMockData()` Data intended for a `ListGrid` or `TreeGrid`, expressed in a simple text format popularized by mockup tools such as http://balsamiq.com and now commonly supported in a variety of mockup tools.
    `MockDataType` | `getMockDataType()` Whether `mockData` is in the "grid" or "tree" format.
    `static MockDataSource` | `getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)`
    `void` | `setMockData(java.lang.String mockData)` Data intended for a `ListGrid` or `TreeGrid`, expressed in a simple text format popularized by mockup tools such as http://balsamiq.com and now commonly supported in a variety of mockup tools.
    `void` | `setMockDataType(MockDataType mockDataType)` Whether `mockData` is in the "grid" or "tree" format.

    - ### Methods inherited from class com.smartgwt.client.data.DataSource

      `addData, addData, addData, addField, addHandleErrorHandler, applyFilter, applyFilter, canFlattenCriteria, cloneDSRequest, cloneDSResponse, combineCriteria, combineCriteria, combineCriteria, compareCriteria, compareCriteria, compareCriteria, compareDates, convertCriteria, convertCriteria, convertDataSourceCriteria, convertDataSourceCriteria, convertRelativeDates, convertRelativeDates, convertRelativeDates, convertRelativeDates, copyCriteria, copyRecord, copyRecords, downloadFile, downloadFile, downloadFile, evaluateCriterion, execute, exportClientData, exportClientDataStatic, exportData, exportData, exportData, exportData, fetchData, fetchData, fetchData, fetchData, fetchRecord, fetchRecord, fetchRecord, fieldMatchesFilter, fieldMatchesFilter, filterData, filterData, filterData, filterData, flattenCriteria, get, get, getAddGlobalId, getAdvancedCriteriaDescription, getAllowAdvancedCriteria, getAutoCacheAllData, getAutoConvertRelativeDates, getAutoDeriveTitles, getAutoTitle, getCacheAcrossOperationIds, getCacheAllData, getCacheAllOperationId, getCacheData, getCacheMaxAge, getCallbackParam, getCanMultiSort, getChildrenField, getClientOnly, getClientOnlyDataSource, getClientOnlyDataSource, getClientOnlyDataSource, getClientOnlyResponse, getCriteriaPolicy, getDataField, getDataFormat, getDataProtocol, getDataSource, getDataSource, getDataTransport, getDataURL, getDefaultParams, getDefaultTextMatchStyle, getDescriptionField, getDisplayValue, getDropExtraFields, getDropUnknownCriteria, getFetchDataURL, getFetchDataURL, getField, getFieldAutoTitle, getFieldCriterion, getFieldForDataPath, getFieldNames, getFieldNames, getFieldOperators, getFieldOperators, getFields, getFieldValue, getFieldValue, getFieldValue, getFieldValue, getFile, getFileURL, getFileURL, getFileURL, getGlobalNamespaces, getIconField, getIgnoreTextMatchStyleCaseSensitive, getInfoField, getInheritsFrom, getJsObj, getJsonPrefix, getJsonSuffix, getLegalChildTags, getLoaderURL, getOperationBindings, getPatternEscapeChar, getPatternMultiWildcard, getPatternMultiWildcardAsString, getPatternSingleWildcard, getPatternSingleWildcardAsString, getPluralTitle, getPreventHTTPCaching, getPrimaryKeyField, getPrimaryKeyFieldName, getPrimaryKeyFieldNames, getPrimaryKeyFields, getProgressiveLoading, getQualifyColumnNames, getRecordName, getRecordXPath, getRequestProperties, getRequiredMessage, getResultBatchSize, getResultSetClass, getResultTreeClass, getSchemaNamespace, getSendExtraFields, getSendParentNode, getServiceNamespace, getShowLocalFieldsOnly, getShowPrompt, getSortBy, getSortSpecifiers, getStrictSQLFiltering, getTagName, getTestData, getTitle, getTitleField, getTranslatePatternOperators, getTrimMilliseconds, getTypeOperators, getTypeOperators, getTypeOperators, getUseFlatFields, getUseHttpProxy, getUseLocalValidators, getUseOfflineStorage, getUseParentFieldOrder, getUseStrictJSON, getUseTestDataFetch, getValidateRelatedRecords, hasAllData, hasFile, invalidateCache, isCreated, isFlatCriteria, listFiles, load, load, load, loadWithParents, loadWithParents, loadWithParents, makeFileSpec, onInit, performCustomOperation, performCustomOperation, performCustomOperation, performCustomOperation, processResponse, recordsAreEqual, recordsAsText, recordsAsText, recordsFromText, recordsFromText, recordsFromXML, registerID, removeData, removeData, removeData, removeFile, removeFile, removeFile, renameFile, renameFile, saveFile, saveFile, setAddGlobalId, setAllowAdvancedCriteria, setAutoCacheAllData, setAutoConvertRelativeDates, setAutoDeriveTitles, setCacheAcrossOperationIds, setCacheAllData, setCacheAllOperationId, setCacheData, setCacheMaxAge, setCallbackParam, setCanMultiSort, setChildrenField, setClientOnly, setCriteriaPolicy, setDataField, setDataFormat, setDataProtocol, setDataTransport, setDataURL, setDefaultParams, setDefaultTextMatchStyle, setDescriptionField, setDropExtraFields, setDropUnknownCriteria, setEnumConstantProperty, setEnumOrdinalProperty, setEnumTranslateStrategy, setFields, setGlobalNamespaces, setHandleErrorCallback, setIconField, setID, setIgnoreTextMatchStyleCaseSensitive, setInfoField, setInheritsFrom, setInheritsFrom, setJsonPrefix, setJsonSuffix, setLoaderURL, setOperationBindings, setPatternEscapeChar, setPatternMultiWildcard, setPatternMultiWildcard, setPatternSingleWildcard, setPatternSingleWildcard, setPluralTitle, setPreventHTTPCaching, setProgressiveLoading, setQualifyColumnNames, setRecordName, setRecordXPath, setRequestProperties, setRequiredMessage, setResultBatchSize, setResultSetClass, setResultTreeClass, setSendExtraFields, setSendParentNode, setServiceNamespace, setShowLocalFieldsOnly, setShowPrompt, setStrictSQLFiltering, setTagName, setTestData, setTitle, setTitleField, setTranslatePatternOperators, setTrimMilliseconds, setTypeOperators, setTypeOperators, setUseFlatFields, setUseHttpProxy, setUseLocalValidators, setUseOfflineStorage, setUseParentFieldOrder, setUseStrictJSON, setUseTestDataFetch, setValidateRelatedRecords, setXmlNamespaces, splitCriteria, supportsAdvancedCriteria, supportsTextMatchStyle, transformRequest, transformResponse, updateCaches, updateCaches, updateData, updateData, updateData, useOfflineResponse, validateData, validateData, validateData, viewFile, viewFile, viewFile, xmlSerialize, xmlSerialize, xmlSerialize, xmlSerialize, xmlSerialize`

    - ### Methods inherited from class com.smartgwt.client.core.BaseClass

      `applyFactoryProperties, asSGWTComponent, createJsObj, destroy, doAddHandler, doInit, error, error, errorIfNotCreated, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsString, getAttributeAsStringArray, getClassName, getConfig, getHandlerCount, getID, getOrCreateJsObj, getRef, getScClassName, getTestInstance, hasAutoAssignedID, internalSetID, internalSetID, isFactoryCreated, onBind, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setConfig, setFactoryCreated, setJavaScriptObject, setProperty, setProperty, setProperty, setProperty, setScClassName`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.google.gwt.event.shared.HasHandlers

      `fireEvent`

- - ### Constructor Detail

    - #### MockDataSource

          public MockDataSource()

    - #### MockDataSource

          public MockDataSource(com.google.gwt.core.client.JavaScriptObject jsObj)

  - ### Method Detail

    - #### getOrCreateRef

          public static MockDataSource getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)

    - #### create

          public com.google.gwt.core.client.JavaScriptObject create()

      Overrides:
        `create` in class `DataSource`

    - #### setMockData

          public void setMockData(java.lang.String mockData)
                           throws java.lang.IllegalStateException

      Data intended for a `ListGrid` or `TreeGrid`, expressed in a simple text format popularized by mockup tools such as http://balsamiq.com and now commonly supported in a variety of mockup tools.

      Balsamiq publishes documentation of the grid format here, with a simple example of using tree-specific formatting here.

      Parameters:
        `mockData` - Default value is "md"
      Throws:
        `java.lang.IllegalStateException` - this property cannot be changed after the underlying component has been created

    - #### getMockData

          public java.lang.String getMockData()

      Data intended for a `ListGrid` or `TreeGrid`, expressed in a simple text format popularized by mockup tools such as http://balsamiq.com and now commonly supported in a variety of mockup tools.

      Balsamiq publishes documentation of the grid format here, with a simple example of using tree-specific formatting here.

      Returns:
        String

    - #### setMockDataType

          public void setMockDataType(MockDataType mockDataType)
                               throws java.lang.IllegalStateException

      Whether `mockData` is in the "grid" or "tree" format. See `MockDataType`.
      Parameters:
        `mockDataType` - Default value is "grid"
      Throws:
        `java.lang.IllegalStateException` - this property cannot be changed after the underlying component has been created

    - #### getMockDataType

          public MockDataType getMockDataType()

      Whether `mockData` is in the "grid" or "tree" format. See `MockDataType`.
      Returns:
        MockDataType