Merge pull request #10902 from fredj/readFromDocument
Move readFromDocument implementation to the base class
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user