Compare commits

..

No commits in common. "c15a64eb1dca81b46754544e27f1b555811e1229" and "be88c759fa5e4306e006f5cc70ebd60c600182dd" have entirely different histories.

3 changed files with 32 additions and 28 deletions

View file

@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit! #Build Number for ANT. Do not edit!
#Fri Aug 23 01:55:11 CEST 2024 #Thu Oct 14 16:09:34 CEST 2021
build.number=2 build.number=1

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2013-2024 Christian Pierre MOMON * Copyright (C) 2013-2014,2017 Christian Pierre MOMON
* *
* This file is part of Devinsy-rss. * This file is part of Devinsy-rss.
* *
@ -18,11 +18,13 @@
*/ */
package fr.devinsy.util.rss; package fr.devinsy.util.rss;
import java.time.ZonedDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
/** /**
* The Class RSSElement. * The Class RSSElement.
*
* @author Christian Pierre MOMON (christian.momon@devinsy.fr)
*/ */
public class RSSElement public class RSSElement
{ {
@ -32,6 +34,29 @@ public class RSSElement
private String value; private String value;
private String[] attributes; private String[] attributes;
/**
* Instantiates a new RSS element.
*
* @param name
* the name
* @param value
* the value
*/
public RSSElement(final String name, final LocalDateTime value)
{
setName(name);
if (value == null)
{
this.value = null;
}
else
{
this.value = value.format(DateTimeFormatter.ofPattern(DATE_PATTERN));
}
this.attributes = null;
}
/** /**
* Instantiates a new RSS element. * Instantiates a new RSS element.
* *
@ -96,28 +121,6 @@ public class RSSElement
this.attributes = attributes; this.attributes = attributes;
} }
/**
* Instantiates a new RSS element.
*
* @param name
* the name
* @param value
* the value
*/
public RSSElement(final String name, final ZonedDateTime value)
{
setName(name);
if (value == null)
{
this.value = null;
}
else
{
this.value = value.format(DateTimeFormatter.ofPattern(DATE_PATTERN));
}
this.attributes = null;
}
/** /**
* Gets the attributes. * Gets the attributes.
* *
@ -187,4 +190,5 @@ public class RSSElement
{ {
this.value = value; this.value = value;
} }
} }

View file

@ -19,7 +19,7 @@
package fr.devinsy.util.rss.demo; package fr.devinsy.util.rss.demo;
import java.io.IOException; import java.io.IOException;
import java.time.ZonedDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -64,7 +64,7 @@ public class RSSDemo
// //
List<RSSElement> elements = new ArrayList<RSSElement>(); List<RSSElement> elements = new ArrayList<RSSElement>();
ZonedDateTime now = ZonedDateTime.now(); LocalDateTime now = LocalDateTime.now();
elements.add(new RSSElement("pubDate", now)); elements.add(new RSSElement("pubDate", now));
elements.add(new RSSElement("lastBuildDate", now)); elements.add(new RSSElement("lastBuildDate", now));
elements.add(new RSSElement("generator", "Generated by Foo")); elements.add(new RSSElement("generator", "Generated by Foo"));