flysh
Version:
DOM Document Object Artifact Collector
68 lines • 1.94 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Sibling = void 0;
const DomElement_1 = require("./DomElement");
const FlyshException_1 = require("../exception/FlyshException");
/**
* 'Sibling' Model Class Definition ('Field')
*/
class Sibling extends DomElement_1.DomElement {
/**
* Public class constants
*/
static EXCEPTION_ID_5300000100_MESSAGE_VALUE = "A field name must be defined";
/**
* Class properties
*/
_field;
_regex;
/**
* Constructor
*
* @param field 'String' that contains the sibling's field
* @param element 'String' that contains the element or 'tag'
* @param signature 'String' that contains the signature of the element
* @param regex 'String' | 'undefined' that contains the regular expression, optional.
*/
constructor(field, element, signature, regex) {
super(element, signature);
this._field = field;
this._regex = regex;
}
/**
* Getter 'field' string property
*
* @returns Returns the '_field' class property
*/
get field() {
return this._field;
}
/**
* Getter 'regex' string property
*
* @returns Returns the '_regex' class property
*/
get regex() {
return this._regex;
}
/**
* Get the object properties (overridden)
*
* @returns Returns a 'String' with all the class properties
*/
get getEntry() {
return super.getEntry +
"Regex : " + this._regex + "\n" +
"Field : " + this._field + "\n";
}
/**
* Validates the current 'DOM' element type
*/
validate() {
super.validate();
if (this.field == '')
throw new FlyshException_1.FlyshException(5300000100, new Error, Sibling.EXCEPTION_ID_5300000100_MESSAGE_VALUE);
}
}
exports.Sibling = Sibling;
//# sourceMappingURL=Sibling.js.map