JavaFX: Bringing Rich Experiences To All the Screens Of Your Life

expand all

Profile: desktop, common

Overview

Fetches data from a file on the local filesystem.

Variable Summary

accessnametypeCan ReadCan InitCan WriteDefault Valuedescription
publicparserStreamParser

Defines file data format.

Defines file data format. The default is JSON.

 
publicpathString

Absolute path of the file.

publictypePathType

Inherited Variables

org.netbeans.javafx.datasrc.DataSource

accessnametypeCan ReadCan InitCan WriteDefault Valuedescription
publicautoRefreshBoolean

Set autoRefresh to false if you want getRecordSet() calls to block, ie.

Set autoRefresh to false if you want getRecordSet() calls to block, ie. if you need data immediately. Set to true to let the DataSource automatically fetch data in the background on application startup and with every change to any datasource property.

 
public-read protectedfetchErrorExceptionsubclasssubclass

Contains an Exception after an unsuccessful data fetch, null otherwise.

public-read protectedfetchingDataBooleansubclasssubclass

An indicator set to true whenever the DataSource is in the process of fetching data.

Function Summary

public fetchData() : Void
 
public metaData() : RecordSetMetadata
Returns
RecordSetMetadata
 

Inherited Functions

org.netbeans.javafx.datasrc.DataSource

protected autorefresh() : Void

Derived class call this when their specific properties change.

Derived class call this when their specific properties change. This class insures that refresh() is called when autoRefresh property is set to true.

 
protected dataFetched(newData: RecordSet) : RecordSet

Callback function that data source classes call when they successfuly fetch data in response to fetchData() call.

Callback function that data source classes call when they successfuly fetch data in response to fetchData() call.

Parameters
newData
a RecordSet containing fetched data
Returns
RecordSet
 
protected dataFetchError(exception: java.lang.Exception) : RecordSet

Callback function that data source classes call when they fail to fetch data in response to fetchData() call.

Callback function that data source classes call when they fail to fetch data in response to fetchData() call.

Parameters
exception
an exception that defined the failure
Returns
RecordSet
 
protected abstract fetchData() : Void

A derived class overrides this to fetch data.

A derived class overrides this to fetch data. When it succeeds, it calls the dataFetched() callback function. When it fails, it calls the dataFetchError callback. Derived classes are free to fetch data asynchronously.

 
public bound getDataSource(expression: java.lang.String) : DataSource

Filters data from this datasource according to the given expression.

Filters data from this datasource according to the given expression.

Parameters
expression
filter expression. Currently, only a simple "field" expressions are supported. For example, from https://netbeans.org/api/projects.json you can get "projects", "href" and other first-level child data sources.
Returns
DataSource
a DataSource that holds a subset of data of this datasource, filtered by the given expression
 
public bound getRecordSet() : RecordSet

Retrieves data from this datasource.

Retrieves data from this datasource. The exact format of data depends on the concrete DataSource implementation.

Returns
RecordSet
a RecordSet object holding data or null if data is still fetching or if an error occured while fetching data
 
public abstract metaData() : RecordSetMetadata
Returns
RecordSetMetadata
metadata about produced data or null if data has not yet been fetched
 
public refresh() : Void

Forces this data source to re-fetch all data.

Forces this data source to re-fetch all data.