Examples of DataReader


Examples of com.bergerkiller.bukkit.common.config.DataReader

   * @param filename - The groupdata file to read from
   */
  public static void init(String filename) {
    synchronized (managers) {
      deinit();
      new DataReader(filename) {
        public void read(DataInputStream stream) throws IOException {
          int totalgroups = 0;
          int totalmembers = 0;
          final int worldcount = stream.readInt();
          for (int worldIdx = 0; worldIdx < worldcount; worldIdx++) {
View Full Code Here

Examples of com.bergerkiller.bukkit.common.config.DataReader

    }
  }
  public static void init(String filename) {
    regionsById.clear();
    regions.clear();
    new DataReader(filename) {
      public void read(DataInputStream stream) throws IOException {
        int count = stream.readInt();
        int coordcount;
        for (;count > 0; --count) {
          //get required info
View Full Code Here

Examples of com.bergerkiller.bukkit.common.config.DataReader

    }
  }

  public static void init(String filename) {
    spawnSigns.clear();
    new DataReader(filename) {
      public void read(DataInputStream stream) throws IOException {
        int count = stream.readInt();
        for (;count > 0; --count) {
          SpawnSign sign = SpawnSign.read(stream);
          spawnSigns.put(sign.getWorldName(), sign.getLocation(), sign);
View Full Code Here

Examples of com.bergerkiller.bukkit.common.config.DataReader

    return event != null && event.getMode() != SignActionMode.NONE && event.isType("detector");
  }

  public static void init(String filename) {
    detectors.clear();
    new DataReader(filename) {
      public void read(DataInputStream stream) throws IOException {
        for (int count = stream.readInt(); count > 0; --count) {
          //get required info
          UUID id = StreamUtil.readUUID(stream);
          //init a new detector
View Full Code Here

Examples of com.inspiresoftware.lib.dto.geda.assembler.extension.DataReader

        final PropertyDescriptor dtoFieldDesc = PropertyInspector.getDtoPropertyDescriptorForField(
                dtoClass, meta.getDtoFieldName(), dtoPropertyDescriptors);

        final MethodSynthesizer synthesizer = context.getMethodSynthesizer();

        final DataReader dtoFieldRead = meta.isReadOnly() ? null : synthesizer.synthesizeReader(dtoFieldDesc);
        final DataWriter dtoFieldWrite = synthesizer.synthesizeWriter(dtoFieldDesc);

        final boolean isMapEntity = Map.class.isAssignableFrom(entityClass);
        final boolean isListEntity = !isMapEntity && List.class.isAssignableFrom(entityClass);

        final MethodSynthesizer entitySynthesizer;
        final PropertyDescriptor entityFieldDesc;

        if (isMapEntity || isListEntity) {
            if (isMapEntity) {
                entitySynthesizer = mapSynthesizer;
            } else {
                entitySynthesizer = listSynthesizer;
            }
            entityFieldDesc = dtoFieldDesc;
        } else {
            entitySynthesizer = synthesizer;
            entityFieldDesc = PropertyInspector.getEntityPropertyDescriptorForField(
            dtoClass, entityClass, meta.getDtoFieldName(), meta.getEntityFieldName(), entityPropertyDescriptors);
        }

    final DataReader entityFieldRead = entitySynthesizer.synthesizeReader(entityFieldDesc);
    final DataWriter entityFieldWrite = meta.isReadOnly() ? null : entitySynthesizer.synthesizeWriter(entityFieldDesc);

        return new CollectionPipe(context,
                dtoFieldRead, dtoFieldWrite,
                entityFieldRead, entityFieldWrite,
View Full Code Here

Examples of com.salesforce.dataloader.dao.DataReader

        // assert that it's a CSV...if not fail
        final Set<String> unexpectedIds = new HashSet<String>();
        final Set<String> expectedIds = new HashSet<String>(Arrays.asList(ids));
        String fileName = control.getConfig().getString(Config.OUTPUT_SUCCESS);
        final DataReader resultReader = new CSVFileReader(fileName, getController());
        try {
            resultReader.open();

            // go through item by item and assert that it's there
            Row row;
            while ((row = resultReader.readRow()) != null) {
                final String resultId = (String)row.get(Config.ID_COLUMN_NAME);
                assertValidId(resultId);
                if (!expectedIds.remove(resultId)) {
                    unexpectedIds.add(resultId);
                }
            }
        } finally {
            resultReader.close();
        }

        if (!expectedIds.isEmpty()) {
            Assert.fail("These ids were not found in the result file: " + expectedIds);
        }
View Full Code Here

Examples of com.salesforce.dataloader.dao.DataReader

                        ok.setEnabled(true);
                        label.setText(Labels.getString("DataSelectionDialog.errorRead")); //$NON-NLS-1$
                        shell.setText(Labels.getString("DataSelectionDialog.titleError"));
                        return;
                    }
                    DataReader dataReader = (DataReader)controller.getDao();

                    List header = null;
                    int totalRows = 0;
                    try {
                        dataReader.checkConnection();
                        dataReader.open();

                        String warning = DAORowUtil.validateColumns(dataReader);
                        if(warning != null && warning.length() != 0) {
                            int response = UIUtils.warningConfMessageBox(shell, warning + "\n" + Labels.getString("DataSelectionDialog.warningConf"));
                            // in case user doesn't want to continue, treat this as an error
                            if(response != SWT.YES) {
                                success = false;
                                ok.setEnabled(true);
                                label.setText(Labels.getString("DataSelectionDialog.errorCSVFormat")); //$NON-NLS-1$
                                shell.setText(Labels.getString("DataSelectionDialog.titleError"));
                                return;
                            }
                        }

                        totalRows = dataReader.getTotalRows();

                        if ((header = dataReader.getColumnNames())== null || header.size() == 0) {
                            success = false;
                            ok.setEnabled(true);
                            label.setText(Labels.getString("DataSelectionDialog.errorCSVFormat")); //$NON-NLS-1$
                            shell.setText(Labels.getString("DataSelectionDialog.titleError"));
                            return;
                        }

                    } catch (DataAccessObjectException e) {
                        success = false;
                        ok.setEnabled(true);
                        label.setText(Labels.getString("DataSelectionDialog.errorCSVFormat") + "  " + e.getMessage()); //$NON-NLS-1$
                        Point size = label.computeSize(SWT.DEFAULT, SWT.DEFAULT);
                        label.setSize(shell.getClientArea().width, size.y);
                        shell.setText(Labels.getString("DataSelectionDialog.titleError"));
                        shell.pack();
                        shell.redraw();
                        return;
                    } finally {
                        dataReader.close();
                    }
                    success = true;
                    ok.setEnabled(true);
                    label.setText(Labels.getFormattedString(
                            "DataSelectionDialog.initSuccess", String.valueOf(totalRows))); //$NON-NLS-1$
View Full Code Here

Examples of com.salesforce.dataloader.dao.DataReader

    private void getResults() throws AsyncApiException, OperationException, DataAccessObjectException {

        getProgressMonitor().setSubTask(Messages.getMessage(getClass(), "retrievingResults"));

        final DataReader dataReader = resetDAO();

        // create a map of batch infos by batch id. Each batchinfo has the final processing state of the batch
        final Map<String, BatchInfo> batchInfoMap = createBatchInfoMap();

        // go through all the batches we sent to sfdc in the same order and process the batch results for
View Full Code Here

Examples of com.salesforce.dataloader.dao.DataReader

        }
        return batchInfoMap;
    }

    private DataReader resetDAO() throws DataAccessObjectInitializationException, LoadException {
        final DataReader dataReader = (DataReader)getController().getDao();
        dataReader.close();
        // TODO: doing this causes sql to be executed twice, for sql we should cache results in a local file
        dataReader.open();
        // when re-opening the dao we need to start at the same row in the input
        DAORowUtil.get().skipRowToStartOffset(getConfig(), dataReader, getProgressMonitor(), true);
        return dataReader;
    }
View Full Code Here

Examples of com.tagtraum.perf.gcviewer.imp.DataReader

public class ImportPerformanceTest {
    public static void main(String[] args) throws IOException, InterruptedException {
        IntData performanceData = new IntData();
        for (int i=0; i<10; i++) {
            long start = System.currentTimeMillis();
            DataReader dataReader = new DataReaderFactory().getDataReader(new FileInputStream(args[0]));
            dataReader.read();
            performanceData.add((int)(System.currentTimeMillis() - start));
        }
       
        printIntData(args[0], performanceData);
    }
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.