1 package com.daffodilwoods.daffodildb.utils.parser; 2 3 import com.daffodilwoods.database.resource.*; 4 import java.util.Locale ; 5 8 9 public class ParseException extends DException implements com.daffodilwoods.daffodildb.utils.parser.StatementExecuter{ 10 11 14 int returnType; 15 16 19 int position = -1; 20 21 String causeOfFailure; String query; 23 int causeOfFailurePosition; 24 25 public ParseException(){ 26 super("DSE1174",null); 27 } 28 29 32 33 void setReturnType(int type){ 34 returnType = type; 35 } 36 37 40 void setPosition(int position0){ 41 if (position0 > position) 42 position = position0; 43 } 44 45 void setCauseOfParseException(int pst,String cause,int position0){ 46 if ( position0 > position ){ 47 causeOfFailurePosition = pst; 48 } 49 } 50 51 public Object run(Object object) throws com.daffodilwoods.database.resource.DException{ 52 throw this; 53 } 54 55 void setQuery(String query0){ 56 query = query0; 57 objarray = new Object []{query}; 58 } 59 60 public String toString(){ 61 return getMessage(); 62 } 63 64 public Object clone() throws CloneNotSupportedException { 65 throw new RuntimeException ("METHOD CLONE NOT SUPPORTED ... "); 66 } 67 68 public int getErrorPosition(){ 69 return position; 70 } 71 72 public String getMessage(Locale locale){ 73 objarray = new Object []{new Integer (position),causeOfFailure}; 74 return super.getMessage(locale); 75 } 76 } 77 | Popular Tags |