1 21 22 27 28 package net.walend.somnifugi.sql92; 29 30 import net.walend.somnifugi.SomniMessageSelectorException; 31 32 36 public class SelectorFormatException 37 extends SomniMessageSelectorException 38 { 39 private static final long serialVersionUID = 0L; 40 41 String selector = null; 42 int index = -1; 43 44 SelectorFormatException(String message) 45 { 46 super(message); 47 } 48 49 SelectorFormatException(String message, String selector) 50 { 51 super(message); 52 this.selector = selector; 53 } 54 55 SelectorFormatException(String message, String selector, int index) 56 { 57 super(message); 58 this.selector = selector; 59 this.index = index; 60 } 61 62 public String getSelector() 63 { 64 return selector; 65 } 66 67 public int getIndex() 68 { 69 return index; 70 } 71 72 public String getMessage() 73 { 74 75 if (selector != null) 76 { 77 if (index > -1) 78 { 79 return super.getMessage() + ": \"" + selector + "\" at pos=" + 80 index; 81 } 82 else 83 { 84 return super.getMessage() + ": \"" + selector + "\"" ; 85 } 86 } 87 else 88 { 89 return super.getMessage(); 90 } 91 } 92 } 93 | Popular Tags |