From 613344a0067a23e26c07d91cba512cfd6a1b24ac Mon Sep 17 00:00:00 2001 From: hns Date: Wed, 9 Nov 2005 15:32:10 +0000 Subject: [PATCH] * Implement app.getPrototypes() and app.getPrototype(name) to allow app introspection. --- src/helma/framework/core/ApplicationBean.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/helma/framework/core/ApplicationBean.java b/src/helma/framework/core/ApplicationBean.java index 297cd091..09e5e5bd 100644 --- a/src/helma/framework/core/ApplicationBean.java +++ b/src/helma/framework/core/ApplicationBean.java @@ -419,6 +419,25 @@ public class ApplicationBean implements Serializable { return app.getDbSource(name); } + /** + * Get an array of this app's prototypes + * + * @return an array containing the app's prototypes + */ + public Prototype[] getPrototypes() { + return (Prototype[]) app.getPrototypes().toArray(new Prototype[0]); + } + + /** + * Get a prototype by name. + * + * @param name the prototype name + * @return the prototype + */ + public Prototype getPrototype(String name) { + return app.getPrototypeByName(name); + } + /** * *