package br.com.pub.sitemap;

import java.text.SimpleDateFormat;
import java.util.Date;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlAccessorType(value = XmlAccessType.NONE)
@XmlRootElement(name = "url", namespace = "http://www.sitemaps.org/schemas/sitemap/0.9")
public class XmlUrl {
    
	public enum Priority {
        HIGH("1.0"),
        MEDIUM("0.5");

        private String value;

        Priority(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }
    }

    @XmlElement
    private String loc;

    @XmlElement
    private String lastmod = new SimpleDateFormat("yyyy-MM-DD").format(new Date());

    @XmlElement
    private String changefreq = "daily";

    @XmlElement
    private String priority;

    public XmlUrl() {
    }

    public XmlUrl(String loc, Priority priority) {
        this.loc = loc;
        this.priority = priority.getValue();
    }

    public String getLoc() {
        return loc;
    }

    public String getPriority() {
        return priority;
    }

    public String getChangefreq() {
        return changefreq;
    }

    public String getLastmod() {
        return lastmod;
    }
}
@@ -26,67 +26,8 @@
 p;%0A%0A
-import java.text.SimpleDateFormat;%0Aimport java.util.Date;%0A%0A
 impo
@@ -215,16 +215,92 @@
 ement;%0A%0A
+import org.joda.time.DateTime;%0Aimport org.joda.time.format.DateTimeFormat;%0A%0A
 @XmlAcce
@@ -800,55 +800,66 @@
 new 
-SimpleDateFormat(%22yyyy-MM-DD%22).format(new Date(
+DateTime().toString(DateTimeFormat.forPattern(%22yyyy-MM-dd%22
 ));%0A

ajuste na data