package gw.rating.worksheet.domain uses java.lang.StringBuilder uses gw.xml.parser2.PLXMLNode /** * Represents a Rateflow routine. All calculations executed within the context of this routine * are children of this object * */ class WorksheetRoutine extends WorksheetEntry { var _book : String as RateBookCode var _edition : String as RateBookEdition var _code : String as RoutineCode var _version : String as RoutineVersion override function pseudoCode(buffer : StringBuilder, includeValues : boolean) { buffer.append("/**\n") buffer.append(" * Rate Book: ${_book} edition: ${_edition}\n") buffer.append(" * Routine: ${_code} version: ${_version}\n") buffer.append(" */\n") } override function toXml() : PLXMLNode { var node = new PLXMLNode(WorksheetClass) node.setAttributeValue("RateBookCode", _book) node.setAttributeValue("RateBookEdition", _edition) node.setAttributeValue("RoutineCode", _code) node.setAttributeValue("RoutineVersion", _version) writeXml(node) return node } override function fromXml(node : PLXMLNode) { _book = node.getAttributeValue("RateBookCode") _edition = node.getAttributeValue("RateBookEdition") _code = node.getAttributeValue("RoutineCode") _version = node.getAttributeValue("RoutineVersion") readXml(node) } override property get WorksheetClass(): String { return "Routine" } }