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

Customized subclass of JsonCodec for serialization of rich attributes. More...

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

Public Member Functions

 setOptions (array $options)
 
 setUniqueTID (string $tidBase, Element $template)
 
 popTID (string $tid)
 
 flatten ( $obj)
 Return a flattened string representation of this complex object.
 
 defaultValue ( $className)
 Return an appropriate default value for objects of the given type.
 
 __construct (Document $ownerDoc, array $options)
 Create a new DOMDataCodec.
 

Public Attributes

Document $ownerDoc
 
array $options = []
 

Detailed Description

Customized subclass of JsonCodec for serialization of rich attributes.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Parsoid\Utils\DOMDataCodec::__construct ( Document $ownerDoc,
array $options )

Create a new DOMDataCodec.

Parameters
Document$ownerDoc
array$options

Flatten the given DocumentFragment into a string.

Parameters
DocumentFragment$df
Returns
string

Return a default value for a new attribute of this type.

Returns
DocumentFragment

Member Function Documentation

◆ defaultValue()

Wikimedia\Parsoid\Utils\DOMDataCodec::defaultValue ( $className)

Return an appropriate default value for objects of the given type.

@phan-template T

Parameters
class-string<T>$className
Returns
T

◆ flatten()

Wikimedia\Parsoid\Utils\DOMDataCodec::flatten ( $obj)

Return a flattened string representation of this complex object.

Parameters
object$obj
Returns
?string

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