r9983 - helma/helma/trunk/src/helma/framework/core

[email protected] Wed, 4 Nov 2009 12:31:10 +0100 (CET)
Newsgroups gmane.comp.java.helma.cvs
Message-ID <20091104113110.8DB263D0E2@mia>
Author: hannes
Date: 2009-11-04 12:31:10 +0100 (Wed, 04 Nov 2009)
New Revision: 9983

Modified:
   helma/helma/trunk/src/helma/framework/core/Skin.java
Log:
Add skin introspection patch from Tobi Sch?\195?\164fer for bug #688
http://dev.helma.org/bugs/show_bug.cgi?id=688

Details at http://dev.helma.org/trac/helma/changeset/9983

Modified: helma/helma/trunk/src/helma/framework/core/Skin.java
===================================================================
--- helma/helma/trunk/src/helma/framework/core/Skin.java	2009-11-04 11:13:12 UTC (rev 9982)
+++ helma/helma/trunk/src/helma/framework/core/Skin.java	2009-11-04 11:31:10 UTC (rev 9983)
@@ -183,6 +183,14 @@
         }
         subskins.put(name, subskin);
     }
+    
+    /**
+     * Return the list of macros found by the parser
+     * @return the list of macros
+     */
+    public Macro[] getMacros() {
+    	return macros;
+    }
 
     /**
      * Check if this skin has a main skin, as opposed to consisting just of subskins
@@ -340,8 +348,8 @@
         }
     }
 
-    class Macro {
-        final int start, end;
+    public class Macro {
+        public final int start, end;
         String name;
         String[] path;
         int handlerType = HANDLER_OTHER;
@@ -1006,9 +1014,38 @@
          * Return the full name of the macro in handler.name notation
          * @return the macro name
          */
-        String getName() {
+        public String getName() {
             return name;
         }
+
+        /**
+         * Return the numeric type of the macro handler
+         * @return the handler type
+         */
+        public int getHandlerType() {
+        	return handlerType;
+        }
+
+        /**
+         * Return the list of named parameters
+         * @return the list of named parameters
+         */
+        public Map getNamedParams() {
+        	return namedParams;
+        }
+        
+        /**
+         * Return the list of positional parameters
+         * @return the list of positional parameters
+         */
+        public List getPositionalParams() {
+        	return positionalParams;
+        }
+        
+        public boolean hasNestedMacros() {
+        	return hasNestedMacros;
+        }
+
     }
 
     class StandardParams {