Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用谷歌日历 api,并且正在使用 iCal4j 生成重复字符串。我也会使用这个库来检查一个应该包含重复字符串的字符串。我怎么能这样做?还有其他方法吗?非常感谢您对 Alberto 的任何帮助 :)
如果字符串仅包含 RRULE 值,则可以使用 net.fortuna.ical4j.model.property.RRule(String value) 构造函数或 net.fortuna.ical4j.model.Recur(String value) 构造函数并检查异常.
new Recur("FREQ=somejunk")将抛出 IllegalArgumentException 而
new Recur("FREQ=somejunk")
new Recur("FREQ=DAILY;UNTIL=bogus")将抛出 ParseException
new Recur("FREQ=DAILY;UNTIL=bogus")