java/nekurak.net-lib/src/cz/frantovo/nekurak/xml/ClanekXML.java
author František Kučera <franta-hg@frantovo.cz>
Tue Mar 23 01:12:16 2010 +0100 (2010-03-23)
changeset 77 5378f8dc8fa9
child 78 77d86ffbf55b
permissions -rw-r--r--
ClanekREST.java
     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
    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     @XmlAttribute(name = "id", required = true)
    30     public void setId(int id) {
    31 	clanek.setId(id);
    32     }
    33 
    34     @XmlElement
    35     public String getNadpis() {
    36 	return clanek.getNadpis();
    37     }
    38 
    39     @XmlElement
    40     public void setNadpis(String nadpis) {
    41 	clanek.setNadpis(nadpis);
    42     }
    43 
    44     @XmlElement
    45     public String getText() {
    46 	return clanek.getText();
    47     }
    48 
    49     @XmlElement
    50     public void setText(String text) {
    51 	clanek.setText(text);
    52     }
    53 }