Sie sind auf Seite 1von 7

BEAN GENERATOR

Bean Generator

 Es una herramienta que mediante la


ontología permite la generación del código
fuente de forma automática en el que se
encontraran las diferentes clases.
 Permite generar archivos Java representa una
ontología que se pueden utilizar en el kit de
herramientas de JADE.
Ejecución

• Paso 1.
Instalar el plugin BeanGenerator, que permitirá
generar las clases de representadas en la
ontología, para esto se lo agrega en la carpeta
plugins.
• Paso 2
Luego de iniciar protege abrimos la ontologia y
activamos Bean Generator, desde el menu Project,
Configure y Activamos OntologyBeanGenerator Tab
• Paso 3
Desde la pestaña Ontology Bean Generator elegimos el
nombre del paquete en que se va a englobar la ontología, luego
el directorio donde queremos que nos genere el código y por
ultimo el nombre de la ontología.
• Paso 4
Al pulsar el botón Generate Beans el plugin nos creará
todos los ficheros de las clases que componen la
ontología.
• package ontologia_carros.ontology; pcs.firePropertyChange("tieneColor", oldList, this.tieneColor);
import java.io.Serializable; return result;
import java.beans.PropertyChangeSupport; }
import java.beans.PropertyChangeListener; public void clearAllTieneColor() {
List oldList = this.tieneColor;
import jade.content.*; tieneColor.clear();
import jade.util.leap.*; pcs.firePropertyChange("tieneColor", oldList, this.tieneColor);
import jade.core.*; }
public Iterator getAllTieneColor() {return tieneColor.iterator(); }
/** public List getTieneColor() {return tieneColor; }
* Protege name: Carros public void setTieneColor(List l) {tieneColor = l; }
* @author ontology bean generator
* @version 2011/05/12, 08:12:56 /**
*/ * Protege name: TienePrecio
public class Carros implements Concept, Serializable { */
// bean stuff private List tienePrecio = new ArrayList();
protected PropertyChangeSupport pcs = new PropertyChangeSupport(this); public void addTienePrecio(Precio elem) {
public void addPropertyChangeListener(PropertyChangeListener pcl) { List oldList = this.tienePrecio;
pcs.addPropertyChangeListener(pcl); } tienePrecio.add(elem);
public void removePropertyChangeListener(PropertyChangeListener pcl) { pcs.firePropertyChange("tienePrecio", oldList, this.tienePrecio);
pcs.removePropertyChangeListener(pcl); } }
public boolean removeTienePrecio(Precio elem) {
/** List oldList = this.tienePrecio;
* Protege name: TieneColor boolean result = tienePrecio.remove(elem);
*/ pcs.firePropertyChange("tienePrecio", oldList, this.tienePrecio);
private List tieneColor = new ArrayList(); return result;
public void addTieneColor(Color elem) { }
List oldList = this.tieneColor; public void clearAllTienePrecio() {
tieneColor.add(elem); List oldList = this.tienePrecio;
pcs.firePropertyChange("tieneColor", oldList, this.tieneColor); tienePrecio.clear();
} pcs.firePropertyChange("tienePrecio", oldList, this.tienePrecio);
public boolean removeTieneColor(Color elem) { }
List oldList = this.tieneColor; }
boolean result = tieneColor.remove(elem);

Das könnte Ihnen auch gefallen