0e7a9e07774813965a83c5a13791177d410303e1
[jalviewjs.git] / site / swingjs / j2s / java / util / regex / PatternSyntaxException.js
1 Clazz.declarePackage("java.util.regex");
2 Clazz.load(["java.lang.IllegalArgumentException"],"java.util.regex.PatternSyntaxException",null,function(){
3 c$=Clazz.decorateAsClass(function(){
4 this.desc=null;
5 this.pattern=null;
6 this.index=-1;
7 Clazz.instantialize(this,arguments);
8 },java.util.regex,"PatternSyntaxException",IllegalArgumentException);
9 Clazz.makeConstructor(c$,
10 function(desc,pattern,index){
11 Clazz.superConstructor(this,java.util.regex.PatternSyntaxException,[]);
12 this.desc=desc;
13 this.pattern=pattern;
14 this.index=index;
15 },"~S,~S,~N");
16 Clazz.defineMethod(c$,"getPattern",
17 function(){
18 return this.pattern;
19 });
20 Clazz.overrideMethod(c$,"getMessage",
21 function(){
22 var s=this.desc;
23 if(this.index>=0){
24 s+=" near index "+this.index;
25 }s+="\r\n"+this.pattern;
26 if(this.index>=0){
27 s+="\r\n";
28 for(var i=0;i<this.index;i++)s+=(' ').charCodeAt(0);
29
30 s+=('^').charCodeAt(0);
31 }return s;
32 });
33 Clazz.defineMethod(c$,"getDescription",
34 function(){
35 return this.desc;
36 });
37 Clazz.defineMethod(c$,"getIndex",
38 function(){
39 return this.index;
40 });
41 });