1 17 package com.sun.syndication.feed.module; 18 19 import com.sun.syndication.feed.impl.CopyFromHelper; 20 import com.sun.syndication.feed.impl.ObjectBean; 21 22 import java.util.*; 23 24 25 32 public class DCModuleImpl extends ModuleImpl implements DCModule { 33 private ObjectBean _objBean; 34 private List _title; 35 private List _creator; 36 private List _subject; 37 private List _description; 38 private List _publisher; 39 private List _contributors; 40 private List _date; 41 private List _type; 42 private List _format; 43 private List _identifier; 44 private List _source; 45 private List _language; 46 private List _relation; 47 private List _coverage; 48 private List _rights; 49 50 53 private static final Set IGNORE_PROPERTIES = new HashSet(); 54 55 62 public static final Set CONVENIENCE_PROPERTIES = Collections.unmodifiableSet(IGNORE_PROPERTIES); 63 64 static { 65 IGNORE_PROPERTIES.add("title"); 66 IGNORE_PROPERTIES.add("creator"); 67 IGNORE_PROPERTIES.add("subject"); 68 IGNORE_PROPERTIES.add("description"); 69 IGNORE_PROPERTIES.add("publisher"); 70 IGNORE_PROPERTIES.add("contributor"); 71 IGNORE_PROPERTIES.add("date"); 72 IGNORE_PROPERTIES.add("type"); 73 IGNORE_PROPERTIES.add("format"); 74 IGNORE_PROPERTIES.add("identifier"); 75 IGNORE_PROPERTIES.add("source"); 76 IGNORE_PROPERTIES.add("language"); 77 IGNORE_PROPERTIES.add("relation"); 78 IGNORE_PROPERTIES.add("coverage"); 79 IGNORE_PROPERTIES.add("rights"); 80 } 81 82 87 public DCModuleImpl() { 88 super(DCModule.class, URI); 89 _objBean = new ObjectBean(DCModule.class, this, CONVENIENCE_PROPERTIES); 90 } 91 92 99 public List getTitles() { 100 return (_title == null) ? (_title = new ArrayList()) : _title; 101 } 102 103 110 public void setTitles(List titles) { 111 _title = titles; 112 } 113 114 120 public String getTitle() { 121 return ((_title != null) && (_title.size() > 0)) ? (String ) _title.get(0) : null; 122 } 123 124 131 public void setTitle(String title) { 132 _title = new ArrayList(); 133 _title.add(title); 134 } 135 136 143 public List getCreators() { 144 return (_creator == null) ? (_creator = new ArrayList()) : _creator; 145 } 146 147 154 public void setCreators(List creators) { 155 _creator = creators; 156 } 157 158 164 public String getCreator() { 165 return ((_creator != null) && (_creator.size() > 0)) ? (String ) _creator.get(0) : null; 166 } 167 168 175 public void setCreator(String creator) { 176 _creator = new ArrayList(); 177 _creator.add(creator); 178 } 179 180 187 public List getSubjects() { 188 return (_subject == null) ? (_subject = new ArrayList()) : _subject; 189 } 190 191 198 public void setSubjects(List subjects) { 199 _subject = subjects; 200 } 201 202 208 public DCSubject getSubject() { 209 return ((_subject != null) && (_subject.size() > 0)) ? 210 (DCSubject) _subject.get(0) : null; 211 } 212 213 220 public void setSubject(DCSubject subject) { 221 _subject = new ArrayList(); 222 _subject.add(subject); 223 } 224 225 232 public List getDescriptions() { 233 return (_description == null) ? (_description = new ArrayList()) : _description; 234 } 235 236 243 public void setDescriptions(List descriptions) { 244 _description = descriptions; 245 } 246 247 253 public String getDescription() { 254 return ((_description != null) && (_description.size() > 0)) ? 255 (String ) _description.get(0) : null; 256 } 257 258 265 public void setDescription(String description) { 266 _description = new ArrayList(); 267 _description.add(description); 268 } 269 270 277 public List getPublishers() { 278 return (_publisher == null) ? (_publisher = new ArrayList()) : _publisher; 279 } 280 281 288 public void setPublishers(List publishers) { 289 _publisher = publishers; 290 } 291 292 298 public String getPublisher() { 299 return ((_publisher != null) && (_publisher.size() > 0)) ? 300 (String ) _publisher.get(0) : null; 301 } 302 303 310 public void setPublisher(String publisher) { 311 _publisher = new ArrayList(); 312 _publisher.add(publisher); 313 } 314 315 322 public List getContributors() { 323 return (_contributors == null) ? (_contributors = new ArrayList()) : _contributors; 324 } 325 326 333 public void setContributors(List contributors) { 334 _contributors = contributors; 335 } 336 337 343 public String getContributor() { 344 return ((_contributors != null) && (_contributors.size() > 0)) ? 345 (String ) _contributors.get(0) : null; 346 } 347 348 355 public void setContributor(String contributor) { 356 _contributors = new ArrayList(); 357 _contributors.add(contributor); 358 } 359 360 367 public List getDates() { 368 return (_date == null) ? (_date = new ArrayList()) : _date; 369 } 370 371 378 public void setDates(List dates) { 379 _date = dates; 380 } 381 382 388 public Date getDate() { 389 return ((_date != null) && (_date.size() > 0)) ? 390 (Date) _date.get(0) : null; 391 } 392 399 public void setDate(Date date) { 400 _date = new ArrayList(); 401 _date.add(date); 402 } 403 404 411 public List getTypes() { 412 return (_type == null) ? (_type = new ArrayList()) : _type; 413 } 414 415 422 public void setTypes(List types) { 423 _type = types; 424 } 425 426 432 public String getType() { 433 return ((_type != null) && (_type.size() > 0)) ? 434 (String ) _type.get(0) : null; 435 } 436 437 444 public void setType(String type) { 445 _type = new ArrayList(); 446 _type.add(type); 447 } 448 449 456 public List getFormats() { 457 return (_format == null) ? (_format = new ArrayList()) : _format; 458 } 459 460 467 public void setFormats(List formats) { 468 _format = formats; 469 } 470 471 477 public String getFormat() { 478 return ((_format != null) && (_format.size() > 0)) ? 479 (String ) _format.get(0) : null; 480 } 481 482 489 public void setFormat(String format) { 490 _format = new ArrayList(); 491 _format.add(format); 492 } 493 494 501 public List getIdentifiers() { 502 return (_identifier == null) ? (_identifier = new ArrayList()) : _identifier; 503 } 504 505 512 public void setIdentifiers(List identifiers) { 513 _identifier = identifiers; 514 } 515 516 522 public String getIdentifier() { 523 return ((_identifier != null) && (_identifier.size() > 0)) ? 524 (String ) _identifier.get(0) : null; 525 } 526 527 534 public void setIdentifier(String identifier) { 535 _identifier = new ArrayList(); 536 _identifier.add(identifier); 537 } 538 539 546 public List getSources() { 547 return (_source == null) ? (_source = new ArrayList()) : _source; 548 } 549 550 557 public void setSources(List sources) { 558 _source = sources; 559 } 560 561 567 public String getSource() { 568 return ((_source != null) && (_source.size() > 0)) ? 569 (String ) _source.get(0) : null; 570 } 571 572 579 public void setSource(String source) { 580 _source = new ArrayList(); 581 _source.add(source); 582 } 583 584 591 public List getLanguages() { 592 return (_language == null) ? (_language = new ArrayList()) : _language; 593 } 594 595 602 public void setLanguages(List languages) { 603 _language = languages; 604 } 605 606 612 public String getLanguage() { 613 return ((_language != null) && (_language.size() > 0)) ? 614 (String ) _language.get(0) : null; 615 } 616 623 public void setLanguage(String language) { 624 _language = new ArrayList(); 625 _language.add(language); 626 } 627 628 635 public List getRelations() { 636 return (_relation == null) ? (_relation = new ArrayList()) : _relation; 637 } 638 639 646 public void setRelations(List relations) { 647 _relation = relations; 648 } 649 650 656 public String getRelation() { 657 return ((_relation != null) && (_relation.size() > 0)) ? 658 (String ) _relation.get(0) : null; 659 } 660 661 668 public void setRelation(String relation) { 669 _relation = new ArrayList(); 670 _relation.add(relation); 671 } 672 673 680 public List getCoverages() { 681 return (_coverage == null) ? (_coverage = new ArrayList()) : _coverage; 682 } 683 684 691 public void setCoverages(List coverages) { 692 _coverage = coverages; 693 } 694 695 701 public String getCoverage() { 702 return ((_coverage != null) && (_coverage.size() > 0)) ? 703 (String ) _coverage.get(0) : null; 704 } 705 706 713 public void setCoverage(String coverage) { 714 _coverage = new ArrayList(); 715 _coverage.add(coverage); 716 } 717 718 725 public List getRightsList() { 726 return (_rights == null) ? (_rights = new ArrayList()) : _rights; 727 } 728 729 736 public void setRightsList(List rights) { 737 _rights = rights; 738 } 739 740 746 public String getRights() { 747 return ((_rights != null) && (_rights.size() > 0)) ? 748 (String ) _rights.get(0) : null; 749 } 750 751 758 public void setRights(String rights) { 759 _rights = new ArrayList(); 760 _rights.add(rights); 761 } 762 763 770 public final Object clone() throws CloneNotSupportedException { 771 return _objBean.clone(); 772 } 773 774 781 public final boolean equals(Object other) { 782 return _objBean.equals(other); 783 } 784 785 793 public final int hashCode() { 794 return _objBean.hashCode(); 795 } 796 797 803 public final String toString() { 804 return _objBean.toString(); 805 } 806 807 public final Class getInterface() { 808 return DCModule.class; 809 } 810 811 public final void copyFrom(Object obj) { 812 COPY_FROM_HELPER.copy(this,obj); 813 } 814 815 private static final CopyFromHelper COPY_FROM_HELPER; 816 817 static { 818 Map basePropInterfaceMap = new HashMap(); 819 basePropInterfaceMap.put("titles", String .class); 820 basePropInterfaceMap.put("creators", String .class); 821 basePropInterfaceMap.put("subjects", DCSubject.class); 822 basePropInterfaceMap.put("descriptions", String .class); 823 basePropInterfaceMap.put("publishers", String .class); 824 basePropInterfaceMap.put("contributors", String .class); 825 basePropInterfaceMap.put("dates", Date.class); 826 basePropInterfaceMap.put("types", String .class); 827 basePropInterfaceMap.put("formats", String .class); 828 basePropInterfaceMap.put("identifiers", String .class); 829 basePropInterfaceMap.put("sources", String .class); 830 basePropInterfaceMap.put("languages", String .class); 831 basePropInterfaceMap.put("relations", String .class); 832 basePropInterfaceMap.put("coverages", String .class); 833 basePropInterfaceMap.put("rightsList", String .class); 834 835 Map basePropClassImplMap = new HashMap(); 836 basePropClassImplMap.put(DCSubject.class,DCSubjectImpl.class); 837 838 COPY_FROM_HELPER = new CopyFromHelper(DCModule.class,basePropInterfaceMap,basePropClassImplMap); 839 } 840 } 841 | Popular Tags |