java/nekurak.net-lib/src/cz/frantovo/nekurak/xml/ClanekXML.java
author František Kučera <franta-hg@frantovo.cz>
Tue Mar 23 15:09:19 2010 +0100 (2010-03-23)
changeset 83 6767606d6342
parent 75 18ed62105526
child 92 12268fc31114
permissions -rw-r--r--
Kaptcha & E-mail
     1 package cz.frantovo.nekurak.xml;
     2 
     3 import cz.frantovo.nekurak.dto.Clanek;
     4 import javax.xml.bind.annotation.XmlAttribute;
     5 import javax.xml.bind.annotation.XmlElement;
     6 import javax.xml.bind.annotation.XmlRootElement;
     7 
     8 /**
     9  * Převaděč do XML
    10  * @author fiki
    11  */
    12 @XmlRootElement(name="clanek")
    13 public class ClanekXML {
    14 
    15     private Clanek clanek;
    16 
    17     public ClanekXML() {
    18     }
    19 
    20     public ClanekXML(Clanek clanek) {
    21 	this.clanek = clanek;
    22     }
    23 
    24     @XmlAttribute(name = "id", required = true)
    25     public int getId() {
    26 	return clanek.getId();
    27     }
    28 
    29     public void setId(int id) {
    30 	clanek.setId(id);
    31     }
    32 
    33     @XmlElement
    34     public String getNadpis() {
    35 	return clanek.getNadpis();
    36     }
    37 
    38     public void setNadpis(String nadpis) {
    39 	clanek.setNadpis(nadpis);
    40     }
    41 
    42     @XmlElement
    43     public String getText() {
    44 	return clanek.getText();
    45     }
    46 
    47     public void setText(String text) {
    48 	clanek.setText(text);
    49     }
    50 }