/* Generated By:JJTree: Do not edit this line. TextLine.java Version 4.3 */
/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=true,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=,NODE_EXTENDS=,NODE_FACTORY=TeiidNodeFactory,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
package org.teiid.query.sql.symbol;
import java.util.List;
import org.teiid.designer.query.sql.symbol.ITextLine;
import org.teiid.designer.runtime.version.spi.ITeiidServerVersion;
import org.teiid.query.parser.LanguageVisitor;
import org.teiid.query.sql.lang.SimpleNode;
/**
*
*/
public class TextLine extends SimpleNode implements Expression, ITextLine<LanguageVisitor> {
public static final String nl = System.getProperty("line.separator"); //$NON-NLS-1$
private Character delimiter;
private Character quote;
private boolean includeHeader;
private List<DerivedColumn> expressions;
private String encoding;
private String lineEnding = nl;
/**
* @param p
* @param id
*/
public TextLine(ITeiidServerVersion p, int id) {
super(p, id);
}
/**
* @return delimiter
*/
public Character getDelimiter() {
return delimiter;
}
/**
* @param delimiter
*/
public void setDelimiter(Character delimiter) {
this.delimiter = delimiter;
}
/**
* @return encoding
*/
public String getEncoding() {
return encoding;
}
/**
* @param encoding
*/
public void setEncoding(String encoding) {
this.encoding = encoding;
}
/**
* @return quote
*/
public Character getQuote() {
return quote;
}
/**
* @param quote
*/
public void setQuote(Character quote) {
this.quote = quote;
}
/**
* @return is include header flag
*/
public boolean isIncludeHeader() {
return includeHeader;
}
/**
* @param includeHeader
*/
public void setIncludeHeader(boolean includeHeader) {
this.includeHeader = includeHeader;
}
/**
* @return expressions
*/
public List<DerivedColumn> getExpressions() {
return expressions;
}
/**
* @param expressions
*/
public void setExpressions(List<DerivedColumn> expressions) {
this.expressions = expressions;
}
public String getLineEnding() {
return lineEnding;
}
public void setLineEnding(String lineEnding) {
this.lineEnding = lineEnding;
}
@Override
public Class<?> getType() {
return String[].class;
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((this.delimiter == null) ? 0 : this.delimiter.hashCode());
result = prime * result + ((this.encoding == null) ? 0 : this.encoding.hashCode());
result = prime * result + ((this.expressions == null) ? 0 : this.expressions.hashCode());
result = prime * result + (this.includeHeader ? 1231 : 1237);
result = prime * result + ((this.quote == null) ? 0 : this.quote.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (!super.equals(obj)) return false;
if (getClass() != obj.getClass()) return false;
TextLine other = (TextLine)obj;
if (this.delimiter == null) {
if (other.delimiter != null) return false;
} else if (!this.delimiter.equals(other.delimiter)) return false;
if (this.encoding == null) {
if (other.encoding != null) return false;
} else if (!this.encoding.equals(other.encoding)) return false;
if (this.expressions == null) {
if (other.expressions != null) return false;
} else if (!this.expressions.equals(other.expressions)) return false;
if (this.includeHeader != other.includeHeader) return false;
if (this.quote == null) {
if (other.quote != null) return false;
} else if (!this.quote.equals(other.quote)) return false;
return true;
}
/** Accept the visitor. **/
@Override
public void acceptVisitor(LanguageVisitor visitor) {
visitor.visit(this);
}
@Override
public TextLine clone() {
TextLine clone = new TextLine(getTeiidVersion(), this.id);
if(getDelimiter() != null)
clone.setDelimiter(getDelimiter());
if(getEncoding() != null)
clone.setEncoding(getEncoding());
if(getQuote() != null)
clone.setQuote(getQuote());
clone.setIncludeHeader(isIncludeHeader());
if(getExpressions() != null)
clone.setExpressions(cloneList(getExpressions()));
return clone;
}
// TODO: Teiid 9.0
// There are runtime class changes that aren't in here. check with Paul
}
/* JavaCC - OriginalChecksum=e0b8f44a78e8c88a57ec4d4e5bf9c25f (do not edit this line) */