public class SourceType
extends java.lang.Object
Examples:
Shows how to get bibliography sources available in the document.
Document document = new Document(getMyDir() + "Bibliography sources.docx");
Bibliography bibliography = document.getBibliography();
Assert.assertEquals(12, bibliography.getSources().size());
// Get default data from bibliography sources.
Collection<Source> sources = bibliography.getSources();
Source source = (Source)sources.toArray()[0];
Assert.assertEquals("Book 0 (No LCID)", source.getTitle());
Assert.assertEquals(SourceType.BOOK, source.getSourceType());
Assert.assertNull(source.getAbbreviatedCaseNumber());
Assert.assertNull(source.getAlbumTitle());
Assert.assertNull(source.getBookTitle());
Assert.assertNull(source.getBroadcaster());
Assert.assertNull(source.getBroadcastTitle());
Assert.assertNull(source.getCaseNumber());
Assert.assertNull(source.getChapterNumber());
Assert.assertNull(source.getComments());
Assert.assertNull(source.getConferenceName());
Assert.assertNull(source.getCountryOrRegion());
Assert.assertNull(source.getCourt());
Assert.assertNull(source.getDay());
Assert.assertNull(source.getDayAccessed());
Assert.assertNull(source.getDepartment());
Assert.assertNull(source.getDistributor());
Assert.assertNull(source.getDoi());
Assert.assertNull(source.getEdition());
Assert.assertNull(source.getGuid());
Assert.assertNull(source.getInstitution());
Assert.assertNull(source.getInternetSiteTitle());
Assert.assertNull(source.getIssue());
Assert.assertNull(source.getJournalName());
Assert.assertNull(source.getLcid());
Assert.assertNull(source.getMedium());
Assert.assertNull(source.getMonth());
Assert.assertNull(source.getMonthAccessed());
Assert.assertNull(source.getNumberVolumes());
Assert.assertNull(source.getPages());
Assert.assertNull(source.getPatentNumber());
Assert.assertNull(source.getPeriodicalTitle());
Assert.assertNull(source.getProductionCompany());
Assert.assertNull(source.getPublicationTitle());
Assert.assertNull(source.getPublisher());
Assert.assertNull(source.getRecordingNumber());
Assert.assertNull(source.getRefOrder());
Assert.assertNull(source.getReporter());
Assert.assertNull(source.getShortTitle());
Assert.assertNull(source.getStandardNumber());
Assert.assertNull(source.getStateOrProvince());
Assert.assertNull(source.getStation());
Assert.assertEquals("BookNoLCID", source.getTag());
Assert.assertNull(source.getTheater());
Assert.assertNull(source.getThesisType());
Assert.assertNull(source.getType());
Assert.assertNull(source.getUrl());
Assert.assertNull(source.getVersion());
Assert.assertNull(source.getVolume());
Assert.assertNull(source.getYear());
Assert.assertNull(source.getYearAccessed());
// Also, you can create a new source.
Source newSource = new Source("New source", SourceType.MISC);
ContributorCollection contributors = source.getContributors();
Assert.assertNull(contributors.getArtist());
Assert.assertNull(contributors.getBookAuthor());
Assert.assertNull(contributors.getCompiler());
Assert.assertNull(contributors.getComposer());
Assert.assertNull(contributors.getConductor());
Assert.assertNull(contributors.getCounsel());
Assert.assertNull(contributors.getDirector());
Assert.assertNotNull(contributors.getEditor());
Assert.assertNull(contributors.getInterviewee());
Assert.assertNull(contributors.getInterviewer());
Assert.assertNull(contributors.getInventor());
Assert.assertNull(contributors.getPerformer());
Assert.assertNull(contributors.getProducer());
Assert.assertNotNull(contributors.getTranslator());
Assert.assertNull(contributors.getWriter());
Contributor editor = contributors.getEditor();
Assert.assertEquals(2, ((PersonCollection)editor).getCount());
PersonCollection authors = (PersonCollection)contributors.getAuthor();
Assert.assertEquals(2, authors.getCount());
Person person = authors.get(0);
Assert.assertEquals("Roxanne", person.getFirst());
Assert.assertEquals("Brielle", person.getMiddle());
Assert.assertEquals("Tejeda", person.getLast());
| Modifier and Type | Field and Description |
|---|---|
static int |
ART
Specifies the art source.
|
static int |
ARTICLE_IN_A_PERIODICAL
Specifies the article in a periodical source.
|
static int |
BOOK
Specifies the book source.
|
static int |
BOOK_SECTION
Specifies the book section source.
|
static int |
CASE
Specifies the case source.
|
static int |
CONFERENCE_PROCEEDINGS
Specifies the conference proceedings source.
|
static int |
DOCUMENT_FROM_INTERNET_SITE
Specifies the document from internet site source.
|
static int |
ELECTRONIC
Specifies the electronic source.
|
static int |
FILM
Specifies the film source.
|
static int |
INTERNET_SITE
Specifies the internet site source.
|
static int |
INTERVIEW
Specifies the interview source.
|
static int |
JOURNAL_ARTICLE
Specifies the journal article source.
|
static int |
length |
static int |
MISC
Specifies the miscellaneous source.
|
static int |
PATENT
Specifies the patent source.
|
static int |
PERFORMANCE
Specifies the performance source.
|
static int |
REPORT
Specifies the reporter source.
|
static int |
SOUND_RECORDING
Specifies the sound recording source.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
fromName(java.lang.String sourceTypeName) |
static java.lang.String |
getName(int sourceType) |
static int[] |
getValues() |
static java.lang.String |
toString(int sourceType) |
public static int ARTICLE_IN_A_PERIODICAL
public static int BOOK
public static int BOOK_SECTION
public static int JOURNAL_ARTICLE
public static int CONFERENCE_PROCEEDINGS
public static int REPORT
public static int SOUND_RECORDING
public static int PERFORMANCE
public static int ART
public static int DOCUMENT_FROM_INTERNET_SITE
public static int INTERNET_SITE
public static int FILM
public static int INTERVIEW
public static int PATENT
public static int ELECTRONIC
public static int CASE
public static int MISC
public static int length