1 22 23 package org.xquark.extractor.sql; 24 25 import java.util.List ; 26 27 public class SqlLitList extends SqlExpression 28 { 29 private static final String RCSRevision = "$Revision: 1.4 $"; 30 private static final String RCSName = "$Name: $"; 31 private List _litList; 32 33 public SqlLitList() { 34 } 35 36 public SqlLitList(List litList) { 37 setLitList ( litList ) ; 38 } 39 40 public List getLitList() { 41 return _litList; 42 } 43 44 public void setLitList(List litList) { 45 _litList = litList; 46 } 47 48 public String toSql(Context context) { 49 StringBuffer retVal = new StringBuffer (); 50 retVal.append('('); 51 52 if (null != _litList && !_litList.isEmpty()){ 53 for (int i = 0; i < _litList.size()-1; i++) { 54 retVal.append(((SqlExpression)_litList.get(i)).toSql(context)); 55 retVal.append(", "); 56 } 57 retVal.append(((SqlExpression)_litList.get( _litList.size()-1)).toSql(context)); 58 } 59 retVal.append(')'); 60 return retVal.toString(); 61 } 62 } 63 | Popular Tags |