HtmlCheckboxDarstellungBean.java
001 /*
002  * Created on 27.04.2004
003  */
004 package de.fub.tip.datenanzeige.beans;
005 
006 import java.io.Serializable;
007 
008 import de.fub.tip.datenanzeige.ormapper.SightGruppeVO;
009 import de.fub.tip.datenanzeige.ormapper.TopicVO;
010 
011 
012 /**
013  * Sinn: Zur Anzeige von <code>SightGruppeVO</code>-Objekten wird
014  * diese Klasse benötigt und hilft bei der Darstellung als HTML-Checkbox 
015  * in der View.
016  *  
017  @author hirsch, 27.04.2004
018  @version 2004-04-27
019  * $Id: HtmlCheckboxDarstellungBean.java,v 1.5 2004/06/11 21:52:47 hirsch Exp $
020  */
021 public class HtmlCheckboxDarstellungBean implements Serializable {
022     /** DatenbankID */
023     private Integer databaseid = null;
024     /** Name der Sehenswürdigkeitsgruppe */
025     private String name = null;
026     /** AboStatus zur Anzeige in HTML-Checkboxen */
027     private Boolean abostatus = null;
028 
029     /**
030      * Der Standardkonstruktor macht nichts
031      */
032     public HtmlCheckboxDarstellungBean() {
033     }
034     
035     /**
036      * zum vereinfachten Datenladen stellt dieser Konstruktor direkt
037      * die Möglichkeit zur Verfügung, Werte zu übergeben
038      
039      @param id - DatenbankID des Objekts
040      @param name - Bezeichnung des Objekts zur Anzeige 
041      @param aboStatus - aboStatus aus VOObjekt
042      */
043     public HtmlCheckboxDarstellungBean(Integer id, String name, 
044             Boolean aboStatus) {
045         this.databaseid = id;
046         this.name = name;
047         this.abostatus = aboStatus;
048     }
049     
050     /**
051      * zum vereinfachten Datenladen stellt dieser Konstruktor direkt
052      * die Möglichkeit zur Verfügung, Werte zu übergeben
053      
054      @param sgroup - Sehenswürdigkeitsgruppenobjekt
055      */
056     public HtmlCheckboxDarstellungBean(SightGruppeVO sgroup) {
057         this.databaseid = sgroup.getId();
058         this.name = sgroup.getDescription();
059         this.abostatus = sgroup.getAboStatus();
060     }
061     
062     /**
063      * zum vereinfachten Datenladen stellt dieser Konstruktor direkt
064      * die Möglichkeit zur Verfügung, Werte zu übergeben
065      
066      @param topic - Themengruppenobjekt
067      */
068     public HtmlCheckboxDarstellungBean(TopicVO topic) {
069         this.databaseid = topic.getId();
070         this.name = topic.getName() " -  ("+ topic.getDescription() ") ";
071         this.abostatus = topic.getAboStatus();
072     }
073 
074     /**
075      * gibt die DatenbankID der Gruppe zurück
076      @return Returns the databaseid.
077      */
078     public Integer getDatabaseid() {
079         return this.databaseid;
080     }
081     /**
082      @param databaseid The databaseid to set.
083      */
084     public void setDatabaseid(Integer databaseid) {
085         this.databaseid = databaseid;
086     }
087     
088     /**
089      @return Returns the name.
090      */
091     public String getName() {
092         return this.name;
093     }
094     
095     /**
096      @param name The name to set.
097      */
098     public void setName(String name) {
099         this.name = name;
100     }
101     
102     /**
103      @return Returns the abostatus.
104      */
105     public Boolean getAbostatus() {
106         return this.abostatus;
107     }
108     
109     /**
110      @param abostatus The abostatus to set.
111      */
112     public void setAbostatus(Boolean abostatus) {
113         this.abostatus = abostatus;
114     }
115     
116     /**
117      * nullpointersichere Darstellung der Bohne
118      @return Stringrepräsentation der Bean
119      */
120     public String toString() {
121       String ergebnis = "";
122       if this.name != nullergebnis += this.name;
123       ergebnis += " (";
124       if this.databaseid != null ergebnis += this.databaseid;
125       ergebnis += ") - ";
126       if this.abostatus != null ergebnis += this.abostatus;
127         
128         return ergebnis;
129     // end of toString
130 // end of class