本文整理汇总了Java中com.sun.syndication.io.impl.DateParser.parseW3CDateTime方法的典型用法代码示例。如果您正苦于以下问题:Java DateParser.parseW3CDateTime方法的具体用法?Java DateParser.parseW3CDateTime怎么用?Java DateParser.parseW3CDateTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.syndication.io.impl.DateParser
的用法示例。
在下文中一共展示了DateParser.parseW3CDateTime方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: _testEntry
import com.sun.syndication.io.impl.DateParser; //导入方法依赖的package包/类
protected void _testEntry(int i) throws Exception {
List items = getCachedSyndFeed().getEntries();
SyndEntry entry = (SyndEntry) items.get(i);
assertProperty(entry.getTitle(),"feed.entry["+i+"].title");
assertProperty(entry.getTitleEx().getValue(),"feed.entry["+i+"].title");
assertEquals("text",entry.getTitleEx().getType());
assertEquals(entry.getLink(),"http://example.com/blog/entry" + (i + 1));
assertEquals(((SyndEnclosure)entry.getEnclosures().get(0)).getUrl(),"http://example.com/blog/enclosure"+(i+1)+".gif");
assertProperty(entry.getAuthor(),"feed.entry["+i+"].author.name");
Date d = DateParser.parseW3CDateTime("2000-0"+(i+1)+"-01T01:00:00Z");
assertEquals(entry.getPublishedDate(),d);
assertProperty(entry.getDescription().getValue(),"feed.entry["+i+"].summary");
assertProperty(((SyndContent)entry.getContents().get(0)).getValue(),"feed.entry["+i+"].content[0]");
assertEquals(1, ((List)entry.getForeignMarkup()).size());
SyndLink slink = (SyndLink)entry.getLinks().get(2);
assertTrue(slink.getHref().startsWith("tag:"));
}
示例2: _testDCModule
import com.sun.syndication.io.impl.DateParser; //导入方法依赖的package包/类
protected void _testDCModule(DCModule dc,String prefix,boolean isEntry,int index) throws Exception {
assertNotNull(dc);
assertProperty(dc.getTitle(),prefix+"dc:title");
assertProperty(dc.getCreator(),prefix+"dc:creator"); // Convenience method
assertProperty(((DCSubject)dc.getSubjects().get(0)).getValue(),prefix+"dc:subject[0]");
String taxo0 = ((DCSubject)dc.getSubjects().get(0)).getTaxonomyUri();
if (taxo0!=null) {
assertProperty(taxo0,prefix+"dc:subject[0].taxo:topic^resource");
}
assertProperty(((DCSubject)dc.getSubjects().get(1)).getValue(),prefix+"dc:subject[1]");
String taxo1 = ((DCSubject)dc.getSubjects().get(1)).getTaxonomyUri();
if (taxo1!=null) {
assertProperty(taxo1,prefix+"dc:subject[1].taxo:topic^resource");
}
assertProperty(dc.getDescription(),prefix+"dc:description");
assertProperty(dc.getPublisher(),prefix+"dc:publisher");
assertProperty((String)dc.getContributors().get(0),prefix+"dc:contributor[0]");
assertProperty((String)dc.getContributors().get(1),prefix+"dc:contributor[1]");
Date date = DateParser.parseW3CDateTime("2000-0"+(index+1)+"-01T00:00:00Z");
assertEquals(dc.getDate(),date);
assertProperty(dc.getType(),prefix+"dc:type");
assertProperty(dc.getFormat(),prefix+"dc:format");
assertProperty(dc.getIdentifier(),prefix+"dc:identifier");
assertProperty(dc.getSource(),prefix+"dc:source");
assertProperty(dc.getLanguage(),prefix+"dc:language");
assertProperty(dc.getRelation(),prefix+"dc:relation");
assertProperty(dc.getCoverage(),prefix+"dc:coverage");
if (isEntry) {
assertProperty(dc.getRights(),prefix+"dc:rights");
}
else {
assertProperty(dc.getRights(),prefix+"copyright"); // in header is convenience method
}
}
示例3: testFeedSyModule
import com.sun.syndication.io.impl.DateParser; //导入方法依赖的package包/类
public void testFeedSyModule() throws Exception {
SyModule sy = (SyModule) getCachedSyndFeed().getModule(SyModule.URI);
assertNotNull(sy);
assertEquals(sy.getUpdatePeriod(),SyModule.HOURLY);
assertEquals(sy.getUpdateFrequency(),100);
Date date = DateParser.parseW3CDateTime("2001-01-01T01:00+00:00");
assertEquals(sy.getUpdateBase(),date);
}
示例4: _testEntry
import com.sun.syndication.io.impl.DateParser; //导入方法依赖的package包/类
protected void _testEntry(int i) throws Exception {
List items = getCachedSyndFeed().getEntries();
SyndEntry entry = (SyndEntry) items.get(i);
assertProperty(entry.getTitle(),"feed.entry["+i+"].title");
assertProperty(entry.getLink(),"feed.entry["+i+"].link^href");
assertProperty(entry.getAuthor(),"feed.entry["+i+"].author.name");
Date d = DateParser.parseW3CDateTime("2000-0"+(i+1)+"-01T00:00:00Z");
assertEquals(entry.getPublishedDate(),d);
assertProperty(entry.getDescription().getValue(),"feed.entry["+i+"].summary");
assertProperty(((SyndContent)entry.getContents().get(0)).getValue(),"feed.entry["+i+"].content[0]");
assertProperty(((SyndContent)entry.getContents().get(1)).getValue(),"feed.entry["+i+"].content[1]");
}
示例5: _testEntry
import com.sun.syndication.io.impl.DateParser; //导入方法依赖的package包/类
protected void _testEntry(int i) throws Exception {
List items = getCachedSyndFeed().getEntries();
SyndEntry entry = (SyndEntry) items.get(i);
assertProperty(entry.getTitle(),"feed.entry["+i+"].title");
assertEquals(entry.getLink(),"http://example.com/blog/entry" + (i + 1));
assertProperty(entry.getAuthor(),"feed.entry["+i+"].author.name");
Date d = DateParser.parseW3CDateTime("2000-0"+(i+1)+"-01T01:00:00Z");
assertEquals(entry.getPublishedDate(),d);
assertProperty(entry.getDescription().getValue(),"feed.entry["+i+"].summary");
assertProperty(((SyndContent)entry.getContents().get(0)).getValue(),"feed.entry["+i+"].content[0]");
}
示例6: _testDCModule
import com.sun.syndication.io.impl.DateParser; //导入方法依赖的package包/类
protected void _testDCModule(DCModule dc,String prefix) throws Exception {
assertNotNull(dc);
assertProperty(dc.getTitle(),prefix+"dc:title");
assertProperty(dc.getCreator(),prefix+"dc:creator");
assertProperty(((DCSubject)dc.getSubjects().get(0)).getValue(),prefix+"dc:subject[0]");
String taxo0 = ((DCSubject)dc.getSubjects().get(0)).getTaxonomyUri();
if (taxo0!=null) {
assertProperty(taxo0,prefix+"dc:subject[0].taxo:topic^resource");
}
assertProperty(((DCSubject)dc.getSubjects().get(1)).getValue(),prefix+"dc:subject[1]");
String taxo1 = ((DCSubject)dc.getSubjects().get(1)).getTaxonomyUri();
if (taxo1!=null) {
assertProperty(taxo1,prefix+"dc:subject[1].taxo:topic^resource");
}
assertProperty(dc.getDescription(),prefix+"dc:description");
assertProperty(dc.getPublisher(),prefix+"dc:publisher");
assertProperty((String)dc.getContributors().get(0),prefix+"dc:contributor[0]");
assertProperty((String)dc.getContributors().get(1),prefix+"dc:contributor[1]");
Date date = DateParser.parseW3CDateTime("2001-01-01T00:00+00:00");
assertEquals(dc.getDate(),date);
assertProperty(dc.getType(),prefix+"dc:type");
assertProperty(dc.getFormat(),prefix+"dc:format");
assertProperty(dc.getIdentifier(),prefix+"dc:identifier");
assertProperty(dc.getSource(),prefix+"dc:source");
assertProperty(dc.getLanguage(),prefix+"dc:language");
assertProperty(dc.getRelation(),prefix+"dc:relation");
assertProperty(dc.getCoverage(),prefix+"dc:coverage");
assertProperty(dc.getRights(),prefix+"dc:rights");
}
示例7: testChannelSyModule
import com.sun.syndication.io.impl.DateParser; //导入方法依赖的package包/类
public void testChannelSyModule() throws Exception {
SyModule sy = (SyModule) getCachedSyndFeed().getModule(SyModule.URI);
assertNotNull(sy);
assertEquals(sy.getUpdatePeriod(),SyModule.HOURLY);
assertEquals(sy.getUpdateFrequency(),100);
Date date = DateParser.parseW3CDateTime("2001-01-01T01:00+00:00");
assertEquals(sy.getUpdateBase(),date);
}
示例8: _testDCModule
import com.sun.syndication.io.impl.DateParser; //导入方法依赖的package包/类
protected void _testDCModule(DCModule dc,String prefix) throws Exception {
assertNotNull(dc);
assertProperty((String)dc.getTitles().get(0), prefix + "dc:title[0]");
assertProperty((String)dc.getTitles().get(1), prefix + "dc:title[1]");
assertProperty((String)dc.getCreators().get(0), prefix + "dc:creator[0]");
assertProperty((String)dc.getCreators().get(1), prefix + "dc:creator[1]");
assertProperty(((DCSubject)dc.getSubjects().get(0)).getValue(), prefix + "dc:subject[0]");
String taxo0 = ((DCSubject)dc.getSubjects().get(0)).getTaxonomyUri();
if (taxo0 != null) {
assertProperty(taxo0, prefix + "dc:subject[0].taxo:topic^resource");
}
assertProperty(((DCSubject)dc.getSubjects().get(1)).getValue(), prefix + "dc:subject[1]");
String taxo1 = ((DCSubject)dc.getSubjects().get(1)).getTaxonomyUri();
if (taxo1 != null) {
assertProperty(taxo1, prefix + "dc:subject[1].taxo:topic^resource");
}
assertProperty((String)dc.getDescriptions().get(0), prefix + "dc:description[0]");
assertProperty((String)dc.getDescriptions().get(1), prefix + "dc:description[1]");
assertProperty((String)dc.getPublishers().get(0), prefix + "dc:publisher[0]");
assertProperty((String)dc.getPublishers().get(1), prefix + "dc:publisher[1]");
assertProperty((String)dc.getContributors().get(0),prefix + "dc:contributor[0]");
assertProperty((String)dc.getContributors().get(1),prefix + "dc:contributor[1]");
Date date = DateParser.parseW3CDateTime("2001-01-01T00:00+00:00");
assertEquals((Date)dc.getDates().get(0), date);
assertEquals((Date)dc.getDates().get(1), date);
assertProperty((String)dc.getTypes().get(0), prefix + "dc:type[0]");
assertProperty((String)dc.getTypes().get(1), prefix +"dc:type[1]");
assertProperty((String)dc.getFormats().get(0), prefix + "dc:format[0]");
assertProperty((String)dc.getFormats().get(1), prefix + "dc:format[1]");
assertProperty((String)dc.getIdentifiers().get(0), prefix + "dc:identifier[0]");
assertProperty((String)dc.getIdentifiers().get(1), prefix + "dc:identifier[1]");
assertProperty((String)dc.getSources().get(0), prefix + "dc:source[0]");
assertProperty((String)dc.getSources().get(1), prefix + "dc:source[1]");
assertProperty((String)dc.getLanguages().get(0), prefix + "dc:language[0]");
assertProperty((String)dc.getLanguages().get(1), prefix + "dc:language[1]");
assertProperty((String)dc.getRelations().get(0), prefix + "dc:relation[0]");
assertProperty((String)dc.getRelations().get(1), prefix + "dc:relation[1]");
assertProperty((String)dc.getCoverages().get(0), prefix + "dc:coverage[0]");
assertProperty((String)dc.getCoverages().get(1), prefix + "dc:coverage[1]");
assertProperty((String)dc.getRightsList().get(0), prefix + "dc:rights[0]");
assertProperty((String)dc.getRightsList().get(1), prefix + "dc:rights[1]");
}
示例9: testPublishedDate
import com.sun.syndication.io.impl.DateParser; //导入方法依赖的package包/类
public void testPublishedDate() throws Exception {
Date d = DateParser.parseW3CDateTime("2000-01-01T00:00:00Z");
assertEquals(getCachedSyndFeed().getPublishedDate(),d);
}