1 /* JJT: 0.2.2 */ 2 3 package mobisnap.mobile_trx; 4 5 import mobisnap.*; 6 7 /*** 8 * Implements table reference 9 */ 10 public class ASTTableColumn extends mobisnap.mobile_trx.SimpleNode { 11 String s1, s2, s3; 12 13 public ASTTableColumn(int id) { 14 super(id); 15 } 16 17 public ASTTableColumn( MobisnapSQL p, int i) { 18 super( p, i); 19 id = i; 20 } 21 22 /*** Accept the visitor. **/ 23 public Object jjtAccept(MobisnapSQLVisitor visitor, Object data) { 24 return visitor.visit(this, data); 25 } 26 27 public String columnName() { 28 return toString( MobisnapConstants.MSQL_ORIGINAL).trim(); 29 } 30 /*** 31 * Displays the source code of the node 32 * 33 * @param msql_type Specifies which type of processing should be performed 34 * MobisnapConstants.MSQL_SERVER = 1 35 * MobisnapConstants.MSQL_TENTATIVE_CLIENT = 2 36 * MobisnapConstants.MSQL_STABLE_CLIENT = 3 37 */ 38 public void sourceCode( int msql_type, StringBuffer buffer) throws Exception { 39 if( msql_type == mobisnap.MobisnapConstants.MSQL_ORIGINAL) { 40 super.sourceCode( msql_type, buffer); 41 return; 42 } 43 if( s2 == null) { 44 try { 45 buffer.append( " "); 46 Object obj = MobisnapSQL.names.getName( s1).getValue(); 47 if( obj instanceof String) { 48 buffer.append( "'"); 49 buffer.append( obj.toString()); 50 buffer.append( "'"); 51 } else if( obj instanceof java.sql.Date) 52 buffer.append( MSQLTypeUtil.date2String( (java.sql.Date)obj)); 53 else 54 buffer.append( obj.toString()); 55 buffer.append( " "); 56 return; 57 } catch( Exception e) { 58 // do nothing 59 } 60 } 61 buffer.append( " "); 62 buffer.append( s1); 63 if( s2 != null) { 64 buffer.append( "."); 65 buffer.append( s2); 66 } 67 if( s3 != null) { 68 buffer.append( "."); 69 buffer.append( s3); 70 } 71 buffer.append( " "); 72 } 73 }

This page was automatically generated by Maven