1 4 package gnu.kawa.xml; 5 import gnu.lists.*; 6 import gnu.bytecode.*; 7 import gnu.expr.*; 8 import gnu.math.IntNum; 9 10 11 12 public final class Focus extends TreePosition 13 { 14 15 static ThreadLocal current = new ThreadLocal (); 16 17 18 20 21 public static Focus getCurrent() 22 { 23 24 Object obj = current.get(); 25 if (obj == null) 26 { 27 obj = new Focus(); 28 current.set(obj); 29 } 30 return (Focus) obj; 31 32 33 35 } 36 37 public long position; 38 IntNum contextPosition; 39 40 public static void compileGetCurrent(Compilation comp) 41 { 42 CodeAttr code = comp.getCode(); 44 code.emitInvoke(getCurrentFocusMethod); 45 } 46 47 public static final ClassType TYPE = ClassType.make("gnu.kawa.xml.Focus"); 48 static final Method getCurrentFocusMethod 49 = TYPE.getDeclaredMethod("getCurrent", 0); 50 } 51 | Popular Tags |