001 package org.hackystat.telemetry.analyzer.language.ast; 002 003 /** 004 * Telemetry definition base class. 005 * 006 * @author (Cedric) Qin Zhang 007 * @version $Id$ 008 */ 009 public abstract class TelemetryDefinition { 010 011 private String name; 012 private TextPosition textPosition; 013 private String definitionString; 014 015 /** 016 * Constucts this instance. 017 * 018 * @param name The name of this definition. 019 * @param textPosition The text position of the definition string in the input. 020 */ 021 protected TelemetryDefinition(String name, TextPosition textPosition) { 022 this.name = name; 023 this.textPosition = textPosition; 024 } 025 026 /** 027 * Gets the name of this telemetry "streams" object. 028 * 029 * @return The name. 030 */ 031 public String getName() { 032 return this.name; 033 } 034 035 /** 036 * Gets the text position of the definition string in the input. 037 * 038 * @return The text position of the definition string in the input. 039 */ 040 public TextPosition getTextPosition() { 041 return this.textPosition; 042 } 043 044 /** 045 * Gets the definition string. 046 * 047 * @return The definition string, or null if the definition string is not available. 048 */ 049 public String getDefinitionString() { 050 return this.definitionString; 051 } 052 053 /** 054 * Sets the definition string. 055 * 056 * @param definitionString The description. 057 */ 058 public void setDefinitionString(String definitionString) { 059 this.definitionString = definitionString; 060 } 061 }