Package com.nexirius.framework.datamodel

Examples of com.nexirius.framework.datamodel.DataModel.dropData()


    public DataModel read(Class cl, String id) {
        try {
            XFile dir = getDirectory(cl);
            XFile file = new XFile(dir.getPath(), id);
            DataModel ret = (DataModel) cl.newInstance();
            ret.dropData(new String(file.getBytes()));
            ret.setInstanceName(id);
            return ret;
        } catch (Exception ex) {
            ex.printStackTrace();
        }
View Full Code Here


            XFile dir = getDirectory(cl);
            StringVector files = dir.getFiles(false); // get the list of all the files in this directory
            for (String id = files.firstItem(); id != null; id = files.nextItem()) {
                DataModel model = (DataModel) cl.newInstance(); //create a new instance of the given type
                XFile file = new XFile(dir.getPath(), id);
                model.dropData(new String(file.getBytes()));
                model.setInstanceName(id);
                if (propertyValue == null || propertyValue.equals(model.getChildText(propertyName))) {
                    ret.addElement(model);
                }
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.