1 19 20 package org.netbeans.modules.web.debug.breakpoints; 21 22 import org.netbeans.api.debugger.*; 23 import org.netbeans.api.debugger.jpda.*; 24 25 29 public class JspBreakpointsReader implements Properties.Reader { 30 31 public String [] getSupportedClassNames () { 32 return new String [] { JspLineBreakpoint.class.getName () }; 33 } 34 35 public Object read (String typeID, Properties properties) { 36 37 JspLineBreakpoint b = null; 38 if (typeID.equals (JspLineBreakpoint.class.getName ())) { 39 b = JspLineBreakpoint.create ( 40 properties.getString(JspLineBreakpoint.PROP_URL, null), 41 properties.getInt(JspLineBreakpoint.PROP_LINE_NUMBER, 1) 42 ); 43 b.setCondition(properties.getString (JspLineBreakpoint.PROP_CONDITION, "")); 44 b.setPrintText(properties.getString (JspLineBreakpoint.PROP_PRINT_TEXT, "")); 45 b.setGroupName(properties.getString (Breakpoint.PROP_GROUP_NAME, "")); 46 b.setSuspend(properties.getInt (JspLineBreakpoint.PROP_SUSPEND, JspLineBreakpoint.SUSPEND_ALL)); 47 if (properties.getBoolean (JspLineBreakpoint.PROP_ENABLED, true)) { 48 b.enable (); 49 } else { 50 b.disable (); 51 } 52 } 53 54 return b; 55 } 56 57 public void write (Object object, Properties properties) { 58 59 if (object instanceof JspLineBreakpoint) { 60 JspLineBreakpoint b = (JspLineBreakpoint) object; 61 properties.setString (JspLineBreakpoint.PROP_PRINT_TEXT, b.getPrintText ()); 62 properties.setString (JspLineBreakpoint.PROP_GROUP_NAME, b.getGroupName ()); 63 properties.setInt (JspLineBreakpoint.PROP_SUSPEND, b.getSuspend ()); 64 properties.setBoolean (JspLineBreakpoint.PROP_ENABLED, b.isEnabled ()); 65 properties.setString (JspLineBreakpoint.PROP_URL, b.getURL ()); 66 properties.setInt (JspLineBreakpoint.PROP_LINE_NUMBER, b.getLineNumber ()); 67 properties.setString (JspLineBreakpoint.PROP_CONDITION, b.getCondition ()); 68 } 69 return; 70 } 71 } 72 | Popular Tags |