Преглед изворни кода

Merge pull request #524 from ckeditor/t/467

Renamed converter builders to lowerCase.
Szymon Cofalik пре 9 година
родитељ
комит
147bad851b

+ 33 - 26
packages/ckeditor5-engine/src/conversion/model-converter-builder.js → packages/ckeditor5-engine/src/conversion/buildmodelconverter.js

@@ -20,7 +20,7 @@ import ViewContainerElement from '../view/containerelement.js';
  * Provides chainable, high-level API to easily build basic model-to-view converters that are appended to given
  * Provides chainable, high-level API to easily build basic model-to-view converters that are appended to given
  * dispatchers. In many cases, this is the API that should be used to specify how abstract model elements and
  * dispatchers. In many cases, this is the API that should be used to specify how abstract model elements and
  * attributes should be represented in the view (and then later in DOM). Instances of this class are created by
  * attributes should be represented in the view (and then later in DOM). Instances of this class are created by
- * {@link engine.conversion.BuildModelConverterFor}.
+ * {@link engine.conversion.buildModelConverter}.
  *
  *
  * If you need more complex converters, see {@link engine.conversion.ModelConversionDispatcher},
  * If you need more complex converters, see {@link engine.conversion.ModelConversionDispatcher},
  * {@link engine.conversion.modelToView}, {@link engine.conversion.ModelConsumable}, {@link engine.conversion.Mapper}.
  * {@link engine.conversion.modelToView}, {@link engine.conversion.ModelConsumable}, {@link engine.conversion.Mapper}.
@@ -30,21 +30,21 @@ import ViewContainerElement from '../view/containerelement.js';
  * 1. Model element to view element converter. This is a converter that takes the model element and represents it
  * 1. Model element to view element converter. This is a converter that takes the model element and represents it
  * in the view.
  * in the view.
  *
  *
- *		BuildModelConverterFor( dispatcher ).fromElement( 'paragraph' ).toElement( 'p' );
- *		BuildModelConverterFor( dispatcher ).fromElement( 'image' ).toElement( 'img' );
+ *		buildModelConverter().for( dispatcher ).fromElement( 'paragraph' ).toElement( 'p' );
+ *		buildModelConverter().for( dispatcher ).fromElement( 'image' ).toElement( 'img' );
  *
  *
  * 2. Model attribute to view attribute converter. This is a converter that operates on model element attributes
  * 2. Model attribute to view attribute converter. This is a converter that operates on model element attributes
  * and converts them to view element attributes. It is suitable for elements like `image` (`src`, `title` attributes).
  * and converts them to view element attributes. It is suitable for elements like `image` (`src`, `title` attributes).
  *
  *
- *		BuildModelConverterFor( dispatcher ).fromElement( 'image' ).toElement( 'img' );
- *		BuildModelConverterFor( dispatcher ).fromAttribute( 'src' ).toAttribute();
+ *		buildModelConverter().for( dispatcher ).fromElement( 'image' ).toElement( 'img' );
+ *		buildModelConverter().for( dispatcher ).fromAttribute( 'src' ).toAttribute();
  *
  *
  * 3. Model attribute to view element converter. This is a converter that takes model attributes and represents them
  * 3. Model attribute to view element converter. This is a converter that takes model attributes and represents them
  * as view elements. Elements created by this kind of converter are wrapping other view elements. Wrapped view nodes
  * as view elements. Elements created by this kind of converter are wrapping other view elements. Wrapped view nodes
  * correspond to model nodes had converter attribute. It is suitable for attributes like `bold`, where `bold` attribute
  * correspond to model nodes had converter attribute. It is suitable for attributes like `bold`, where `bold` attribute
  * set on model text nodes is converter to `strong` view element.
  * set on model text nodes is converter to `strong` view element.
  *
  *
- *		BuildModelConverterFor( dispatcher ).fromAttribute( 'bold' ).toElement( 'strong' );
+ *		buildModelConverter().for( dispatcher ).fromAttribute( 'bold' ).toElement( 'strong' );
  *
  *
  * It is possible to provide various different parameters for {@link engine.conversion.ModelConverterBuilder#toElement}
  * It is possible to provide various different parameters for {@link engine.conversion.ModelConverterBuilder#toElement}
  * and {@link engine.conversion.ModelConverterBuilder#toAttribute} methods. See their descriptions to learn more.
  * and {@link engine.conversion.ModelConverterBuilder#toAttribute} methods. See their descriptions to learn more.
@@ -64,18 +64,15 @@ import ViewContainerElement from '../view/containerelement.js';
 class ModelConverterBuilder {
 class ModelConverterBuilder {
 	/**
 	/**
 	 * Creates `ModelConverterBuilder` with given `dispatchers` registered to it.
 	 * Creates `ModelConverterBuilder` with given `dispatchers` registered to it.
-	 *
-	 * @param {Array.<engine.conversion.ModelConversionDispatcher>} dispatchers Dispatchers to which converters will
-	 * be attached.
 	 */
 	 */
-	constructor( dispatchers ) {
+	constructor() {
 		/**
 		/**
 		 * Dispatchers to which converters will be attached.
 		 * Dispatchers to which converters will be attached.
 		 *
 		 *
 		 * @type {Array.<engine.conversion.ModelConversionDispatcher>}
 		 * @type {Array.<engine.conversion.ModelConversionDispatcher>}
 		 * @private
 		 * @private
 		 */
 		 */
-		this._dispatchers = dispatchers;
+		this._dispatchers = [];
 
 
 		/**
 		/**
 		 * Contains data about registered "from" query.
 		 * Contains data about registered "from" query.
@@ -86,6 +83,18 @@ class ModelConverterBuilder {
 		this._from = null;
 		this._from = null;
 	}
 	}
 
 
+	/**
+	 * Set one or more dispatchers which the built converter will be attached to.
+	 *
+	 * @chainable
+	 * @param {...engine.conversion.ModelConversionDispatcher} dispatchers One or more dispatchers.
+	 */
+	for( ...dispatchers ) {
+		this._dispatchers = dispatchers;
+
+		return this;
+	}
+
 	/**
 	/**
 	 * Registers what model element should be converted.
 	 * Registers what model element should be converted.
 	 *
 	 *
@@ -130,8 +139,8 @@ class ModelConverterBuilder {
 	 * prevent node merging, i.e.: `<span class="bold"><span class="theme">foo</span><span>` vs `<span class="bold theme">foo</span>`.
 	 * prevent node merging, i.e.: `<span class="bold"><span class="theme">foo</span><span>` vs `<span class="bold theme">foo</span>`.
 	 * If you want to prevent merging, just set different priority for both converters.
 	 * If you want to prevent merging, just set different priority for both converters.
 	 *
 	 *
-	 *		BuildModelConverterFor( dispatcher ).fromAttribute( 'bold' ).withPriority( 2 ).toElement( 'strong' );
-	 *		BuildModelConverterFor( dispatcher ).fromAttribute( 'italic' ).withPriority( 3 ).toElement( 'em' );
+	 *		buildModelConverter().for( dispatcher ).fromAttribute( 'bold' ).withPriority( 2 ).toElement( 'strong' );
+	 *		buildModelConverter().for( dispatcher ).fromAttribute( 'italic' ).withPriority( 3 ).toElement( 'em' );
 	 *
 	 *
 	 * @chainable
 	 * @chainable
 	 * @param {Number} priority Converter priority.
 	 * @param {Number} priority Converter priority.
@@ -152,15 +161,15 @@ class ModelConverterBuilder {
 	 * proper type of view element: {@link engine.view.ViewContainerElement ViewContainerElement} if you convert
 	 * proper type of view element: {@link engine.view.ViewContainerElement ViewContainerElement} if you convert
 	 * from element or {@link engine.view.ViewAttributeElement ViewAttributeElement} if you convert from attribute.
 	 * from element or {@link engine.view.ViewAttributeElement ViewAttributeElement} if you convert from attribute.
 	 *
 	 *
-	 *		BuildModelConverterFor( dispatcher ).fromElement( 'paragraph' ).toElement( 'p' );
+	 *		buildModelConverter().for( dispatcher ).fromElement( 'paragraph' ).toElement( 'p' );
 	 *
 	 *
-	 *		BuildModelConverterFor( dispatcher ).fromElement( 'image' ).toElement( new ViewContainerElement( 'img' ) );
+	 *		buildModelConverter().for( dispatcher ).fromElement( 'image' ).toElement( new ViewContainerElement( 'img' ) );
 	 *
 	 *
-	 *		BuildModelConverterFor( dispatcher )
+	 *		buildModelConverter().for( dispatcher )
 	 *			.fromElement( 'header' )
 	 *			.fromElement( 'header' )
 	 *			.toElement( ( data ) => new ViewContainerElement( 'h' + data.item.getAttribute( 'level' ) ) );
 	 *			.toElement( ( data ) => new ViewContainerElement( 'h' + data.item.getAttribute( 'level' ) ) );
 	 *
 	 *
-	 *		BuildModelConverterFor( dispatcher ).fromAttribute( 'bold' ).toElement( new ViewAttributeElement( 'strong' ) );
+	 *		buildModelConverter().for( dispatcher ).fromAttribute( 'bold' ).toElement( new ViewAttributeElement( 'strong' ) );
 	 *
 	 *
 	 * Creator function will be passed different values depending whether conversion is from element or from attribute:
 	 * Creator function will be passed different values depending whether conversion is from element or from attribute:
 	 *
 	 *
@@ -210,13 +219,13 @@ class ModelConverterBuilder {
 	 * This function will be passed model attribute value and model attribute key as first two parameters and then
 	 * This function will be passed model attribute value and model attribute key as first two parameters and then
 	 * all dispatcher's {engine.conversion.ModelConversionDispatcher#event:changeAttribute changeAttribute event} parameters.
 	 * all dispatcher's {engine.conversion.ModelConversionDispatcher#event:changeAttribute changeAttribute event} parameters.
 	 *
 	 *
-	 *		BuildModelConverterFor( dispatcher ).fromAttribute( 'class' ).toAttribute( '' );
+	 *		buildModelConverter().for( dispatcher ).fromAttribute( 'class' ).toAttribute( '' );
 	 *
 	 *
-	 *		BuildModelConverterFor( dispatcher ).fromAttribute( 'linkTitle' ).toAttribute( 'title' );
+	 *		buildModelConverter().for( dispatcher ).fromAttribute( 'linkTitle' ).toAttribute( 'title' );
 	 *
 	 *
-	 *		BuildModelConverterFor( dispatcher ).fromAttribute( 'highlighted' ).toAttribute( 'style', 'background:yellow' );
+	 *		buildModelConverter().for( dispatcher ).fromAttribute( 'highlighted' ).toAttribute( 'style', 'background:yellow' );
 	 *
 	 *
-	 *		BuildModelConverterFor( dispatcher )
+	 *		buildModelConverter().for( dispatcher )
 	 *			.fromAttribute( 'theme' )
 	 *			.fromAttribute( 'theme' )
 	 *			.toAttribute( ( value ) => ( { key: 'class', value: value + '-theme' } ) );
 	 *			.toAttribute( ( value ) => ( { key: 'class', value: value + '-theme' } ) );
 	 *
 	 *
@@ -270,11 +279,9 @@ class ModelConverterBuilder {
  * model-to-view converters and attach them to provided dispatchers. The method returns an instance of
  * model-to-view converters and attach them to provided dispatchers. The method returns an instance of
  * {@link engine.conversion.ModelConverterBuilder}.
  * {@link engine.conversion.ModelConverterBuilder}.
  *
  *
- * @external engine.conversion.BuildModelConverterFor
+ * @external engine.conversion.buildModelConverter
  * @memberOf engine.conversion
  * @memberOf engine.conversion
- * @param {...engine.conversion.ModelConversionDispatcher} dispatchers One or more dispatchers which
- * the built converter will be attached to.
  */
  */
-export default function BuildModelConverterFor( ...dispatchers ) {
-	return new ModelConverterBuilder( dispatchers );
+export default function buildModelConverter() {
+	return new ModelConverterBuilder();
 }
 }

+ 37 - 30
packages/ckeditor5-engine/src/conversion/view-converter-builder.js → packages/ckeditor5-engine/src/conversion/buildviewconverter.js

@@ -15,7 +15,7 @@ import isIterable from '../../utils/isiterable.js';
  * HTML content to the editor. Then, converters are used to translate this structure, possibly removing unknown/incorrect
  * HTML content to the editor. Then, converters are used to translate this structure, possibly removing unknown/incorrect
  * nodes, and add it to the model. Also multiple, different elements might be translated into the same thing in the
  * nodes, and add it to the model. Also multiple, different elements might be translated into the same thing in the
  * model, i.e. `<b>` and `<strong>` elements might be converted to `bold` attribute (even though `bold` attribute will
  * model, i.e. `<b>` and `<strong>` elements might be converted to `bold` attribute (even though `bold` attribute will
- * be then converted only to `<strong>` tag). Instances of this class are created by {@link engine.conversion.BuildViewConverterFor}.
+ * be then converted only to `<strong>` tag). Instances of this class are created by {@link engine.conversion.buildViewConverter}.
  *
  *
  * If you need more complex converters, see {@link engine.conversion.ViewConversionDispatcher},
  * If you need more complex converters, see {@link engine.conversion.ViewConversionDispatcher},
  * {@link engine.conversion.viewToModel}, {@link engine.conversion.ViewConsumable}.
  * {@link engine.conversion.viewToModel}, {@link engine.conversion.ViewConsumable}.
@@ -24,22 +24,22 @@ import isIterable from '../../utils/isiterable.js';
  *
  *
  * 1. View element to model element:
  * 1. View element to model element:
  *
  *
- *		BuildViewConverterFor( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
+ *		buildViewConverter().for( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
  *
  *
  * 2. View element to model attribute:
  * 2. View element to model attribute:
  *
  *
- *		BuildViewConverterFor( dispatcher ).fromElement( 'b' ).fromElement( 'strong' ).toAttribute( 'bold', 'true' );
+ *		buildViewConverter().for( dispatcher ).fromElement( 'b' ).fromElement( 'strong' ).toAttribute( 'bold', 'true' );
  *
  *
  * 3. View attribute to model attribute:
  * 3. View attribute to model attribute:
  *
  *
- *		BuildViewConverterFor( dispatcher ).fromAttribute( 'style', { 'font-weight': 'bold' } ).toAttribute( 'bold', 'true' );
- *		BuildViewConverterFor( dispatcher )
+ *		buildViewConverter().for( dispatcher ).fromAttribute( 'style', { 'font-weight': 'bold' } ).toAttribute( 'bold', 'true' );
+ *		buildViewConverter().for( dispatcher )
  *			.fromAttribute( 'class' )
  *			.fromAttribute( 'class' )
  *			.toAttribute( ( viewElement ) => ( { class: viewElement.getAttribute( 'class' ) } ) );
  *			.toAttribute( ( viewElement ) => ( { class: viewElement.getAttribute( 'class' ) } ) );
  *
  *
  * 4. View elements and attributes to model attribute:
  * 4. View elements and attributes to model attribute:
  *
  *
- *		BuildViewConverterFor( dispatcher )
+ *		buildViewConverter().for( dispatcher )
  *			.fromElement( 'b' ).fromElement( 'strong' ).fromAttribute( 'style', { 'font-weight': 'bold' } )
  *			.fromElement( 'b' ).fromElement( 'strong' ).fromAttribute( 'style', { 'font-weight': 'bold' } )
  *			.toAttribute( 'bold', 'true' );
  *			.toAttribute( 'bold', 'true' );
  *
  *
@@ -48,9 +48,9 @@ import isIterable from '../../utils/isiterable.js';
  *
  *
  *		const matcher = new ViewMatcher();
  *		const matcher = new ViewMatcher();
  *		matcher.add( 'div', { class: 'quote' } );
  *		matcher.add( 'div', { class: 'quote' } );
- *		BuildViewConverterFor( dispatcher ).from( matcher ).toElement( 'quote' );
+ *		buildViewConverter().for( dispatcher ).from( matcher ).toElement( 'quote' );
  *
  *
- *		BuildViewConverterFor( dispatcher ).from( { name: 'span', class: 'bold' } ).toAttribute( 'bold', 'true' );
+ *		buildViewConverter().for( dispatcher ).from( { name: 'span', class: 'bold' } ).toAttribute( 'bold', 'true' );
  *
  *
  * Note, that converters built using `ViewConverterBuilder` automatically check {@link engine.model.Schema schema}
  * Note, that converters built using `ViewConverterBuilder` automatically check {@link engine.model.Schema schema}
  * if created model structure is valid. If given conversion would be invalid according to schema, it is ignored.
  * if created model structure is valid. If given conversion would be invalid according to schema, it is ignored.
@@ -80,18 +80,15 @@ import isIterable from '../../utils/isiterable.js';
 class ViewConverterBuilder {
 class ViewConverterBuilder {
 	/**
 	/**
 	 * Creates `ViewConverterBuilder` with given `dispatchers` registered to it.
 	 * Creates `ViewConverterBuilder` with given `dispatchers` registered to it.
-	 *
-	 * @param {Array.<engine.conversion.ViewConversionDispatcher>} dispatchers Dispatchers to which converters will
-	 * be attached.
 	 */
 	 */
-	constructor( dispatchers ) {
+	constructor() {
 		/**
 		/**
 		 * Dispatchers to which converters will be attached.
 		 * Dispatchers to which converters will be attached.
 		 *
 		 *
 		 * @type {Array.<engine.conversion.ViewConversionDispatcher>}
 		 * @type {Array.<engine.conversion.ViewConversionDispatcher>}
 		 * @private
 		 * @private
 		 */
 		 */
-		this._dispatchers = dispatchers;
+		this._dispatchers = [];
 
 
 		/**
 		/**
 		 * Stores "from" queries.
 		 * Stores "from" queries.
@@ -102,10 +99,22 @@ class ViewConverterBuilder {
 		this._from = [];
 		this._from = [];
 	}
 	}
 
 
+	/**
+	 * Set one or more dispatchers which the built converter will be attached to.
+	 *
+	 * @chainable
+	 * @param {...engine.conversion.ViewConversionDispatcher} dispatchers One or more dispatchers.
+	 */
+	for( ...dispatchers ) {
+		this._dispatchers = dispatchers;
+
+		return this;
+	}
+
 	/**
 	/**
 	 * Registers what view element should be converted.
 	 * Registers what view element should be converted.
 	 *
 	 *
-	 *		BuildViewConverterFor( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
+	 *		buildViewConverter().for( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
 	 *
 	 *
 	 * @chainable
 	 * @chainable
 	 * @param {String} elementName View element name.
 	 * @param {String} elementName View element name.
@@ -118,7 +127,7 @@ class ViewConverterBuilder {
 	/**
 	/**
 	 * Registers what view attribute should be converted.
 	 * Registers what view attribute should be converted.
 	 *
 	 *
-	 *		BuildViewConverterFor( dispatcher ).fromAttribute( 'style', { 'font-weight': 'bold' } ).toAttribute( 'bold', 'true' );
+	 *		buildViewConverter().for( dispatcher ).fromAttribute( 'style', { 'font-weight': 'bold' } ).toAttribute( 'bold', 'true' );
 	 *
 	 *
 	 * @chainable
 	 * @chainable
 	 * @param {String|RegExp} key View attribute key.
 	 * @param {String|RegExp} key View attribute key.
@@ -138,9 +147,9 @@ class ViewConverterBuilder {
 	 *
 	 *
 	 *		const matcher = new ViewMatcher();
 	 *		const matcher = new ViewMatcher();
 	 *		matcher.add( 'div', { class: 'quote' } );
 	 *		matcher.add( 'div', { class: 'quote' } );
-	 *		BuildViewConverterFor( dispatcher ).from( matcher ).toElement( 'quote' );
+	 *		buildViewConverter().for( dispatcher ).from( matcher ).toElement( 'quote' );
 	 *
 	 *
-	 *		BuildViewConverterFor( dispatcher ).from( { name: 'span', class: 'bold' } ).toAttribute( 'bold', 'true' );
+	 *		buildViewConverter().for( dispatcher ).from( { name: 'span', class: 'bold' } ).toAttribute( 'bold', 'true' );
 	 *
 	 *
 	 * @chainable
 	 * @chainable
 	 * @param {Object|engine.view.Matcher} matcher View matcher or view matcher pattern.
 	 * @param {Object|engine.view.Matcher} matcher View matcher or view matcher pattern.
@@ -169,11 +178,11 @@ class ViewConverterBuilder {
 	 *		// conversion will have to be done in separate converter.
 	 *		// conversion will have to be done in separate converter.
 	 *		// Without consuming modifier, the converter would consume both class and name, so a converter for
 	 *		// Without consuming modifier, the converter would consume both class and name, so a converter for
 	 *		// span element would not be fired.
 	 *		// span element would not be fired.
-	 *		BuildViewConverterFor( dispatcher )
+	 *		buildViewConverter().for( dispatcher )
 	 *			.from( { name: 'span', class: 'bold' } ).consuming( { class: 'bold' } )
 	 *			.from( { name: 'span', class: 'bold' } ).consuming( { class: 'bold' } )
 	 *			.toAttribute( 'bold', 'true' } );
 	 *			.toAttribute( 'bold', 'true' } );
 	 *
 	 *
-	 *		BuildViewConverterFor( dispatcher )
+	 *		buildViewConverter().for( dispatcher )
 	 *			.fromElement( 'img' ).consuming( { name: true, attributes: [ 'src', 'title' ] } )
 	 *			.fromElement( 'img' ).consuming( { name: true, attributes: [ 'src', 'title' ] } )
 	 *			.toElement( ( viewElement ) => new ModelElement( 'image', { src: viewElement.getAttribute( 'src' ),
 	 *			.toElement( ( viewElement ) => new ModelElement( 'image', { src: viewElement.getAttribute( 'src' ),
 	 *																		title: viewElement.getAttribute( 'title' ) } );
 	 *																		title: viewElement.getAttribute( 'title' ) } );
@@ -199,10 +208,10 @@ class ViewConverterBuilder {
 	 * Changes default priority for built converter. It modifies the last `from...` query. Can be used after each
 	 * Changes default priority for built converter. It modifies the last `from...` query. Can be used after each
 	 * `from...` query in given chain. Useful for overwriting converters. The lower the number, the earlier converter will be fired.
 	 * `from...` query in given chain. Useful for overwriting converters. The lower the number, the earlier converter will be fired.
 	 *
 	 *
-	 *		BuildViewConverterFor( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
+	 *		buildViewConverter().for( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
 	 *		// Register converter with proper priority, otherwise "p" element would get consumed by first
 	 *		// Register converter with proper priority, otherwise "p" element would get consumed by first
 	 *		// converter and the second converter would not be fired.
 	 *		// converter and the second converter would not be fired.
-	 *		BuildViewConverterFor( dispatcher )
+	 *		buildViewConverter().for( dispatcher )
 	 *			.from( { name: 'p', class: 'custom' } ).withPriority( 9 )
 	 *			.from( { name: 'p', class: 'custom' } ).withPriority( 9 )
 	 *			.toElement( 'customParagraph' );
 	 *			.toElement( 'customParagraph' );
 	 *
 	 *
@@ -230,8 +239,8 @@ class ViewConverterBuilder {
 	 * name as a `string` or a function that will return model element instance. If you provide creator function,
 	 * name as a `string` or a function that will return model element instance. If you provide creator function,
 	 * it will be passed converted view element as first and only parameter.
 	 * it will be passed converted view element as first and only parameter.
 	 *
 	 *
-	 *		BuildViewConverterFor( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
-	 *		BuildViewConverterFor( dispatcher )
+	 *		buildViewConverter().for( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
+	 *		buildViewConverter().for( dispatcher )
 	 *			.fromElement( 'img' )
 	 *			.fromElement( 'img' )
 	 *			.toElement( ( viewElement ) => new ModelElement( 'image', { src: viewElement.getAttribute( 'src' ) } );
 	 *			.toElement( ( viewElement ) => new ModelElement( 'image', { src: viewElement.getAttribute( 'src' ) } );
 	 *
 	 *
@@ -297,8 +306,8 @@ class ViewConverterBuilder {
 	 * representing attribute key and attribute value or a function that returns an object with `key` and `value` properties.
 	 * representing attribute key and attribute value or a function that returns an object with `key` and `value` properties.
 	 * If you provide creator function, it will be passed converted view element as first and only parameter.
 	 * If you provide creator function, it will be passed converted view element as first and only parameter.
 	 *
 	 *
-	 *		BuildViewConverterFor( dispatcher ).fromAttribute( 'style', { 'font-weight': 'bold' } ).toAttribute( 'bold', 'true' );
-	 *		BuildViewConverterFor( dispatcher )
+	 *		buildViewConverter().for( dispatcher ).fromAttribute( 'style', { 'font-weight': 'bold' } ).toAttribute( 'bold', 'true' );
+	 *		buildViewConverter().for( dispatcher )
 	 *			.fromAttribute( 'class' )
 	 *			.fromAttribute( 'class' )
 	 *			.toAttribute( ( viewElement ) => ( { key: 'class', value: viewElement.getAttribute( 'class' ) } ) );
 	 *			.toAttribute( ( viewElement ) => ( { key: 'class', value: viewElement.getAttribute( 'class' ) } ) );
 	 *
 	 *
@@ -400,11 +409,9 @@ function setAttributeOn( toChange, attribute, data, conversionApi ) {
  * view-to-model converters and attach them to provided dispatchers. The method returns an instance of
  * view-to-model converters and attach them to provided dispatchers. The method returns an instance of
  * {@link engine.conversion.ViewConverterBuilder}.
  * {@link engine.conversion.ViewConverterBuilder}.
  *
  *
- * @external engine.conversion.BuildViewConverterFor
+ * @external engine.conversion.buildViewConverter
  * @memberOf engine.conversion
  * @memberOf engine.conversion
- * @param {...engine.conversion.ViewConversionDispatcher} dispatchers One or more dispatchers to which
- * the built converter will be attached.
  */
  */
-export default function BuildViewConverterFor( ...dispatchers ) {
-	return new ViewConverterBuilder( dispatchers );
+export default function buildViewConverter() {
+	return new ViewConverterBuilder();
 }
 }

+ 2 - 2
packages/ckeditor5-engine/src/datacontroller.js

@@ -70,7 +70,7 @@ export default class DataController {
 		 *
 		 *
 		 * Or use {@link engine.conversion.ModelConverterBuilder}:
 		 * Or use {@link engine.conversion.ModelConverterBuilder}:
 		 *
 		 *
-		 *		BuildModelConverterFor( data.modelToView ).fromAttribute( 'bold' ).toElement( 'b' );
+		 *		buildModelConverter().for( data.modelToView ).fromAttribute( 'bold' ).toElement( 'b' );
 		 *
 		 *
 		 * @readonly
 		 * @readonly
 		 * @member {engine.conversion.ModelConversionDispatcher} engine.DataController#modelToView
 		 * @member {engine.conversion.ModelConversionDispatcher} engine.DataController#modelToView
@@ -88,7 +88,7 @@ export default class DataController {
 		 *
 		 *
 		 * Or use {@link engine.conversion.ViewConverterBuilder}:
 		 * Or use {@link engine.conversion.ViewConverterBuilder}:
 		 *
 		 *
-		 *		BuildViewConverterFor( data.viewToModel ).fromElement( 'b' ).toAttribute( 'bold', 'true' );
+		 *		buildViewConverter().for( data.viewToModel ).fromElement( 'b' ).toAttribute( 'bold', 'true' );
 		 *
 		 *
 		 * @readonly
 		 * @readonly
 		 * @member {engine.conversion.ViewConversionDispatcher} engine.DataController#viewToModel
 		 * @member {engine.conversion.ViewConversionDispatcher} engine.DataController#viewToModel

+ 1 - 1
packages/ckeditor5-engine/src/editingcontroller.js

@@ -64,7 +64,7 @@ export default class EditingController {
 		 *
 		 *
 		 * Or use {@link engine.conversion.ModelConverterBuilder}:
 		 * Or use {@link engine.conversion.ModelConverterBuilder}:
 		 *
 		 *
-		 *		BuildModelConverterFor( editing.modelToView ).fromAttribute( 'bold' ).toElement( 'b' );
+		 *		buildModelConverter().for( editing.modelToView ).fromAttribute( 'bold' ).toElement( 'b' );
 		 *
 		 *
 		 * @readonly
 		 * @readonly
 		 * @member {engine.conversion.ModelConversionDispatcher} engine.EditingController#modelToView
 		 * @member {engine.conversion.ModelConversionDispatcher} engine.EditingController#modelToView

+ 19 - 19
packages/ckeditor5-engine/tests/conversion/model-converter-builder.js → packages/ckeditor5-engine/tests/conversion/buildmodelconverter.js

@@ -5,7 +5,7 @@
 
 
 /* bender-tags: conversion */
 /* bender-tags: conversion */
 
 
-import BuildModelConverterFor from '/ckeditor5/engine/conversion/model-converter-builder.js';
+import buildModelConverter from '/ckeditor5/engine/conversion/buildmodelconverter.js';
 
 
 import ModelDocument from '/ckeditor5/engine/model/document.js';
 import ModelDocument from '/ckeditor5/engine/model/document.js';
 import ModelElement from '/ckeditor5/engine/model/element.js';
 import ModelElement from '/ckeditor5/engine/model/element.js';
@@ -92,7 +92,7 @@ describe( 'Model converter builder', () => {
 
 
 	describe( 'model element to view element conversion', () => {
 	describe( 'model element to view element conversion', () => {
 		it( 'using passed view element name', () => {
 		it( 'using passed view element name', () => {
-			BuildModelConverterFor( dispatcher ).fromElement( 'paragraph' ).toElement( 'p' );
+			buildModelConverter().for( dispatcher ).fromElement( 'paragraph' ).toElement( 'p' );
 
 
 			let modelElement = new ModelElement( 'paragraph', null, new ModelText( 'foobar' ) );
 			let modelElement = new ModelElement( 'paragraph', null, new ModelText( 'foobar' ) );
 			modelRoot.appendChildren( modelElement );
 			modelRoot.appendChildren( modelElement );
@@ -103,7 +103,7 @@ describe( 'Model converter builder', () => {
 		} );
 		} );
 
 
 		it( 'using passed view element', () => {
 		it( 'using passed view element', () => {
-			BuildModelConverterFor( dispatcher ).fromElement( 'image' ).toElement( new ViewContainerElement( 'img' ) );
+			buildModelConverter().for( dispatcher ).fromElement( 'image' ).toElement( new ViewContainerElement( 'img' ) );
 
 
 			let modelElement = new ModelElement( 'image' );
 			let modelElement = new ModelElement( 'image' );
 			modelRoot.appendChildren( modelElement );
 			modelRoot.appendChildren( modelElement );
@@ -114,7 +114,7 @@ describe( 'Model converter builder', () => {
 		} );
 		} );
 
 
 		it( 'using passed creator function', () => {
 		it( 'using passed creator function', () => {
-			BuildModelConverterFor( dispatcher )
+			buildModelConverter().for( dispatcher )
 				.fromElement( 'header' )
 				.fromElement( 'header' )
 				.toElement( ( data ) => new ViewContainerElement( 'h' + data.item.getAttribute( 'level' ) ) );
 				.toElement( ( data ) => new ViewContainerElement( 'h' + data.item.getAttribute( 'level' ) ) );
 
 
@@ -129,11 +129,11 @@ describe( 'Model converter builder', () => {
 
 
 	describe( 'model attribute to view element conversion', () => {
 	describe( 'model attribute to view element conversion', () => {
 		beforeEach( () => {
 		beforeEach( () => {
-			BuildModelConverterFor( dispatcher ).fromElement( 'paragraph' ).toElement( 'p' );
+			buildModelConverter().for( dispatcher ).fromElement( 'paragraph' ).toElement( 'p' );
 		} );
 		} );
 
 
 		it( 'using passed view element name', () => {
 		it( 'using passed view element name', () => {
-			BuildModelConverterFor( dispatcher ).fromAttribute( 'bold' ).toElement( 'strong' );
+			buildModelConverter().for( dispatcher ).fromAttribute( 'bold' ).toElement( 'strong' );
 
 
 			let modelElement = new ModelText( 'foo', { bold: true } );
 			let modelElement = new ModelText( 'foo', { bold: true } );
 			modelRoot.appendChildren( modelElement );
 			modelRoot.appendChildren( modelElement );
@@ -150,7 +150,7 @@ describe( 'Model converter builder', () => {
 		} );
 		} );
 
 
 		it( 'using passed view element', () => {
 		it( 'using passed view element', () => {
-			BuildModelConverterFor( dispatcher ).fromAttribute( 'bold' ).toElement( new ViewAttributeElement( 'strong' ) );
+			buildModelConverter().for( dispatcher ).fromAttribute( 'bold' ).toElement( new ViewAttributeElement( 'strong' ) );
 
 
 			let modelElement = new ModelText( 'foo', { bold: true } );
 			let modelElement = new ModelText( 'foo', { bold: true } );
 			modelRoot.appendChildren( modelElement );
 			modelRoot.appendChildren( modelElement );
@@ -167,7 +167,7 @@ describe( 'Model converter builder', () => {
 		} );
 		} );
 
 
 		it( 'using passed creator function', () => {
 		it( 'using passed creator function', () => {
-			BuildModelConverterFor( dispatcher ).fromAttribute( 'italic' ).toElement( ( value ) => new ViewAttributeElement( value ) );
+			buildModelConverter().for( dispatcher ).fromAttribute( 'italic' ).toElement( ( value ) => new ViewAttributeElement( value ) );
 
 
 			let modelElement = new ModelText( 'foo', { italic: 'em' } );
 			let modelElement = new ModelText( 'foo', { italic: 'em' } );
 			modelRoot.appendChildren( modelElement );
 			modelRoot.appendChildren( modelElement );
@@ -195,7 +195,7 @@ describe( 'Model converter builder', () => {
 			dispatcher.on( 'selection', convertCollapsedSelection() );
 			dispatcher.on( 'selection', convertCollapsedSelection() );
 
 
 			// Model converter builder should add selection converter.
 			// Model converter builder should add selection converter.
-			BuildModelConverterFor( dispatcher ).fromAttribute( 'italic' ).toElement( ( value ) => new ViewAttributeElement( value ) );
+			buildModelConverter().for( dispatcher ).fromAttribute( 'italic' ).toElement( ( value ) => new ViewAttributeElement( value ) );
 
 
 			modelRoot.appendChildren( new ModelText( 'foo', { italic: 'em' } ) );
 			modelRoot.appendChildren( new ModelText( 'foo', { italic: 'em' } ) );
 
 
@@ -255,11 +255,11 @@ describe( 'Model converter builder', () => {
 
 
 	describe( 'model attribute to view attribute conversion', () => {
 	describe( 'model attribute to view attribute conversion', () => {
 		beforeEach( () => {
 		beforeEach( () => {
-			BuildModelConverterFor( dispatcher ).fromElement( 'paragraph' ).toElement( 'p' );
+			buildModelConverter().for( dispatcher ).fromElement( 'paragraph' ).toElement( 'p' );
 		} );
 		} );
 
 
 		it( 'using default 1-to-1 conversion', () => {
 		it( 'using default 1-to-1 conversion', () => {
-			BuildModelConverterFor( dispatcher ).fromAttribute( 'class' ).toAttribute();
+			buildModelConverter().for( dispatcher ).fromAttribute( 'class' ).toAttribute();
 
 
 			let modelElement = new ModelElement( 'paragraph', { class: 'myClass' }, new ModelText( 'foobar' ) );
 			let modelElement = new ModelElement( 'paragraph', { class: 'myClass' }, new ModelText( 'foobar' ) );
 			modelRoot.appendChildren( modelElement );
 			modelRoot.appendChildren( modelElement );
@@ -280,7 +280,7 @@ describe( 'Model converter builder', () => {
 		} );
 		} );
 
 
 		it( 'using passed attribute key', () => {
 		it( 'using passed attribute key', () => {
-			BuildModelConverterFor( dispatcher ).fromAttribute( 'theme' ).toAttribute( 'class' );
+			buildModelConverter().for( dispatcher ).fromAttribute( 'theme' ).toAttribute( 'class' );
 
 
 			let modelElement = new ModelElement( 'paragraph', { theme: 'abc' }, new ModelText( 'foobar' ) );
 			let modelElement = new ModelElement( 'paragraph', { theme: 'abc' }, new ModelText( 'foobar' ) );
 			modelRoot.appendChildren( modelElement );
 			modelRoot.appendChildren( modelElement );
@@ -301,7 +301,7 @@ describe( 'Model converter builder', () => {
 		} );
 		} );
 
 
 		it( 'using passed attribute key and value', () => {
 		it( 'using passed attribute key and value', () => {
-			BuildModelConverterFor( dispatcher ).fromAttribute( 'highlighted' ).toAttribute( 'style', 'background:yellow' );
+			buildModelConverter().for( dispatcher ).fromAttribute( 'highlighted' ).toAttribute( 'style', 'background:yellow' );
 
 
 			let modelElement = new ModelElement( 'paragraph', { 'highlighted': true }, new ModelText( 'foobar' ) );
 			let modelElement = new ModelElement( 'paragraph', { 'highlighted': true }, new ModelText( 'foobar' ) );
 			modelRoot.appendChildren( modelElement );
 			modelRoot.appendChildren( modelElement );
@@ -317,7 +317,7 @@ describe( 'Model converter builder', () => {
 		} );
 		} );
 
 
 		it( 'using passed attribute creator function', () => {
 		it( 'using passed attribute creator function', () => {
-			BuildModelConverterFor( dispatcher )
+			buildModelConverter().for( dispatcher )
 				.fromAttribute( 'theme' )
 				.fromAttribute( 'theme' )
 				.toAttribute( ( value ) => ( { key: 'class', value: value + '-theme' } ) );
 				.toAttribute( ( value ) => ( { key: 'class', value: value + '-theme' } ) );
 
 
@@ -342,8 +342,8 @@ describe( 'Model converter builder', () => {
 
 
 	describe( 'withPriority', () => {
 	describe( 'withPriority', () => {
 		it( 'should change default converters priority', () => {
 		it( 'should change default converters priority', () => {
-			BuildModelConverterFor( dispatcher ).fromElement( 'custom' ).toElement( 'custom' );
-			BuildModelConverterFor( dispatcher ).fromElement( 'custom' ).withPriority( 0 ).toElement( 'other' );
+			buildModelConverter().for( dispatcher ).fromElement( 'custom' ).toElement( 'custom' );
+			buildModelConverter().for( dispatcher ).fromElement( 'custom' ).withPriority( 0 ).toElement( 'other' );
 
 
 			let modelElement = new ModelElement( 'custom', null, new ModelText( 'foobar' ) );
 			let modelElement = new ModelElement( 'custom', null, new ModelText( 'foobar' ) );
 			modelRoot.appendChildren( modelElement );
 			modelRoot.appendChildren( modelElement );
@@ -355,11 +355,11 @@ describe( 'Model converter builder', () => {
 	} );
 	} );
 
 
 	it( 'should do nothing on model element to view attribute conversion', () => {
 	it( 'should do nothing on model element to view attribute conversion', () => {
-		BuildModelConverterFor( dispatcher ).fromElement( 'div' ).toElement( 'div' );
+		buildModelConverter().for( dispatcher ).fromElement( 'div' ).toElement( 'div' );
 		// Should do nothing:
 		// Should do nothing:
-		BuildModelConverterFor( dispatcher ).fromElement( 'paragraph' ).toAttribute( 'paragraph', true );
+		buildModelConverter().for( dispatcher ).fromElement( 'paragraph' ).toAttribute( 'paragraph', true );
 		// If above would do something this one would not be fired:
 		// If above would do something this one would not be fired:
-		BuildModelConverterFor( dispatcher ).fromElement( 'paragraph' ).toElement( 'p' );
+		buildModelConverter().for( dispatcher ).fromElement( 'paragraph' ).toElement( 'p' );
 
 
 		let modelElement = new ModelElement( 'div', null, new ModelElement( 'paragraph', null, new ModelText( 'foobar' ) ) );
 		let modelElement = new ModelElement( 'div', null, new ModelElement( 'paragraph', null, new ModelText( 'foobar' ) ) );
 		modelRoot.appendChildren( modelElement );
 		modelRoot.appendChildren( modelElement );

+ 30 - 30
packages/ckeditor5-engine/tests/conversion/view-converter-builder.js

@@ -5,7 +5,7 @@
 
 
 /* bender-tags: conversion */
 /* bender-tags: conversion */
 
 
-import BuildViewConverterFor from '/ckeditor5/engine/conversion/view-converter-builder.js';
+import buildViewConverter from '/ckeditor5/engine/conversion/buildviewconverter.js';
 
 
 import ModelSchema from '/ckeditor5/engine/model/schema.js';
 import ModelSchema from '/ckeditor5/engine/model/schema.js';
 import ModelDocument from '/ckeditor5/engine/model/document.js';
 import ModelDocument from '/ckeditor5/engine/model/document.js';
@@ -94,7 +94,7 @@ describe( 'View converter builder', () => {
 	} );
 	} );
 
 
 	it( 'should convert from view element to model element', () => {
 	it( 'should convert from view element to model element', () => {
-		BuildViewConverterFor( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
+		buildViewConverter().for( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
 
 
 		const result = dispatcher.convert( new ViewContainerElement( 'p', null, new ViewText( 'foo' ) ), objWithContext );
 		const result = dispatcher.convert( new ViewContainerElement( 'p', null, new ViewText( 'foo' ) ), objWithContext );
 		modelRoot.appendChildren( result );
 		modelRoot.appendChildren( result );
@@ -103,7 +103,7 @@ describe( 'View converter builder', () => {
 	} );
 	} );
 
 
 	it( 'should convert from view element to model element using creator function', () => {
 	it( 'should convert from view element to model element using creator function', () => {
-		BuildViewConverterFor( dispatcher )
+		buildViewConverter().for( dispatcher )
 			.fromElement( 'img' )
 			.fromElement( 'img' )
 			.toElement( ( viewElement ) => new ModelElement( 'image', { src: viewElement.getAttribute( 'src' ) } ) );
 			.toElement( ( viewElement ) => new ModelElement( 'image', { src: viewElement.getAttribute( 'src' ) } ) );
 
 
@@ -114,7 +114,7 @@ describe( 'View converter builder', () => {
 	} );
 	} );
 
 
 	it( 'should convert from view element to model attribute', () => {
 	it( 'should convert from view element to model attribute', () => {
-		BuildViewConverterFor( dispatcher ).fromElement( 'strong' ).toAttribute( 'bold', true );
+		buildViewConverter().for( dispatcher ).fromElement( 'strong' ).toAttribute( 'bold', true );
 
 
 		const result = dispatcher.convert( new ViewAttributeElement( 'strong', null, new ViewText( 'foo' ) ), objWithContext );
 		const result = dispatcher.convert( new ViewAttributeElement( 'strong', null, new ViewText( 'foo' ) ), objWithContext );
 		modelRoot.appendChildren( result );
 		modelRoot.appendChildren( result );
@@ -124,7 +124,7 @@ describe( 'View converter builder', () => {
 	} );
 	} );
 
 
 	it( 'should convert from view element to model attributes using creator function', () => {
 	it( 'should convert from view element to model attributes using creator function', () => {
-		BuildViewConverterFor( dispatcher )
+		buildViewConverter().for( dispatcher )
 			.fromElement( 'a' )
 			.fromElement( 'a' )
 			.toAttribute( ( viewElement ) => ( { key: 'linkHref', value: viewElement.getAttribute( 'href' ) } ) );
 			.toAttribute( ( viewElement ) => ( { key: 'linkHref', value: viewElement.getAttribute( 'href' ) } ) );
 
 
@@ -136,9 +136,9 @@ describe( 'View converter builder', () => {
 	} );
 	} );
 
 
 	it( 'should convert from view attribute to model attribute', () => {
 	it( 'should convert from view attribute to model attribute', () => {
-		BuildViewConverterFor( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
+		buildViewConverter().for( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
 
 
-		BuildViewConverterFor( dispatcher )
+		buildViewConverter().for( dispatcher )
 			.fromAttribute( 'class' )
 			.fromAttribute( 'class' )
 			.toAttribute( ( viewElement ) => ( { key: 'class', value: viewElement.getAttribute( 'class' ) } ) );
 			.toAttribute( ( viewElement ) => ( { key: 'class', value: viewElement.getAttribute( 'class' ) } ) );
 
 
@@ -151,9 +151,9 @@ describe( 'View converter builder', () => {
 	it( 'should convert from view attribute and key to model attribute', () => {
 	it( 'should convert from view attribute and key to model attribute', () => {
 		dispatcher.on( 'documentFragment', convertToModelFragment() );
 		dispatcher.on( 'documentFragment', convertToModelFragment() );
 
 
-		BuildViewConverterFor( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
-		BuildViewConverterFor( dispatcher ).fromAttribute( 'class', 'important' ).toAttribute( 'important', true );
-		BuildViewConverterFor( dispatcher ).fromAttribute( 'class', 'theme-nice' ).toAttribute( 'theme', 'nice' );
+		buildViewConverter().for( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
+		buildViewConverter().for( dispatcher ).fromAttribute( 'class', 'important' ).toAttribute( 'important', true );
+		buildViewConverter().for( dispatcher ).fromAttribute( 'class', 'theme-nice' ).toAttribute( 'theme', 'nice' );
 
 
 		const viewStructure = new ViewDocumentFragment( [
 		const viewStructure = new ViewDocumentFragment( [
 			new ViewContainerElement( 'p', { class: 'important' }, new ViewText( 'foo' ) ),
 			new ViewContainerElement( 'p', { class: 'important' }, new ViewText( 'foo' ) ),
@@ -167,9 +167,9 @@ describe( 'View converter builder', () => {
 	} );
 	} );
 
 
 	it( 'should convert from multiple view entities to model attribute', () => {
 	it( 'should convert from multiple view entities to model attribute', () => {
-		BuildViewConverterFor( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
+		buildViewConverter().for( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
 
 
-		BuildViewConverterFor( dispatcher )
+		buildViewConverter().for( dispatcher )
 			.fromElement( 'strong' )
 			.fromElement( 'strong' )
 			.fromElement( 'b' )
 			.fromElement( 'b' )
 			.fromAttribute( 'class', 'bold' )
 			.fromAttribute( 'class', 'bold' )
@@ -190,13 +190,13 @@ describe( 'View converter builder', () => {
 	} );
 	} );
 
 
 	it( 'should convert from pattern to model element', () => {
 	it( 'should convert from pattern to model element', () => {
-		BuildViewConverterFor( dispatcher ).from(
+		buildViewConverter().for( dispatcher ).from(
 			{ name: 'span', class: 'megatron', attribute: { head: 'megatron', body: 'megatron', legs: 'megatron' } }
 			{ name: 'span', class: 'megatron', attribute: { head: 'megatron', body: 'megatron', legs: 'megatron' } }
 		).toElement( 'MEGATRON' );
 		).toElement( 'MEGATRON' );
 
 
 		// Adding callbacks later so they are called later. MEGATRON callback is more important.
 		// Adding callbacks later so they are called later. MEGATRON callback is more important.
-		BuildViewConverterFor( dispatcher ).fromElement( 'span' ).toElement( 'span' );
-		BuildViewConverterFor( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
+		buildViewConverter().for( dispatcher ).fromElement( 'span' ).toElement( 'span' );
+		buildViewConverter().for( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
 
 
 		let result;
 		let result;
 
 
@@ -242,10 +242,10 @@ describe( 'View converter builder', () => {
 	} );
 	} );
 
 
 	it( 'should convert from pattern to model attribute', () => {
 	it( 'should convert from pattern to model attribute', () => {
-		BuildViewConverterFor( dispatcher ).fromElement( 'span' ).toElement( 'span' );
+		buildViewConverter().for( dispatcher ).fromElement( 'span' ).toElement( 'span' );
 
 
 		// This time without name so default span converter will convert children.
 		// This time without name so default span converter will convert children.
-		BuildViewConverterFor( dispatcher )
+		buildViewConverter().for( dispatcher )
 			.from( { class: 'megatron', attribute: { head: 'megatron', body: 'megatron', legs: 'megatron' } } )
 			.from( { class: 'megatron', attribute: { head: 'megatron', body: 'megatron', legs: 'megatron' } } )
 			.toAttribute( 'transformer', 'megatron' );
 			.toAttribute( 'transformer', 'megatron' );
 
 
@@ -262,10 +262,10 @@ describe( 'View converter builder', () => {
 	} );
 	} );
 
 
 	it( 'should set different priorities for `toElement` and `toAttribute` conversion', () => {
 	it( 'should set different priorities for `toElement` and `toAttribute` conversion', () => {
-		BuildViewConverterFor( dispatcher )
+		buildViewConverter().for( dispatcher )
 			.fromAttribute( 'class' )
 			.fromAttribute( 'class' )
 			.toAttribute( ( viewElement ) => ( { key: 'class', value: viewElement.getAttribute( 'class' ) } ) );
 			.toAttribute( ( viewElement ) => ( { key: 'class', value: viewElement.getAttribute( 'class' ) } ) );
-		BuildViewConverterFor( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
+		buildViewConverter().for( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
 
 
 		let result = dispatcher.convert( new ViewContainerElement( 'p', { class: 'myClass' }, new ViewText( 'foo' ) ), objWithContext );
 		let result = dispatcher.convert( new ViewContainerElement( 'p', { class: 'myClass' }, new ViewText( 'foo' ) ), objWithContext );
 		modelRoot.appendChildren( result );
 		modelRoot.appendChildren( result );
@@ -275,8 +275,8 @@ describe( 'View converter builder', () => {
 	} );
 	} );
 
 
 	it( 'should overwrite default priorities for converters', () => {
 	it( 'should overwrite default priorities for converters', () => {
-		BuildViewConverterFor( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
-		BuildViewConverterFor( dispatcher )
+		buildViewConverter().for( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
+		buildViewConverter().for( dispatcher )
 			.fromAttribute( 'class' )
 			.fromAttribute( 'class' )
 			.toAttribute( ( viewElement ) => ( { key: 'class', value: viewElement.getAttribute( 'class' ) } ) );
 			.toAttribute( ( viewElement ) => ( { key: 'class', value: viewElement.getAttribute( 'class' ) } ) );
 
 
@@ -286,7 +286,7 @@ describe( 'View converter builder', () => {
 		modelRoot.appendChildren( result );
 		modelRoot.appendChildren( result );
 		expect( modelToString( result ) ).to.equal( '<paragraph class="myClass">foo</paragraph>' );
 		expect( modelToString( result ) ).to.equal( '<paragraph class="myClass">foo</paragraph>' );
 
 
-		BuildViewConverterFor( dispatcher )
+		buildViewConverter().for( dispatcher )
 			.from( { name: 'p', class: 'myClass' } ).withPriority( -1 ) // Default for `toElement` is 0.
 			.from( { name: 'p', class: 'myClass' } ).withPriority( -1 ) // Default for `toElement` is 0.
 			.toElement( 'customP' );
 			.toElement( 'customP' );
 
 
@@ -297,15 +297,15 @@ describe( 'View converter builder', () => {
 
 
 	it( 'should overwrite default consumed values', () => {
 	it( 'should overwrite default consumed values', () => {
 		// Converter (1).
 		// Converter (1).
-		BuildViewConverterFor( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
+		buildViewConverter().for( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
 
 
 		// Converter (2).
 		// Converter (2).
-		BuildViewConverterFor( dispatcher )
+		buildViewConverter().for( dispatcher )
 			.from( { name: 'p', class: 'decorated' } ).consuming( { class: 'decorated' } )
 			.from( { name: 'p', class: 'decorated' } ).consuming( { class: 'decorated' } )
 			.toAttribute( 'decorated', true );
 			.toAttribute( 'decorated', true );
 
 
 		// Converter (3).
 		// Converter (3).
-		BuildViewConverterFor( dispatcher )
+		buildViewConverter().for( dispatcher )
 			.fromAttribute( 'class', 'small' ).consuming( { class: 'small' } )
 			.fromAttribute( 'class', 'small' ).consuming( { class: 'small' } )
 			.toAttribute( 'size', 'small' );
 			.toAttribute( 'size', 'small' );
 
 
@@ -322,12 +322,12 @@ describe( 'View converter builder', () => {
 
 
 	it( 'should convert from matcher instance to model', () => {
 	it( 'should convert from matcher instance to model', () => {
 		// Universal class converter, synonymous to .fromAttribute( 'class' ).
 		// Universal class converter, synonymous to .fromAttribute( 'class' ).
-		BuildViewConverterFor( dispatcher )
+		buildViewConverter().for( dispatcher )
 			.from( new ViewMatcher( { class: /.*/ } ) )
 			.from( new ViewMatcher( { class: /.*/ } ) )
 			.toAttribute( ( viewElement ) => ( { key: 'class', value: viewElement.getAttribute( 'class' ) } ) );
 			.toAttribute( ( viewElement ) => ( { key: 'class', value: viewElement.getAttribute( 'class' ) } ) );
 
 
 		// Universal element converter.
 		// Universal element converter.
-		BuildViewConverterFor( dispatcher )
+		buildViewConverter().for( dispatcher )
 			.from( new ViewMatcher( { name: /.*/ } ) )
 			.from( new ViewMatcher( { name: /.*/ } ) )
 			.toElement( ( viewElement ) => new ModelElement( viewElement.name ) );
 			.toElement( ( viewElement ) => new ModelElement( viewElement.name ) );
 
 
@@ -342,9 +342,9 @@ describe( 'View converter builder', () => {
 	} );
 	} );
 
 
 	it( 'should filter out structure that is wrong with schema', () => {
 	it( 'should filter out structure that is wrong with schema', () => {
-		BuildViewConverterFor( dispatcher ).fromElement( 'strong' ).toAttribute( 'bold', true );
-		BuildViewConverterFor( dispatcher ).fromElement( 'div' ).toElement( 'div' );
-		BuildViewConverterFor( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
+		buildViewConverter().for( dispatcher ).fromElement( 'strong' ).toAttribute( 'bold', true );
+		buildViewConverter().for( dispatcher ).fromElement( 'div' ).toElement( 'div' );
+		buildViewConverter().for( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
 
 
 		schema.disallow( { name: '$text', attributes: 'bold', inside: 'paragraph' } );
 		schema.disallow( { name: '$text', attributes: 'bold', inside: 'paragraph' } );
 		schema.disallow( { name: 'div', inside: '$root' } );
 		schema.disallow( { name: 'div', inside: '$root' } );

+ 14 - 14
packages/ckeditor5-engine/tests/datacontroller.js

@@ -9,8 +9,8 @@ import ModelDocument from '/ckeditor5/engine/model/document.js';
 import DataController from '/ckeditor5/engine/datacontroller.js';
 import DataController from '/ckeditor5/engine/datacontroller.js';
 import HtmlDataProcessor from '/ckeditor5/engine/dataprocessor/htmldataprocessor.js';
 import HtmlDataProcessor from '/ckeditor5/engine/dataprocessor/htmldataprocessor.js';
 
 
-import BuildViewConverterFor  from '/ckeditor5/engine/conversion/view-converter-builder.js';
-import BuildModelConverterFor  from '/ckeditor5/engine/conversion/model-converter-builder.js';
+import buildViewConverter  from '/ckeditor5/engine/conversion/buildviewconverter.js';
+import buildModelConverter  from '/ckeditor5/engine/conversion/buildmodelconverter.js';
 
 
 import { getData, setData, stringify } from '/tests/engine/_utils/model.js';
 import { getData, setData, stringify } from '/tests/engine/_utils/model.js';
 
 
@@ -50,7 +50,7 @@ describe( 'DataController', () => {
 		it( 'should set paragraph', () => {
 		it( 'should set paragraph', () => {
 			schema.registerItem( 'paragraph', '$block' );
 			schema.registerItem( 'paragraph', '$block' );
 
 
-			BuildViewConverterFor( data.viewToModel ).fromElement( 'p' ).toElement( 'paragraph' );
+			buildViewConverter().for( data.viewToModel ).fromElement( 'p' ).toElement( 'paragraph' );
 
 
 			const model = data.parse( '<p>foo<b>bar</b></p>' );
 			const model = data.parse( '<p>foo<b>bar</b></p>' );
 
 
@@ -60,7 +60,7 @@ describe( 'DataController', () => {
 		it( 'should set two paragraphs', () => {
 		it( 'should set two paragraphs', () => {
 			schema.registerItem( 'paragraph', '$block' );
 			schema.registerItem( 'paragraph', '$block' );
 
 
-			BuildViewConverterFor( data.viewToModel ).fromElement( 'p' ).toElement( 'paragraph' );
+			buildViewConverter().for( data.viewToModel ).fromElement( 'p' ).toElement( 'paragraph' );
 
 
 			const model = data.parse( '<p>foo</p><p>bar</p>' );
 			const model = data.parse( '<p>foo</p><p>bar</p>' );
 
 
@@ -72,8 +72,8 @@ describe( 'DataController', () => {
 			schema.registerItem( 'paragraph', '$block' );
 			schema.registerItem( 'paragraph', '$block' );
 			schema.allow( { name: '$text', attributes: [ 'bold' ], inside: '$block' } );
 			schema.allow( { name: '$text', attributes: [ 'bold' ], inside: '$block' } );
 
 
-			BuildViewConverterFor( data.viewToModel ).fromElement( 'p' ).toElement( 'paragraph' );
-			BuildViewConverterFor( data.viewToModel ).fromElement( 'b' ).toAttribute( 'bold', true );
+			buildViewConverter().for( data.viewToModel ).fromElement( 'p' ).toElement( 'paragraph' );
+			buildViewConverter().for( data.viewToModel ).fromElement( 'b' ).toAttribute( 'bold', true );
 
 
 			const model = data.parse( '<p>foo<b>bar</b></p>' );
 			const model = data.parse( '<p>foo<b>bar</b></p>' );
 
 
@@ -139,7 +139,7 @@ describe( 'DataController', () => {
 			modelDocument.schema.registerItem( 'paragraph', '$block' );
 			modelDocument.schema.registerItem( 'paragraph', '$block' );
 			setData( modelDocument, '<paragraph>foo</paragraph>' );
 			setData( modelDocument, '<paragraph>foo</paragraph>' );
 
 
-			BuildModelConverterFor( data.modelToView ).fromElement( 'paragraph' ).toElement( 'p' );
+			buildModelConverter().for( data.modelToView ).fromElement( 'paragraph' ).toElement( 'p' );
 
 
 			expect( data.get() ).to.equal( '<p>foo</p>' );
 			expect( data.get() ).to.equal( '<p>foo</p>' );
 		} );
 		} );
@@ -148,7 +148,7 @@ describe( 'DataController', () => {
 			modelDocument.schema.registerItem( 'paragraph', '$block' );
 			modelDocument.schema.registerItem( 'paragraph', '$block' );
 			setData( modelDocument, '<paragraph></paragraph>' );
 			setData( modelDocument, '<paragraph></paragraph>' );
 
 
-			BuildModelConverterFor( data.modelToView ).fromElement( 'paragraph' ).toElement( 'p' );
+			buildModelConverter().for( data.modelToView ).fromElement( 'paragraph' ).toElement( 'p' );
 
 
 			expect( data.get() ).to.equal( '<p>&nbsp;</p>' );
 			expect( data.get() ).to.equal( '<p>&nbsp;</p>' );
 		} );
 		} );
@@ -157,7 +157,7 @@ describe( 'DataController', () => {
 			modelDocument.schema.registerItem( 'paragraph', '$block' );
 			modelDocument.schema.registerItem( 'paragraph', '$block' );
 			setData( modelDocument, '<paragraph>foo</paragraph><paragraph>bar</paragraph>' );
 			setData( modelDocument, '<paragraph>foo</paragraph><paragraph>bar</paragraph>' );
 
 
-			BuildModelConverterFor( data.modelToView ).fromElement( 'paragraph' ).toElement( 'p' );
+			buildModelConverter().for( data.modelToView ).fromElement( 'paragraph' ).toElement( 'p' );
 
 
 			expect( data.get() ).to.equal( '<p>foo</p><p>bar</p>' );
 			expect( data.get() ).to.equal( '<p>foo</p><p>bar</p>' );
 		} );
 		} );
@@ -172,7 +172,7 @@ describe( 'DataController', () => {
 			modelDocument.schema.registerItem( 'paragraph', '$block' );
 			modelDocument.schema.registerItem( 'paragraph', '$block' );
 			setData( modelDocument, '<paragraph>foo<$text bold=true>bar</$text></paragraph>' );
 			setData( modelDocument, '<paragraph>foo<$text bold=true>bar</$text></paragraph>' );
 
 
-			BuildModelConverterFor( data.modelToView ).fromElement( 'paragraph' ).toElement( 'p' );
+			buildModelConverter().for( data.modelToView ).fromElement( 'paragraph' ).toElement( 'p' );
 
 
 			expect( data.get() ).to.equal( '<p>foobar</p>' );
 			expect( data.get() ).to.equal( '<p>foobar</p>' );
 		} );
 		} );
@@ -181,8 +181,8 @@ describe( 'DataController', () => {
 			modelDocument.schema.registerItem( 'paragraph', '$block' );
 			modelDocument.schema.registerItem( 'paragraph', '$block' );
 			setData( modelDocument, '<paragraph>foo<$text bold=true>bar</$text></paragraph>' );
 			setData( modelDocument, '<paragraph>foo<$text bold=true>bar</$text></paragraph>' );
 
 
-			BuildModelConverterFor( data.modelToView ).fromElement( 'paragraph' ).toElement( 'p' );
-			BuildModelConverterFor( data.modelToView ).fromAttribute( 'bold' ).toElement( 'b' );
+			buildModelConverter().for( data.modelToView ).fromElement( 'paragraph' ).toElement( 'p' );
+			buildModelConverter().for( data.modelToView ).fromAttribute( 'bold' ).toElement( 'b' );
 
 
 			expect( data.get() ).to.equal( '<p>foo<b>bar</b></p>' );
 			expect( data.get() ).to.equal( '<p>foo<b>bar</b></p>' );
 		} );
 		} );
@@ -192,8 +192,8 @@ describe( 'DataController', () => {
 			setData( modelDocument, '<paragraph>foo</paragraph>', { rootName: 'main' } );
 			setData( modelDocument, '<paragraph>foo</paragraph>', { rootName: 'main' } );
 			setData( modelDocument, 'Bar', { rootName: 'title' } );
 			setData( modelDocument, 'Bar', { rootName: 'title' } );
 
 
-			BuildModelConverterFor( data.modelToView ).fromElement( 'paragraph' ).toElement( 'p' );
-			BuildModelConverterFor( data.modelToView ).fromAttribute( 'bold' ).toElement( 'b' );
+			buildModelConverter().for( data.modelToView ).fromElement( 'paragraph' ).toElement( 'p' );
+			buildModelConverter().for( data.modelToView ).fromAttribute( 'bold' ).toElement( 'b' );
 
 
 			expect( data.get() ).to.equal( '<p>foo</p>' );
 			expect( data.get() ).to.equal( '<p>foo</p>' );
 			expect( data.get( 'main' ) ).to.equal( '<p>foo</p>' );
 			expect( data.get( 'main' ) ).to.equal( '<p>foo</p>' );

+ 2 - 2
packages/ckeditor5-engine/tests/editingcontroller.js

@@ -11,7 +11,7 @@ import ViewDocument from '/ckeditor5/engine/view/document.js';
 
 
 import Mapper from '/ckeditor5/engine/conversion/mapper.js';
 import Mapper from '/ckeditor5/engine/conversion/mapper.js';
 import ModelConversionDispatcher from '/ckeditor5/engine/conversion/modelconversiondispatcher.js';
 import ModelConversionDispatcher from '/ckeditor5/engine/conversion/modelconversiondispatcher.js';
-import BuildModelConverterFor from '/ckeditor5/engine/conversion/model-converter-builder.js';
+import buildModelConverter from '/ckeditor5/engine/conversion/buildmodelconverter.js';
 
 
 import ModelDocument from '/ckeditor5/engine/model/document.js';
 import ModelDocument from '/ckeditor5/engine/model/document.js';
 import ModelPosition from '/ckeditor5/engine/model/position.js';
 import ModelPosition from '/ckeditor5/engine/model/position.js';
@@ -114,7 +114,7 @@ describe( 'EditingController', () => {
 			viewRoot = editing.createRoot( domRoot );
 			viewRoot = editing.createRoot( domRoot );
 
 
 			model.schema.registerItem( 'paragraph', '$block' );
 			model.schema.registerItem( 'paragraph', '$block' );
-			BuildModelConverterFor( editing.modelToView ).fromElement( 'paragraph' ).toElement( 'p' );
+			buildModelConverter().for( editing.modelToView ).fromElement( 'paragraph' ).toElement( 'p' );
 		} );
 		} );
 
 
 		beforeEach( () => {
 		beforeEach( () => {

+ 2 - 2
packages/ckeditor5-engine/tests/manual/editingcontroller.js

@@ -9,7 +9,7 @@ import ModelRange from '/ckeditor5/engine/model/range.js';
 
 
 import { setData } from '/tests/engine/_utils/model.js';
 import { setData } from '/tests/engine/_utils/model.js';
 
 
-import BuildModelConverterFor from '/ckeditor5/engine/conversion/model-converter-builder.js';
+import buildModelConverter from '/ckeditor5/engine/conversion/buildmodelconverter.js';
 
 
 const model = new Document();
 const model = new Document();
 model.createRoot();
 model.createRoot();
@@ -18,7 +18,7 @@ const editing = new EditingController( model );
 editing.createRoot( document.getElementById( 'editor' ) );
 editing.createRoot( document.getElementById( 'editor' ) );
 
 
 model.schema.registerItem( 'paragraph', '$block' );
 model.schema.registerItem( 'paragraph', '$block' );
-BuildModelConverterFor( editing.modelToView ).fromElement( 'paragraph' ).toElement( 'p' );
+buildModelConverter().for( editing.modelToView ).fromElement( 'paragraph' ).toElement( 'p' );
 
 
 setData( model,
 setData( model,
 	'<paragraph>foo</paragraph>' +
 	'<paragraph>foo</paragraph>' +

+ 4 - 4
packages/ckeditor5-engine/tests/tickets/475/475.js

@@ -12,8 +12,8 @@ import Position from '/ckeditor5/engine/model/position.js';
 import Range from '/ckeditor5/engine/model/range.js';
 import Range from '/ckeditor5/engine/model/range.js';
 import LivePosition from '/ckeditor5/engine/model/liveposition.js';
 import LivePosition from '/ckeditor5/engine/model/liveposition.js';
 
 
-import BuildModelConverterFor from '/ckeditor5/engine/conversion/model-converter-builder.js';
-import BuildViewConverterFor from '/ckeditor5/engine/conversion/view-converter-builder.js';
+import buildModelConverter from '/ckeditor5/engine/conversion/buildmodelconverter.js';
+import buildViewConverter from '/ckeditor5/engine/conversion/buildviewconverter.js';
 
 
 import AttributeElement from '/ckeditor5/engine/view/attributeelement.js';
 import AttributeElement from '/ckeditor5/engine/view/attributeelement.js';
 
 
@@ -27,12 +27,12 @@ export default class Link extends Feature {
 		editor.document.schema.allow( { name: '$inline', attributes: [ 'link' ] } );
 		editor.document.schema.allow( { name: '$inline', attributes: [ 'link' ] } );
 
 
 		// Build converter from model to view for data and editing pipelines.
 		// Build converter from model to view for data and editing pipelines.
-		BuildModelConverterFor( data.modelToView, editing.modelToView )
+		buildModelConverter().for( data.modelToView, editing.modelToView )
 			.fromAttribute( 'link' )
 			.fromAttribute( 'link' )
 			.toElement( ( href ) => new AttributeElement( 'a', { href } ) );
 			.toElement( ( href ) => new AttributeElement( 'a', { href } ) );
 
 
 		// Build converter from view to model for data pipeline.
 		// Build converter from view to model for data pipeline.
-		BuildViewConverterFor( data.viewToModel )
+		buildViewConverter().for( data.viewToModel )
 			.fromElement( 'a' )
 			.fromElement( 'a' )
 			.toAttribute( ( viewElement ) => ( { key: 'link', value: viewElement.getAttribute( 'href' ) } ) );
 			.toAttribute( ( viewElement ) => ( { key: 'link', value: viewElement.getAttribute( 'href' ) } ) );
 	}
 	}