You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JFXNodeMapper is a simple library that focuses on mapping data from common data represntation formats to JavaFx Nodes. Our main focus is to build a library that,
Requires minimal configuration.
Easy to understand.
Small Size.
Features
Automatic Node traversal to find children nodes and assign data to them based on their ids.
Accept JSON and ResultSet as data source.
Support custom mappings for nodes that has custom datatypes using event listners
Supports customised datatype conversions.
Upcoming Features
Support for csv and xml.
Reverse mapping, i.e convert Nodes to JSON ,CSV and XML,
How to use JFXNodeMapper in your project
Add JFXNodeMapper to your project
Assign id to nodes same as the Key/Column name
(Optional) Assign custom mapping to node
Pass the root node or parent node that contains the required fields to be mapped.
Pass data source.
See the Magic
Examples
Mapping from a JSON string
Scenescene = parent.getScene();
Noderoot = scene.getRoot();
DataMappermapper = newDataMapper();
mapper.setRoot(root);
Stringjson = getJsonFromServer();
mapper.setDataFromJSON(json); // json keys and node ids should match
Mapping from a ResultSet object
Scenescene = parent.getScene();
Noderoot = scene.getRoot();
DataMappermapper = newDataMapper();
mapper.setRoot(root);
Resulsetresultset = getAllStudentDetails();
mapper.setDataFromResultSet(resultSet); //column name and node ids should match
Mapping from JSON string with custom mapping
Scenescene = parent.getScene();
Noderoot = scene.getRoot();
DataMappermapper = newDataMapper();
mapper.setRoot(root);
Stringjson = getJsonFromServer();
// this listner will be called whenever the specified id is encountered.// this will override all other mappings for the specified idmapper.mapToCustomDataType("subject-combo", (data, id, node) -> {
ComboBox<String> subs = (ComboBox<String>) node;
Stringsubject = (String)data;
subs.getItems.add(subject);
});
mapper.setDataFromJSON(json); // JSON keys and node ids should match
About
Maps ResultSets and other popular data representations to JavaFx Nodes based on thier ids