001package gudusoft.gsqlparser.nodes; 002/* 003 * Date: 13-10-21 004 */ 005 006import gudusoft.gsqlparser.ESequenceOptionType; 007 008public class TSequenceOption extends TParseTreeNode { 009 private ESequenceOptionType sequenceOptionType; 010 private TConstant optionValue; 011 012 private TObjectName ownedBy; 013 private TTypeName dataType; 014 015 public TObjectName getOwnedBy() { 016 return ownedBy; 017 } 018 019 public TTypeName getDataType() { 020 return dataType; 021 } 022 023 public void init(Object arg1){ 024 sequenceOptionType = (ESequenceOptionType)arg1; 025 } 026 027 public TConstant getOptionValue() { 028 return optionValue; 029 } 030 031 public ESequenceOptionType getSequenceOptionType() { 032 return sequenceOptionType; 033 } 034 035 public void init(Object arg1,Object arg2){ 036 init(arg1); 037 switch (this.sequenceOptionType){ 038 case ownedBy: 039 case ownerTo: 040 case setSchema: 041 case renameTo: 042 this.ownedBy = (TObjectName) arg2; 043 break; 044 case asType: 045 this.dataType = (TTypeName) arg2; 046 break; 047 default: 048 optionValue = (TConstant)arg2; 049 050 } 051 } 052 053 public void setSequenceOptionType(ESequenceOptionType sequenceOptionType) { 054 this.sequenceOptionType = sequenceOptionType; 055 } 056 057 public void setOptionValue(TConstant optionValue) { 058 this.optionValue = optionValue; 059 } 060 061 public void accept(TParseTreeVisitor v){ 062 v.preVisit(this); 063 v.postVisit(this); 064 } 065 066 public void acceptChildren(TParseTreeVisitor v) { 067 v.preVisit(this); 068 v.postVisit(this); 069 } 070}