js.share.srctree.code.code-line.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sahagin Show documentation
Show all versions of sahagin Show documentation
Sahagin makes your Selenium script more readable and maintainable.
/**
* @class
*/
sahagin.CodeLine = function() {
/**
* line start from 1
* @private
* @type {number}
*/
this.startLine = 0;
/**
* @private
* @type {number}
*/
this.endLine = 0;
/**
* @type {sahagin.Code}
*/
this.code = null;
};
/**
* @returns {number}
*/
sahagin.CodeLine.prototype.getStartLine = function() {
return this.startLine;
};
/**
* @param {number} startLine
*/
sahagin.CodeLine.prototype.setStartLine = function(startLine) {
this.startLine = startLine;
};
/**
* @returns {number}
*/
sahagin.CodeLine.prototype.getEndLine = function() {
return this.endLine;
};
/**
* @param {number} endLine
*/
sahagin.CodeLine.prototype.setEndLine = function(endLine) {
this.endLine = endLine;
};
/**
* @returns {sahagin.Code}
*/
sahagin.CodeLine.prototype.getCode = function() {
return this.code;
};
/**
* @param {sahagin.Code} code
*/
sahagin.CodeLine.prototype.setCode = function(code) {
this.code = code;
};
/**
* @returns {Object.}
*/
sahagin.CodeLine.prototype.toYamlObject = function() {
var result = new Object();
result['tartLine'] = this.startLine;
result['endLine'] = this.endLine;
result['code'] = this.code.toYamlObject();
return result;
};
/**
* @param {Object.} yamlObject
*/
sahagin.CodeLine.prototype.fromYamlObject = function(yamlObject) {
this.startLine = sahagin.YamlUtils.getIntValue(yamlObject, 'startLine');
this.endLine = sahagin.YamlUtils.getIntValue(yamlObject, 'endLine');
this.code = sahagin.Code.newInstanceFromYamlObject(sahagin.YamlUtils.getYamlObjectValue(yamlObject, 'code'));
};