當前位置: 首頁>>代碼示例>>Java>>正文


Java LifeStage類代碼示例

本文整理匯總了Java中org.gbif.ecat.voc.LifeStage的典型用法代碼示例。如果您正苦於以下問題:Java LifeStage類的具體用法?Java LifeStage怎麽用?Java LifeStage使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


LifeStage類屬於org.gbif.ecat.voc包,在下文中一共展示了LifeStage類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: mapField

import org.gbif.ecat.voc.LifeStage; //導入依賴的package包/類
@Override
public final void mapField(final VernacularName object,
		final String fieldName, final String value) throws BindException {
	super.mapField(object, fieldName, value);

	Term term = getTermFactory().findTerm(fieldName);
	logger.info("Mapping " + fieldName + " " + " " + value + " to "
			+ object);
	if (term instanceof DcTerm) {
		DcTerm dcTerm = (DcTerm) term;
		switch (dcTerm) {
		case identifier:
			object.setIdentifier(value);
			break;
		case language:
			object.setLanguage(new Locale(value));
			break;
		case source:
			object.setSource(value);
			break;
		case temporal:
			object.setTemporal(value);
			break;
		default:
			break;
		}
	}

	// DwcTerms
	if (term instanceof DwcTerm) {
		DwcTerm dwcTerm = (DwcTerm) term;
		switch (dwcTerm) {
		case countryCode:
			object.setCountryCode(value);
			break;
		case lifeStage:
			object.setLifeStage(LifeStage.valueOf(value));
			break;
		case locality:
			object.setLocality(value);
			break;
		case locationID:
			object.setLocation(conversionService.convert(value, Location.class));
			break;
		case sex:
			object.setSex(Sex.valueOf(value));
			break;
		case taxonRemarks:
			object.setTaxonRemarks(value);
			break;
		case vernacularName:
			object.setVernacularName(value);
			break;
		default:
			break;
		}
	}

	// Gbif Terms
	if (term instanceof GbifTerm) {
		GbifTerm gbifTerm = (GbifTerm) term;
		switch(gbifTerm) {
		case organismPart:
			object.setOrganismPart(value);
			break;
		case isPlural:
			object.setPlural(conversionService.convert(value, Boolean.class));
		case isPreferredName:
			object.setPreferredName(conversionService.convert(value, Boolean.class));
		default:
			break;
		}
	}
}
 
開發者ID:RBGKew,項目名稱:eMonocot,代碼行數:75,代碼來源:FieldSetMapper.java

示例2: getLifeStage

import org.gbif.ecat.voc.LifeStage; //導入依賴的package包/類
@Enumerated(value = EnumType.STRING)
public LifeStage getLifeStage() {
	return lifeStage;
}
 
開發者ID:RBGKew,項目名稱:eMonocot,代碼行數:5,代碼來源:VernacularName.java

示例3: setLifeStage

import org.gbif.ecat.voc.LifeStage; //導入依賴的package包/類
public void setLifeStage(LifeStage lifeStage) {
	this.lifeStage = lifeStage;
}
 
開發者ID:RBGKew,項目名稱:eMonocot,代碼行數:4,代碼來源:VernacularName.java

示例4: mapField

import org.gbif.ecat.voc.LifeStage; //導入依賴的package包/類
@Override
public final void mapField(final VernacularName object,
		final String fieldName, final String value) throws BindException {
	super.mapField(object, fieldName, value);

	Term term = getTermFactory().findTerm(fieldName);
	logger.debug("Mapping " + fieldName + " " + " " + value + " to " + object);
	if (term instanceof DcTerm) {
		DcTerm dcTerm = (DcTerm) term;
		switch (dcTerm) {
		case identifier:
			object.setIdentifier(value);
			break;
		case language:
			object.setLanguage(new Locale(value));
			break;
		case source:
			object.setSource(value);
			break;
		case temporal:
			object.setTemporal(value);
			break;
		default:
			break;
		}
	}

	// DwcTerms
	if (term instanceof DwcTerm) {
		DwcTerm dwcTerm = (DwcTerm) term;
		switch (dwcTerm) {
		case countryCode:
			object.setCountryCode(value);
			break;
		case lifeStage:
			object.setLifeStage(LifeStage.valueOf(value));
			break;
		case locality:
			object.setLocality(value);
			break;
		case locationID:
			object.setLocation(conversionService.convert(value, Location.class));
			break;
		case sex:
			object.setSex(Sex.valueOf(value));
			break;
		case taxonRemarks:
			object.setTaxonRemarks(value);
			break;
		case vernacularName:
			object.setVernacularName(value);
			break;
		default:
			break;
		}
	}

	// Gbif Terms
	if (term instanceof GbifTerm) {
		GbifTerm gbifTerm = (GbifTerm) term;
		switch(gbifTerm) {
		case organismPart:
			object.setOrganismPart(value);
			break;
		case isPlural:
			object.setPlural(conversionService.convert(value, Boolean.class));
		case isPreferredName:
			object.setPreferredName(conversionService.convert(value, Boolean.class));
		default:
			break;
		}
	}
}
 
開發者ID:RBGKew,項目名稱:powop,代碼行數:74,代碼來源:FieldSetMapper.java


注:本文中的org.gbif.ecat.voc.LifeStage類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。