|
|||||||||||||||||||
| 30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| MSQLTVariable.java | 0% | 0% | 0% | 0% |
|
||||||||||||||
| 1 |
package mobisnap.mobile_trx;
|
|
| 2 |
|
|
| 3 |
import mobisnap.common.reservation.*;
|
|
| 4 |
|
|
| 5 |
/**
|
|
| 6 |
* Used to represent variables and constants internally
|
|
| 7 |
*/
|
|
| 8 |
public abstract class MSQLTVariable |
|
| 9 |
implements MSQLTName
|
|
| 10 |
{
|
|
| 11 |
protected boolean notnull, constant; |
|
| 12 |
protected Object value;
|
|
| 13 |
protected ReservationUseBase rsrv;
|
|
| 14 |
|
|
| 15 | 0 |
public MSQLTVariable( boolean constant, boolean notnull) { |
| 16 | 0 |
this.constant = constant;
|
| 17 | 0 |
this.notnull = notnull;
|
| 18 |
} |
|
| 19 |
|
|
| 20 |
/**
|
|
| 21 |
* Associates the given reservation to the current value of the variable
|
|
| 22 |
*/
|
|
| 23 | 0 |
public void associateRsrv( ReservationUseBase rsrv) { |
| 24 | 0 |
this.rsrv = rsrv;
|
| 25 |
} |
|
| 26 |
|
|
| 27 |
/**
|
|
| 28 |
* Returns the reservations associated with the given variable
|
|
| 29 |
*/
|
|
| 30 | 0 |
public ReservationUseBase getRsrv() {
|
| 31 | 0 |
return rsrv;
|
| 32 |
} |
|
| 33 |
|
|
| 34 |
|
|
| 35 |
/**
|
|
| 36 |
* Returns the value of the variable
|
|
| 37 |
*/
|
|
| 38 | 0 |
public Object getValue() {
|
| 39 | 0 |
if( value == null) |
| 40 | 0 |
return SQLNull.getInstance();
|
| 41 |
else
|
|
| 42 | 0 |
return value;
|
| 43 |
} |
|
| 44 |
|
|
| 45 |
/**
|
|
| 46 |
* Returns the value of the variable
|
|
| 47 |
*/
|
|
| 48 | 0 |
public Object getValue( Object[] params) throws Exception { |
| 49 | 0 |
throw new mobisnap.MobisnapException( "Variables do not have parameters"); |
| 50 |
} |
|
| 51 |
|
|
| 52 |
/**
|
|
| 53 |
* Sets the value of the given variable
|
|
| 54 |
*/
|
|
| 55 |
public abstract void setValue( Object obj) throws Exception; |
|
| 56 |
|
|
| 57 | 0 |
public String toString() {
|
| 58 | 0 |
if( value != null) |
| 59 | 0 |
return value.toString();
|
| 60 |
else
|
|
| 61 | 0 |
return "null"; |
| 62 |
} |
|
| 63 |
} |
|
| 64 |
|
|
||||||||||