public class JacksonObjectFactory extends Object implements DataObjectFactory
| Constructor and Description |
|---|
JacksonObjectFactory() |
public ItemIdValue getItemIdValue(String id, String siteIri)
DataObjectFactoryItemIdValue.getItemIdValue in interface DataObjectFactoryid - a string of the form Qn... where n... is the string
representation of a positive integer numbersiteIri - IRI to identify the site, usually the first part of the entity
IRI of the site this belongs to, e.g.,
"http://www.wikidata.org/entity/"ItemIdValue corresponding to the inputpublic PropertyIdValue getPropertyIdValue(String id, String siteIri)
DataObjectFactoryPropertyIdValue.getPropertyIdValue in interface DataObjectFactoryid - a string of the form Pn... where n... is the string
representation of a positive integer numbersiteIri - IRI to identify the site, usually the first part of the entity
IRI of the site this belongs to, e.g.,
"http://www.wikidata.org/entity/"PropertyIdValue corresponding to the inputpublic DatatypeIdValue getDatatypeIdValue(String id)
DataObjectFactoryDatatypeIdValue. The datatype IRI is usually one of the
constants defined in DatatypeIdValue, but this is not enforced,
since there might be extensions that provide additional types.getDatatypeIdValue in interface DataObjectFactoryid - the IRI string that identifies the datatypeDatatypeIdValue corresponding to the inputpublic TimeValue getTimeValue(long year, byte month, byte day, byte hour, byte minute, byte second, byte precision, int beforeTolerance, int afterTolerance, int timezoneOffset, String calendarModel)
DataObjectFactoryTimeValue.getTimeValue in interface DataObjectFactoryyear - a year number, where 0 refers to 1BCEmonth - a month number between 1 and 12day - a day number between 1 and 31hour - an hour number between 0 and 23minute - a minute number between 0 and 59second - a second number between 0 and 60 (possible leap second)precision - a value in the range of TimeValue.PREC_DAY, ...,
TimeValue.PREC_1GYbeforeTolerance - non-negative integer tolerance before the value; see
TimeValue.getBeforeTolerance()afterTolerance - non-zero, positive integer tolerance before the value; see
TimeValue.getAfterTolerance()timezoneOffset - offset in minutes that should be applied when displaying this
timecalendarModel - the IRI of the calendar model preferred when displaying the
date; usually TimeValue.CM_GREGORIAN_PRO or
TimeValue.CM_JULIAN_PROTimeValue corresponding to the inputpublic GlobeCoordinatesValue getGlobeCoordinatesValue(double latitude, double longitude, double precision, String globeIri)
DataObjectFactoryGlobeCoordinatesValue.getGlobeCoordinatesValue in interface DataObjectFactorylatitude - the latitude of the coordinates in degreeslongitude - the longitude of the coordinates in degreesprecision - the precision of the coordinates in degreesglobeIri - IRI specifying the celestial objects of the coordinatesGlobeCoordinatesValue corresponding to the inputpublic StringValue getStringValue(String string)
DataObjectFactoryStringValue.getStringValue in interface DataObjectFactoryStringValue corresponding to the inputpublic MonolingualTextValue getMonolingualTextValue(String text, String languageCode)
DataObjectFactoryMonolingualTextValue.getMonolingualTextValue in interface DataObjectFactorytext - the text of the valuelanguageCode - the language code of the valueMonolingualTextValue corresponding to the inputpublic QuantityValue getQuantityValue(BigDecimal numericValue, BigDecimal lowerBound, BigDecimal upperBound)
DataObjectFactoryQuantityValue.getQuantityValue in interface DataObjectFactorynumericValue - the numeric value of this quantitylowerBound - the lower bound of the numeric value of this quantityupperBound - the upper bound of the numeric value of this quantityQuantityValue corresponding to the inputpublic ValueSnak getValueSnak(PropertyIdValue propertyId, Value value)
JacksonValueSnak. Value snaks in JSON need to know the
datatype of their property, which is not given in the parameters of this
method. The snak that will be returned will use a default type based on
the kind of value that is used (usually the "simplest" type for that
value). This may not be desired.getValueSnak in interface DataObjectFactoryValueSnak corresponding to the inputDataObjectFactory.getValueSnak(PropertyIdValue, Value)public SomeValueSnak getSomeValueSnak(PropertyIdValue propertyId)
DataObjectFactorySomeValueSnak.getSomeValueSnak in interface DataObjectFactorySomeValueSnak corresponding to the inputpublic NoValueSnak getNoValueSnak(PropertyIdValue propertyId)
DataObjectFactoryNoValueSnak.getNoValueSnak in interface DataObjectFactoryNoValueSnak corresponding to the inputpublic SnakGroup getSnakGroup(List<? extends Snak> snaks)
DataObjectFactorySnakGroup.getSnakGroup in interface DataObjectFactorysnaks - a non-empty list of snaks that use the same propertySnakGroup corresponding to the inputpublic Claim getClaim(EntityIdValue subject, Snak mainSnak, List<SnakGroup> qualifiers)
DataObjectFactoryClaim.getClaim in interface DataObjectFactorysubject - the subject the Statement refers tomainSnak - the main Snak of the Statementqualifiers - the qualifiers of the Statement, grouped in SnakGroupsClaim corresponding to the inputpublic Reference getReference(List<SnakGroup> snakGroups)
DataObjectFactoryReference.getReference in interface DataObjectFactorysnakGroups - list of snak groupsReference corresponding to the inputpublic Statement getStatement(Claim claim, List<? extends Reference> references, StatementRank rank, String statementId)
DataObjectFactoryStatement.
The string id is used mainly for communication with a Wikibase site, in order to refer to statements of that site. When creating new statements that are not on any site, the empty string can be used.
getStatement in interface DataObjectFactoryclaim - the main claim the Statement refers toreferences - the references for the Statementrank - the rank of the StatementstatementId - the string id of the StatementStatement corresponding to the inputpublic StatementGroup getStatementGroup(List<Statement> statements)
DataObjectFactoryStatementGroup.getStatementGroup in interface DataObjectFactorystatements - a non-empty list of statements that use the same subject and
main-snak property in their claimStatementGroup corresponding to the inputpublic SiteLink getSiteLink(String title, String siteKey, List<String> badges)
DataObjectFactorySiteLink.getSiteLink in interface DataObjectFactorytitle - the title string of the linked page, including namespace
prefixes if anysiteKey - the string key of the site of the linked articlebadges - the list of badges of the linked articleSiteLink corresponding to the inputpublic PropertyDocument getPropertyDocument(PropertyIdValue propertyId, List<MonolingualTextValue> labels, List<MonolingualTextValue> descriptions, List<MonolingualTextValue> aliases, DatatypeIdValue datatypeId)
DataObjectFactoryPropertyDocument without any statements. This is
provided for backwards compatibility (property documents did not support
statements in the past).getPropertyDocument in interface DataObjectFactorypropertyId - the id of the property that data is aboutlabels - the list of labels of this property, with at most one label
for each language codedescriptions - the list of descriptions of this property, with at most one
description for each language codealiases - the list of aliases of this propertydatatypeId - the datatype of that propertyPropertyDocument corresponding to the inputpublic PropertyDocument getPropertyDocument(PropertyIdValue propertyId, List<MonolingualTextValue> labels, List<MonolingualTextValue> descriptions, List<MonolingualTextValue> aliases, List<StatementGroup> statementGroups, DatatypeIdValue datatypeId)
DataObjectFactoryPropertyDocument.getPropertyDocument in interface DataObjectFactorypropertyId - the id of the property that data is aboutlabels - the list of labels of this property, with at most one label
for each language codedescriptions - the list of descriptions of this property, with at most one
description for each language codealiases - the list of aliases of this propertystatementGroups - the list of statement groups of this item; all of them must
have the given itemIdValue as their subjectdatatypeId - the datatype of that propertyPropertyDocument corresponding to the inputpublic ItemDocument getItemDocument(ItemIdValue itemIdValue, List<MonolingualTextValue> labels, List<MonolingualTextValue> descriptions, List<MonolingualTextValue> aliases, List<StatementGroup> statementGroups, Map<String,SiteLink> siteLinks)
DataObjectFactoryItemDocument.getItemDocument in interface DataObjectFactoryitemIdValue - the id of the item that data is aboutlabels - the list of labels of this item, with at most one label for
each language codedescriptions - the list of descriptions of this item, with at most one
description for each language codealiases - the list of aliases of this itemstatementGroups - the list of statement groups of this item; all of them must
have the given itemIdValue as their subjectsiteLinks - the sitelinks of this item by site keyItemDocument corresponding to the inputCopyright © 2014–2015 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage