Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Api\ParseValue Class Reference

API module for using value parsers. More...

+ Inheritance diagram for Wikibase\Repo\Api\ParseValue:
+ Collaboration diagram for Wikibase\Repo\Api\ParseValue:

Public Member Functions

 __construct (ApiMain $mainModule, $moduleName, DataTypeFactory $dataTypeFactory, ValueParserFactory $valueParserFactory, DataTypeValidatorFactory $dataTypeValidatorFactory, ExceptionLocalizer $exceptionLocalizer, ValidatorErrorLocalizer $validatorErrorLocalizer, PropertyDataTypeLookup $propertyDataTypeLookup, ApiErrorReporter $errorReporter)
 
 execute ()
 
 getAllowedParams ()
 

Protected Member Functions

 getExceptionStatus (Exception $error)
 Returns a Status object representing the given exception using a localized message.
 
 getExamplesMessages ()
 

Private Member Functions

 getParser ()
 
 getValidator ()
 
 wrapValidators (array $validators)
 
 parseStringValue (ValueParser $parser, $value, ValueValidator $validator=null)
 
 getValidatorErrorCodes (array $errors)
 
 addParseErrorToResult (array &$result, ParseException $parseError)
 
 outputResults (array $results)
 
 getOptionsObject ( $optionsParam)
 

Private Attributes

 $dataTypeFactory
 
 $valueParserFactory
 
 $dataTypeValidatorFactory
 
 $validatorErrorLocalizer
 
 $exceptionLocalizer
 
 $propertyDataTypeLookup
 
 $errorReporter
 

Detailed Description

API module for using value parsers.

Author
Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >
Daniel Kinzler
Addshore

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Api\ParseValue::__construct ( ApiMain  $mainModule,
  $moduleName,
DataTypeFactory  $dataTypeFactory,
ValueParserFactory  $valueParserFactory,
DataTypeValidatorFactory  $dataTypeValidatorFactory,
ExceptionLocalizer  $exceptionLocalizer,
ValidatorErrorLocalizer  $validatorErrorLocalizer,
PropertyDataTypeLookup  $propertyDataTypeLookup,
ApiErrorReporter  $errorReporter 
)
See also
ApiBase::__construct
Parameters
ApiMain$mainModule
string$moduleName
DataTypeFactory$dataTypeFactory
ValueParserFactory$valueParserFactory
DataTypeValidatorFactory$dataTypeValidatorFactory
ExceptionLocalizer$exceptionLocalizer
ValidatorErrorLocalizer$validatorErrorLocalizer
PropertyDataTypeLookup$propertyDataTypeLookup
ApiErrorReporter$errorReporter

Member Function Documentation

◆ addParseErrorToResult()

Wikibase\Repo\Api\ParseValue::addParseErrorToResult ( array &  $result,
ParseException  $parseError 
)
private

◆ execute()

Wikibase\Repo\Api\ParseValue::execute ( )

◆ getAllowedParams()

Wikibase\Repo\Api\ParseValue::getAllowedParams ( )

◆ getExamplesMessages()

Wikibase\Repo\Api\ParseValue::getExamplesMessages ( )
protected

◆ getExceptionStatus()

Wikibase\Repo\Api\ParseValue::getExceptionStatus ( Exception  $error)
protected

Returns a Status object representing the given exception using a localized message.

Note
The returned Status will always be fatal, that is, $status->isOK() will return false.
See also
getExceptionMessage().
Parameters
Exception$error
Returns
Status

◆ getOptionsObject()

Wikibase\Repo\Api\ParseValue::getOptionsObject (   $optionsParam)
private
Parameters
string | null$optionsParam
Returns
ParserOptions

◆ getParser()

Wikibase\Repo\Api\ParseValue::getParser ( )
private
Returns
ValueParser
Exceptions
LogicException

◆ getValidator()

Wikibase\Repo\Api\ParseValue::getValidator ( )
private
Returns
ValueValidator

◆ getValidatorErrorCodes()

Wikibase\Repo\Api\ParseValue::getValidatorErrorCodes ( array  $errors)
private
Parameters
Error[]$errors
Returns
string[]

◆ outputResults()

Wikibase\Repo\Api\ParseValue::outputResults ( array  $results)
private

◆ parseStringValue()

Wikibase\Repo\Api\ParseValue::parseStringValue ( ValueParser  $parser,
  $value,
ValueValidator  $validator = null 
)
private
Parameters
ValueParser$parser
string$value
ValueValidator | null$validator
Returns
array

◆ wrapValidators()

Wikibase\Repo\Api\ParseValue::wrapValidators ( array  $validators)
private
Parameters
ValueValidator[]$validators
Returns
ValueValidator

Member Data Documentation

◆ $dataTypeFactory

Wikibase\Repo\Api\ParseValue::$dataTypeFactory
private

◆ $dataTypeValidatorFactory

Wikibase\Repo\Api\ParseValue::$dataTypeValidatorFactory
private

◆ $errorReporter

Wikibase\Repo\Api\ParseValue::$errorReporter
private

◆ $exceptionLocalizer

Wikibase\Repo\Api\ParseValue::$exceptionLocalizer
private

◆ $propertyDataTypeLookup

Wikibase\Repo\Api\ParseValue::$propertyDataTypeLookup
private

◆ $validatorErrorLocalizer

Wikibase\Repo\Api\ParseValue::$validatorErrorLocalizer
private

◆ $valueParserFactory

Wikibase\Repo\Api\ParseValue::$valueParserFactory
private

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