<commit_before>package org.javarosa.formmanager.utility;

import java.io.IOException;
import java.io.OutputStream;

import javax.microedition.io.Connector;
import javax.microedition.io.file.FileConnection;

import org.javarosa.core.model.FormDef;
import org.javarosa.core.services.storage.utilities.Serializer;

/**
 * @author Kieran
 *
 *	Yo dudes. This class is for writing the serialized representation of a
 *	FormDef to file. It works in a seperate thread to prevent it hanging, so
 *  you'll first have to set the attributes (.setForm and .setFname) before calling start() on the thread.
 *
 *  e.g.
 *  FormDefSerializer fds = new FormDefSerializer();
 *  fds.setForm(aFormDefObj);
	fds.setFname("Name.txt");
 *  new Thread(FormDefSerializer).start();
 */
public class FormDefSerializer implements Runnable{

	private FormDef form;
	private String fname;<commit_msg>[r1125] [branches/dev] Added comment relating to the need to separate out FileConnection API dependent code<commit_after>package org.javarosa.formmanager.utility;

import java.io.IOException;
import java.io.OutputStream;

import javax.microedition.io.Connector;
import javax.microedition.io.file.FileConnection;

import org.javarosa.core.model.FormDef;
import org.javarosa.core.services.storage.utilities.Serializer;

/**
 * @author Kieran
 *
 *	Yo dudes. This class is for writing the serialized representation of a
 *	FormDef to file. It works in a seperate thread to prevent it hanging, so
 *  you'll first have to set the attributes (.setForm and .setFname) before calling start() on the thread.
 *
 *  e.g.
 *  FormDefSerializer fds = new FormDefSerializer();
 *  fds.setForm(aFormDefObj);
	fds.setFname("Name.txt");
 *  new Thread(FormDefSerializer).start();
 */

// <NAME> - Sep 4, 2008 : This class should be separated out in such a way that FormManager isn't dependent
// on the FileConnection API. Even surrounding the appropriate code sections with preprocessor directives would be
// fine.
public class FormDefSerializer implements Runnable{

	private FormDef form;
	private String fname;
{'fraction_non_alphanumeric': 0.09310178485287024, 'fraction_numerical': 0.004341534008683068, 'mean_word_length': 4.651226158038147, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4048688', 'n_tokens_mistral': 637, 'n_tokens_neox': 610, 'n_words': 203}