1 19 20 package org.netbeans.api.debugger.jpda; 21 22 23 39 public final class ClassLoadUnloadBreakpoint extends JPDABreakpoint { 40 41 42 public static final String PROP_CLASS_FILTERS = "classFilters"; 44 public static final String PROP_CLASS_EXCLUSION_FILTERS = "classExclusionFilters"; 46 public static final String PROP_BREAKPOINT_TYPE = "breakpointType"; 48 49 public static final int TYPE_CLASS_LOADED = 1; 50 51 public static final int TYPE_CLASS_UNLOADED = 2; 52 53 public static final int TYPE_CLASS_LOADED_UNLOADED = 3; 54 55 56 private int type = TYPE_CLASS_LOADED; 57 private String [] classFilters = new String [0]; 58 private String [] classExclusionFilters = new String [0]; 59 60 61 private ClassLoadUnloadBreakpoint () { 62 } 63 64 73 public static ClassLoadUnloadBreakpoint create ( 74 String classNameFilter, 75 boolean isExclusionFilter, 76 int breakpointType 77 ) { 78 ClassLoadUnloadBreakpoint b = new ClassLoadUnloadBreakpoint (); 79 if (isExclusionFilter) 80 b.setClassExclusionFilters (new String [] {classNameFilter}); 81 else 82 b.setClassFilters (new String [] {classNameFilter}); 83 b.setBreakpointType (breakpointType); 84 return b; 85 } 86 87 94 public static ClassLoadUnloadBreakpoint create ( 95 int breakpointType 96 ) { 97 ClassLoadUnloadBreakpoint b = new ClassLoadUnloadBreakpoint (); 98 b.setBreakpointType (breakpointType); 99 return b; 100 } 101 102 107 public int getBreakpointType () { 108 return type; 109 } 110 111 116 public void setBreakpointType (int type) { 117 if (type == this.type) return; 118 if ((type & (TYPE_CLASS_LOADED | TYPE_CLASS_UNLOADED)) == 0) 119 throw new IllegalArgumentException (); 120 int old = this.type; 121 this.type = type; 122 firePropertyChange (PROP_BREAKPOINT_TYPE, new Integer (old), new Integer (type)); 123 } 124 125 130 public String [] getClassFilters () { 131 return classFilters; 132 } 133 134 139 public void setClassFilters (String [] classFilters) { 140 if (classFilters == this.classFilters) return; 141 Object old = this.classFilters; 142 this.classFilters = classFilters; 143 firePropertyChange (PROP_CLASS_FILTERS, old, classFilters); 144 } 145 146 151 public String [] getClassExclusionFilters () { 152 return classExclusionFilters; 153 } 154 155 160 public void setClassExclusionFilters (String [] classExclusionFilters) { 161 if (classExclusionFilters == this.classExclusionFilters) return; 162 Object old = this.classExclusionFilters; 163 this.classExclusionFilters = classExclusionFilters; 164 firePropertyChange (PROP_CLASS_EXCLUSION_FILTERS, old, classExclusionFilters); 165 } 166 167 172 public String toString () { 173 return "ClassLoadUnloadBreakpoint " + classFilters; 174 } 175 } 176 | Popular Tags |