Newer
Older
* <b>Description : used for demonstration to the config package.
* see main to understand how to used the AbstactDataBinding. </b>
* <br>The aim of the project is to create a set of tools for amateur satellite purpose. All this tools could be used together to create specific software.
* <b>JOSAST</b> project is managed by AVMDTI (<A HREF="http://www.avmdti.org">http://www.avmdti.org </a> )
* <br> This software is an open source software. Please read the <b><i>JOSAST licence</b></i><BR>(<A HREF="http://www.avmdti.org">http://www.avmdti.org </a> )
* <p>for more information contact <a href="mailto:josast@avmdti.org">josast@avmdti.org</a></p>
* @author <a href="mailto:mercier.josast@avmdti.org">mercier</a>
* @version 1.0
* <p><b><i> Source Update </b></i></p>
* <br> V1 : 3 mars 2004 : C. Mercier : create file
* <p>
*/
package org.josast.config.databinding;
import java.io.File;
import java.util.Vector;
/**
*
* <b>Description : </b>
* <p>Projet : JOSAST <br>
*
* <b>JOSAST</b> : Java Open Source Amateur Satellite Toolbox
* <br>The aim of the project is to create a set of tools for amateur satellite purpose. All this tools could be used together to create specific software.
* <b>JOSAST</b> project is managed by AVMDTI (<A HREF="http://www.avmdti.org">http://www.avmdti.org </a> )
* <br> This software is an open source software. Please read the <b><i>JOSAST licence</b></i><BR>(<A HREF="http://www.avmdti.org">http://www.avmdti.org </a> )
* <p>for more information contact <a href="mailto:josast@avmdti.org">josast@avmdti.org</a></p>
* @author <a href="mailto:mercier.josast@avmdti.org">mercier</a>
* @version 1.0
* <p><b><i> Source Update </b></i></p>
* <br> V1 : 3 mars 2004 : C. Mercier : create file
* <br> V2 : 01 mai 2019 : C. Mercier : Change log system
* <p>
*/
public class ConfigurationdataBindingDemo extends AbstractDataBinding {
private static final long serialVersionUID = -9045143058463814039L;
private double version = 1.0;
private String name = null;
private Vector<String> V = new Vector<String>();
private String directory = new String("C:\\temp");
* If the configuration file exist, the function return an object from the configuration file
* else the function return a default object.
* @return an instance of the class.
*/
// create a default object
ConfigurationdataBindingDemo t = new ConfigurationdataBindingDemo();
// test if the file exist
// TODO : A REVOIR
File f = new File(t.getDirectory());
// load the object
t = (ConfigurationdataBindingDemo) t.load();
}
* display Vector data and also name of the class and version. <br>
* @see java.lang.Object#toString()
*/
public String toString() {
return this.V.toString() + name + version;
}
/**
* @return field name.
*/
public String getName() {
return name;
}
/**
* @return field vector
*/
public Vector<String> getV() {
return V;
}
/**
* @return field version
*/
public double getVersion() {
return version;
}
/**
* set field name.
this.directory = directory;
}
public String getDirectory() {
return directory;
}
/**
* D�monstration :
* - cr�ation d'un objet
* - modification des param�tres de l'objet
* - sauvegarde
* - lecture
Vector<String> v = new Vector<String>();
v.add("�lement 1");
v.add("�l�ment 2");
v.add("�l�ment 3");
ConfigurationdataBindingDemo t = getInstance();
t.setName("d�monstration du fichier");
t.setVersion(1.3);
t.setV(v);
t = new ConfigurationdataBindingDemo();
System.out.println("a la cr�ation" + t);
t = (ConfigurationdataBindingDemo) t.load();
System.out.println("apr�s sauvegarde" + t);