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.api.macro;
25:
26: import java.io.IOException;
27: import java.io.Writer;
28:
29: import org.radeox.api.engine.context.InitialRenderContext;
30:
31: /*
32: * Class that implements base functionality to write macros @author stephan
33: *
34: * @version $Id: Macro.java 29159 2007-04-19 01:46:15Z ajpoland@iupui.edu $
35: */
36:
37: public interface Macro extends Comparable {
38: /**
39: * Get the name of the macro. This is used to map a macro in the input to
40: * the macro which should be called. The method has to be implemented by
41: * subclassing classes.
42: *
43: * @return name Name of the Macro
44: */
45: public String getName();
46:
47: /**
48: * Get a description of the macro. This description explains in a short way
49: * what the macro does
50: *
51: * @return description A string describing the macro
52: */
53: public String getDescription();
54:
55: /**
56: * Get a description of the paramters of the macro. The method returns an
57: * array with an String entry for every parameter. The format is {"1:
58: * description", ...} where 1 is the position of the parameter.
59: *
60: * @return description Array describing the parameters of the macro
61: */
62: public String[] getParamDescription();
63:
64: public void setInitialContext(InitialRenderContext context);
65:
66: /**
67: * Execute the macro. This method is called by MacroFilter to handle macros.
68: *
69: * @param writer
70: * A write where the macro should write its output to
71: * @param params
72: * Macro parameters with the parameters the macro is called with
73: */
74: public void execute(Writer writer, MacroParameter params)
75: throws IllegalArgumentException, IOException;
76: }
|