Parsoid
A bidirectional parser between wikitext and HTML5
Loading...
Searching...
No Matches
Wikimedia\Parsoid\Utils\RichCodecable Interface Reference

This is an extension of JsonCodecable which adds some properties useful for rich attributes: More...

+ Inheritance diagram for Wikimedia\Parsoid\Utils\RichCodecable:
+ Collaboration diagram for Wikimedia\Parsoid\Utils\RichCodecable:

Public Member Functions

 flatten ()
 Provide a flattened "plain string" form of this data for use as the value of a compatibility attribute to implement HTML semantics.
 

Static Public Member Functions

static defaultValue ()
 Provide a constructor for a default value for objects of this type.
 
static hint ()
 Provide a JsonCodec Hint for serializing objects of this type.
 

Detailed Description

This is an extension of JsonCodecable which adds some properties useful for rich attributes:

  • a ::flatten() method which provides a plain string form of the data which is used for compatibility with HTML semantics, and
  • a ::hint() method which is used to provide additional class hint information for object. The default class hint is the name of the class, but if you want to add modifiers, or perhaps use a superclass as a hint, this method will allow that sort of customization.

Member Function Documentation

◆ defaultValue()

static Wikimedia\Parsoid\Utils\RichCodecable::defaultValue ( )
static

Provide a constructor for a default value for objects of this type.

Returns
?self

Implemented in Wikimedia\Parsoid\NodeData\DataMwI18n, and Wikimedia\Parsoid\NodeData\DataParsoidDiff.

◆ flatten()

Wikimedia\Parsoid\Utils\RichCodecable::flatten ( )

Provide a flattened "plain string" form of this data for use as the value of a compatibility attribute to implement HTML semantics.

Returns
?string a plain string, or null to omit the compatibility attribute

Implemented in Wikimedia\Parsoid\NodeData\DataMwI18n, and Wikimedia\Parsoid\NodeData\DataParsoidDiff.

◆ hint()

static Wikimedia\Parsoid\Utils\RichCodecable::hint ( )
static

Provide a JsonCodec Hint for serializing objects of this type.

Returns
class-string|Hint|null

Implemented in Wikimedia\Parsoid\NodeData\DataMwI18n, and Wikimedia\Parsoid\NodeData\DataParsoidDiff.


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