1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/java/nekurak.net-lib/src/cz/frantovo/nekurak/xml/ClanekXML.java Tue Mar 23 01:12:16 2010 +0100
1.3 @@ -0,0 +1,53 @@
1.4 +package cz.frantovo.nekurak.xml;
1.5 +
1.6 +import cz.frantovo.nekurak.dto.Clanek;
1.7 +import javax.xml.bind.annotation.XmlAttribute;
1.8 +import javax.xml.bind.annotation.XmlElement;
1.9 +import javax.xml.bind.annotation.XmlRootElement;
1.10 +
1.11 +/**
1.12 + * Převaděč do XML
1.13 + * @author fiki
1.14 + */
1.15 +@XmlRootElement
1.16 +public class ClanekXML {
1.17 +
1.18 + private Clanek clanek;
1.19 +
1.20 + public ClanekXML() {
1.21 + }
1.22 +
1.23 + public ClanekXML(Clanek clanek) {
1.24 + this.clanek = clanek;
1.25 + }
1.26 +
1.27 + @XmlAttribute(name = "id", required = true)
1.28 + public int getId() {
1.29 + return clanek.getId();
1.30 + }
1.31 +
1.32 + @XmlAttribute(name = "id", required = true)
1.33 + public void setId(int id) {
1.34 + clanek.setId(id);
1.35 + }
1.36 +
1.37 + @XmlElement
1.38 + public String getNadpis() {
1.39 + return clanek.getNadpis();
1.40 + }
1.41 +
1.42 + @XmlElement
1.43 + public void setNadpis(String nadpis) {
1.44 + clanek.setNadpis(nadpis);
1.45 + }
1.46 +
1.47 + @XmlElement
1.48 + public String getText() {
1.49 + return clanek.getText();
1.50 + }
1.51 +
1.52 + @XmlElement
1.53 + public void setText(String text) {
1.54 + clanek.setText(text);
1.55 + }
1.56 +}