Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders Class Reference

Low level factory for ValueFormatters for well known data types. More...

Public Member Functions

 __construct (FormatterLabelDescriptionLookupFactory $labelDescriptionLookupFactory, LanguageNameLookupFactory $languageNameLookupFactory, EntityIdParser $itemUriParser, string $geoShapeStorageBaseUrl, string $tabularDataStorageBaseUrl, TermFallbackCacheFacade $termFallbackCacheFacade, EntityLookup $entityLookup, RedirectResolvingLatestRevisionLookup $redirectResolvingLatestRevisionLookup, EntityExistenceChecker $entityExistenceChecker, EntityTitleTextLookup $entityTitleTextLookup, EntityUrlLookup $entityUrlLookup, EntityRedirectChecker $entityRedirectChecker, LanguageFactory $languageFactory, EntityTitleLookup $entityTitleLookup=null, CachingKartographerEmbeddingHandler $kartographerEmbeddingHandler=null, bool $useKartographerMaplinkInWikitext=false, array $thumbLimits=[])
 
 newEntityIdFormatter ( $format, FormatterOptions $options)
 
 newPropertyIdHtmlLinkFormatter (FormatterOptions $options)
 
 newItemIdHtmlLinkFormatter (FormatterOptions $options)
 
 newStringFormatter ( $format)
 
 newUnDeserializableValueFormatter ( $format, FormatterOptions $options)
 
 newUrlFormatter ( $format, FormatterOptions $options)
 
 newCommonsMediaFormatter ( $format, FormatterOptions $options)
 
 newGeoShapeFormatter ( $format)
 
 newTabularDataFormatter ( $format, FormatterOptions $options)
 
 newTimeFormatter ( $format, FormatterOptions $options)
 
 newQuantityFormatter ( $format, FormatterOptions $options)
 
 newGlobeCoordinateFormatter ( $format, FormatterOptions $options)
 
 newMonolingualFormatter ( $format, FormatterOptions $options)
 
 newLabelsProviderEntityIdHtmlLinkFormatter (FormatterOptions $options)
 

Private Member Functions

 newPlainEntityIdFormatter (FormatterOptions $options)
 
 isHtmlFormat ( $format)
 
 escapeValueFormatter ( $format, ValueFormatter $formatter)
 Wraps the given formatter in an EscapingValueFormatter if necessary.
 
 getNonCachingLookup (FormatterOptions $options)
 
 getLabelDescriptionLookup (FormatterOptions $options)
 
 getNumberLocalizer (FormatterOptions $options)
 
 getVocabularyUriFormatter (FormatterOptions $options)
 

Private Attributes

 $labelDescriptionLookupFactory
 
 $languageNameLookupFactory
 
 $itemUriParser
 
 $geoShapeStorageBaseUrl
 
 $entityTitleLookup
 
 $unitOneUris
 
 $tabularDataStorageBaseUrl
 
 $entityLookup
 
 $redirectResolvingLatestRevisionLookup
 
 $cache
 
 $snakFormat
 
 $kartographerEmbeddingHandler
 
 $useKartographerMaplinkInWikitext
 
 $thumbLimits
 
 $entityExistenceChecker
 
 $entityTitleTextLookup
 
 $entityUrlLookup
 
 $entityRedirectChecker
 
 $languageFactory
 

Detailed Description

Low level factory for ValueFormatters for well known data types.

Warning
: This is a low level factory for use by bootstrap code only! Program logic should use an instance of OutputFormatValueFormatterFactory resp. OutputFormatSnakFormatterFactory.
Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::__construct ( FormatterLabelDescriptionLookupFactory $labelDescriptionLookupFactory,
LanguageNameLookupFactory $languageNameLookupFactory,
EntityIdParser $itemUriParser,
string $geoShapeStorageBaseUrl,
string $tabularDataStorageBaseUrl,
TermFallbackCacheFacade $termFallbackCacheFacade,
EntityLookup $entityLookup,
RedirectResolvingLatestRevisionLookup $redirectResolvingLatestRevisionLookup,
EntityExistenceChecker $entityExistenceChecker,
EntityTitleTextLookup $entityTitleTextLookup,
EntityUrlLookup $entityUrlLookup,
EntityRedirectChecker $entityRedirectChecker,
LanguageFactory $languageFactory,
EntityTitleLookup $entityTitleLookup = null,
CachingKartographerEmbeddingHandler $kartographerEmbeddingHandler = null,
bool $useKartographerMaplinkInWikitext = false,
array $thumbLimits = [] )

Member Function Documentation

◆ escapeValueFormatter()

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::escapeValueFormatter ( $format,
ValueFormatter $formatter )
private

Wraps the given formatter in an EscapingValueFormatter if necessary.

Parameters
string$formatThe desired target format, see SnakFormatter::FORMAT_XXX
ValueFormatter$formatterThe plain text formatter to wrap.
Returns
ValueFormatter

◆ getLabelDescriptionLookup()

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::getLabelDescriptionLookup ( FormatterOptions $options)
private

◆ getNonCachingLookup()

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::getNonCachingLookup ( FormatterOptions $options)
private

◆ getNumberLocalizer()

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::getNumberLocalizer ( FormatterOptions $options)
private
Parameters
FormatterOptions$options
Returns
MediaWikiNumberLocalizer

◆ getVocabularyUriFormatter()

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::getVocabularyUriFormatter ( FormatterOptions $options)
private
Parameters
FormatterOptions$options
Returns
VocabularyUriFormatter

◆ isHtmlFormat()

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::isHtmlFormat ( $format)
private
Parameters
string$formatThe desired target format, see SnakFormatter::FORMAT_XXX
Exceptions
InvalidArgumentException
Returns
bool True if $format is one of the SnakFormatter::FORMAT_HTML_XXX formats.

◆ newCommonsMediaFormatter()

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::newCommonsMediaFormatter ( $format,
FormatterOptions $options )
Parameters
string$formatThe desired target format, see SnakFormatter::FORMAT_XXX
FormatterOptions$options
Returns
ValueFormatter

◆ newEntityIdFormatter()

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::newEntityIdFormatter ( $format,
FormatterOptions $options )
Parameters
string$formatThe desired target format, see SnakFormatter::FORMAT_XXX
FormatterOptions$options
Returns
ValueFormatter

◆ newGeoShapeFormatter()

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::newGeoShapeFormatter ( $format)
Parameters
string$formatThe desired target format, see SnakFormatter::FORMAT_XXX
Returns
ValueFormatter

◆ newGlobeCoordinateFormatter()

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::newGlobeCoordinateFormatter ( $format,
FormatterOptions $options )
Parameters
string$formatThe desired target format, see SnakFormatter::FORMAT_XXX
FormatterOptions$options
Returns
ValueFormatter

◆ newItemIdHtmlLinkFormatter()

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::newItemIdHtmlLinkFormatter ( FormatterOptions $options)

◆ newLabelsProviderEntityIdHtmlLinkFormatter()

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::newLabelsProviderEntityIdHtmlLinkFormatter ( FormatterOptions $options)

◆ newMonolingualFormatter()

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::newMonolingualFormatter ( $format,
FormatterOptions $options )
Parameters
string$formatThe desired target format, see SnakFormatter::FORMAT_XXX
FormatterOptions$options
Returns
MonolingualHtmlFormatter|MonolingualWikitextFormatter|MonolingualTextFormatter

◆ newPlainEntityIdFormatter()

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::newPlainEntityIdFormatter ( FormatterOptions $options)
private

◆ newPropertyIdHtmlLinkFormatter()

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::newPropertyIdHtmlLinkFormatter ( FormatterOptions $options)

◆ newQuantityFormatter()

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::newQuantityFormatter ( $format,
FormatterOptions $options )
Parameters
string$formatThe desired target format, see SnakFormatter::FORMAT_XXX
FormatterOptions$options
Returns
ValueFormatter

◆ newStringFormatter()

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::newStringFormatter ( $format)
Parameters
string$formatThe desired target format, see SnakFormatter::FORMAT_XXX
Returns
ValueFormatter

◆ newTabularDataFormatter()

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::newTabularDataFormatter ( $format,
FormatterOptions $options )
Parameters
string$formatThe desired target format, see SnakFormatter::FORMAT_XXX
FormatterOptions$options
Returns
ValueFormatter

◆ newTimeFormatter()

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::newTimeFormatter ( $format,
FormatterOptions $options )
Parameters
string$formatThe desired target format, see SnakFormatter::FORMAT_XXX
FormatterOptions$options
Returns
ValueFormatter

◆ newUnDeserializableValueFormatter()

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::newUnDeserializableValueFormatter ( $format,
FormatterOptions $options )
Parameters
string$formatThe desired target format, see SnakFormatter::FORMAT_XXX
FormatterOptions$options
Returns
ValueFormatter

◆ newUrlFormatter()

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::newUrlFormatter ( $format,
FormatterOptions $options )
Parameters
string$formatThe desired target format, see SnakFormatter::FORMAT_XXX
FormatterOptions$options
Returns
ValueFormatter

Member Data Documentation

◆ $cache

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::$cache
private

◆ $entityExistenceChecker

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::$entityExistenceChecker
private

◆ $entityLookup

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::$entityLookup
private

◆ $entityRedirectChecker

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::$entityRedirectChecker
private

◆ $entityTitleLookup

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::$entityTitleLookup
private

◆ $entityTitleTextLookup

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::$entityTitleTextLookup
private

◆ $entityUrlLookup

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::$entityUrlLookup
private

◆ $geoShapeStorageBaseUrl

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::$geoShapeStorageBaseUrl
private

◆ $itemUriParser

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::$itemUriParser
private

◆ $kartographerEmbeddingHandler

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::$kartographerEmbeddingHandler
private

◆ $labelDescriptionLookupFactory

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::$labelDescriptionLookupFactory
private

◆ $languageFactory

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::$languageFactory
private

◆ $languageNameLookupFactory

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::$languageNameLookupFactory
private

◆ $redirectResolvingLatestRevisionLookup

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::$redirectResolvingLatestRevisionLookup
private

◆ $snakFormat

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::$snakFormat
private

◆ $tabularDataStorageBaseUrl

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::$tabularDataStorageBaseUrl
private

◆ $thumbLimits

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::$thumbLimits
private

◆ $unitOneUris

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::$unitOneUris
private
Initial value:
= [
'http://www.wikidata.org/entity/Q199',
'http://qudt.org/vocab/unit#Unitless',
]

◆ $useKartographerMaplinkInWikitext

Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::$useKartographerMaplinkInWikitext
private

The documentation for this class was generated from the following file: