01: /*
02: * This file is part of "SnipSnap Radeox Rendering Engine".
03: *
04: * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel
05: * All Rights Reserved.
06: *
07: * Please visit http://radeox.org/ for updates and contact.
08: *
09: * --LICENSE NOTICE--
10: * Licensed under the Apache License, Version 2.0 (the "License");
11: * you may not use this file except in compliance with the License.
12: * You may obtain a copy of the License at
13: *
14: * http://www.apache.org/licenses/LICENSE-2.0
15: *
16: * Unless required by applicable law or agreed to in writing, software
17: * distributed under the License is distributed on an "AS IS" BASIS,
18: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19: * See the License for the specific language governing permissions and
20: * limitations under the License.
21: * --LICENSE NOTICE--
22: */
23:
24: package org.radeox.macro;
25:
26: import org.apache.commons.logging.Log;
27: import org.apache.commons.logging.LogFactory;
28:
29: /**
30: * Plugin loader for macros
31: *
32: * @author Stephan J. Schmidt
33: * @version $Id: MacroLoader.java 29632 2007-04-26 14:40:11Z ajpoland@iupui.edu $
34: */
35:
36: public class MacroLoader extends PluginLoader {
37: private static Log log = LogFactory.getLog(MacroLoader.class);
38:
39: public Class getLoadClass() {
40: return Macro.class;
41: }
42:
43: /**
44: * Add a plugin to the known plugin map
45: *
46: * @param macro
47: * Macro to add
48: */
49: public void add(Repository repository, Object plugin) {
50: if (plugin instanceof org.radeox.api.macro.Macro) {
51: repository.put(((org.radeox.api.macro.Macro) plugin)
52: .getName(), plugin);
53: } else {
54: log.warn("MacroLoader: " + plugin.getClass()
55: + " not of Type "
56: + org.radeox.api.macro.Macro.class);
57: }
58: }
59:
60: }
|