Work on error reporting. Adds troubleshooter.
[mkjsf-moved-to-github.git] / src / main / java / com / indexdata / pz2utils4jsf / utils / Utils.java
index e17c224..5273134 100644 (file)
@@ -2,6 +2,8 @@ package com.indexdata.pz2utils4jsf.utils;
 \r
 public class Utils {\r
   \r
+  public static String nl = System.getProperty("line.separator");  \r
+\r
   public static String objectId(Object o) {\r
     int lastdot = o.toString().lastIndexOf('.');\r
     if (lastdot>-1 && lastdot+1<o.toString().length()) {\r
@@ -10,5 +12,13 @@ public class Utils {
       return o.toString();\r
     }\r
   }\r
-\r
+  \r
+  public static String baseObjectName(Object o) {\r
+    String objName = o.getClass().getName();\r
+    if (objName.contains("$")) {\r
+      return objectId(objName.substring(0,objName.indexOf("$")));      \r
+    } else {\r
+      return objectId(objName);\r
+    }\r
+  }\r
 }\r