Add skin introspection patch from Tobi Schäfer for bug #688

http://dev.helma.org/bugs/show_bug.cgi?id=688
This commit is contained in:
hns 2009-11-04 11:31:10 +00:00
parent 8c219d75a3
commit 0a9d8ff99b

View file

@ -184,6 +184,14 @@ public final class Skin {
subskins.put(name, subskin); 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 * Check if this skin has a main skin, as opposed to consisting just of subskins
* @return true if this skin contains a main skin * @return true if this skin contains a main skin
@ -340,8 +348,8 @@ public final class Skin {
} }
} }
class Macro { public class Macro {
final int start, end; public final int start, end;
String name; String name;
String[] path; String[] path;
int handlerType = HANDLER_OTHER; int handlerType = HANDLER_OTHER;
@ -1006,9 +1014,38 @@ public final class Skin {
* Return the full name of the macro in handler.name notation * Return the full name of the macro in handler.name notation
* @return the macro name * @return the macro name
*/ */
String getName() { public String getName() {
return name; 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 { class StandardParams {