Merge pull request #10902 from fredj/readFromDocument

Move readFromDocument implementation to the base class
This commit is contained in:
Frédéric Junod
2020-04-09 10:20:51 +02:00
committed by GitHub
4 changed files with 8 additions and 41 deletions
-13
View File
@@ -33,19 +33,6 @@ class OWS extends XML {
super(); super();
} }
/**
* @param {Document} doc Document.
* @return {Object} Object
*/
readFromDocument(doc) {
for (let n = doc.firstChild; n; n = n.nextSibling) {
if (n.nodeType == Node.ELEMENT_NODE) {
return this.readFromNode(/** @type {Element} */ (n));
}
}
return null;
}
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @return {Object} Object * @return {Object} Object
-13
View File
@@ -62,19 +62,6 @@ class WMSCapabilities extends XML {
this.version = undefined; this.version = undefined;
} }
/**
* @param {Document} doc Document.
* @return {Object} Object
*/
readFromDocument(doc) {
for (let n = doc.firstChild; n; n = n.nextSibling) {
if (n.nodeType == Node.ELEMENT_NODE) {
return this.readFromNode(/** @type {Element} */ (n));
}
}
return null;
}
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @return {Object} Object * @return {Object} Object
-13
View File
@@ -52,19 +52,6 @@ class WMTSCapabilities extends XML {
this.owsParser_ = new OWS(); this.owsParser_ = new OWS();
} }
/**
* @param {Document} doc Document.
* @return {Object} Object
*/
readFromDocument(doc) {
for (let n = doc.firstChild; n; n = n.nextSibling) {
if (n.nodeType == Node.ELEMENT_NODE) {
return this.readFromNode(/** @type {Element} */ (n));
}
}
return null;
}
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @return {Object} Object * @return {Object} Object
+8 -2
View File
@@ -31,11 +31,17 @@ class XML {
} }
/** /**
* @abstract
* @param {Document} doc Document. * @param {Document} doc Document.
* @return {Object} Object * @return {Object} Object
*/ */
readFromDocument(doc) {} readFromDocument(doc) {
for (let n = doc.firstChild; n; n = n.nextSibling) {
if (n.nodeType == Node.ELEMENT_NODE) {
return this.readFromNode(/** @type {Element} */ (n));
}
}
return null;
}
/** /**
* @abstract * @abstract