1 package org.splat.dal.bo.som;
4 * @author Daniel Brunier-Coulin
5 * @copyright OPEN CASCADE 2012
8 import org.splat.dal.bo.kernel.Persistent;
9 import org.splat.dal.bo.kernel.Relation;
12 public class ConvertsRelation extends Relation {
18 private boolean got; // For optimizing getDescription()
19 private String description; // Null if this is not described
21 // ==============================================================================================================================
23 // ==============================================================================================================================
25 // Database fetch constructor
26 protected ConvertsRelation () {
27 // -----------------------------
31 // Initialization constructors
32 protected ConvertsRelation (Document from, File to) {
33 // ---------------------------------------------------
37 this.description = null; // Conversion not described
39 protected ConvertsRelation (Document from, File to, String description) {
40 // -----------------------------------------------------------------------
44 this.description = description; // May be null
45 if (description != null) this.setAttribute( new DescriptionAttribute(this, description) );
48 // ==============================================================================================================================
49 // Public member functions
50 // ==============================================================================================================================
52 public String getDescription () {
53 // -------------------------------
55 DescriptionAttribute field = (DescriptionAttribute)this.getAttribute(DescriptionAttribute.class);
56 if (field != null) description = field.getValue();
57 got = true; // Don't need to be modified later as set and remove attribute functions are private to this class
59 return description; // May be null
62 public File getTo () {
63 // --------------------
66 protected void setTo (Persistent to) {
67 // ------------------------------------