From: Bill Erickson Date: Thu, 5 Apr 2012 13:36:31 +0000 (-0400) Subject: Java IDL parser supports isnew/ischanged/isdeleted X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0fea2393446d8604f703a3fc405743bbedc22996;p=contrib%2FConifer.git Java IDL parser supports isnew/ischanged/isdeleted Includes changes to TestIDL.java for verification. Signed-off-by: Bill Erickson Signed-off-by: Jason Stephenson --- diff --git a/Open-ILS/src/java/org/open_ils/idl/IDLParser.java b/Open-ILS/src/java/org/open_ils/idl/IDLParser.java index 4da147f521..059aeb78f8 100644 --- a/Open-ILS/src/java/org/open_ils/idl/IDLParser.java +++ b/Open-ILS/src/java/org/open_ils/idl/IDLParser.java @@ -159,6 +159,15 @@ public class IDLParser { if("class".equals(localpart)) { + String[] vfields = {"isnew", "ischanged", "isdeleted"}; + for (String fieldName : vfields) { + IDLField field = new IDLField(); + field.setName(fieldName); + field.setArrayPos(fieldIndex++); + field.setIsVirtual(true); + current.addField(field); + } + if(keepIDLObjects) IDLObjects.put(current.getIDLClass(), current); diff --git a/Open-ILS/src/java/org/open_ils/test/TestIDL.java b/Open-ILS/src/java/org/open_ils/test/TestIDL.java index de778a9d15..c50ad62ba4 100644 --- a/Open-ILS/src/java/org/open_ils/test/TestIDL.java +++ b/Open-ILS/src/java/org/open_ils/test/TestIDL.java @@ -10,10 +10,11 @@ public class TestIDL { parser.parse(); //System.out.print(parser.toXML()); - /* OSRFObject bre = new OSRFObject("bre"); bre.put("id", new Integer(1)); + bre.put("isnew", new Boolean(false)); + bre.put("isdeleted", new Boolean(true)); System.out.println(bre); - */ + System.out.println(new JSONWriter(bre).write()); } }