KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > portal > layout > renderer > aspect > RendererAspect


1 /*
2  * Copyright 1999-2002,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.cocoon.portal.layout.renderer.aspect;
17
18 import java.util.Iterator JavaDoc;
19
20 import org.apache.avalon.framework.component.Component;
21 import org.apache.avalon.framework.parameters.ParameterException;
22 import org.apache.avalon.framework.parameters.Parameters;
23 import org.apache.cocoon.portal.PortalService;
24 import org.apache.cocoon.portal.layout.Layout;
25 import org.xml.sax.ContentHandler JavaDoc;
26 import org.xml.sax.SAXException JavaDoc;
27
28 /**
29  * A renderer aspect extends a renderer with a distinct functionality.
30  * It can add a particular decoration like a border or buttons for example.
31  * A renderer aspect has to be thread safe!
32  *
33  * @author <a HREF="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
34  * @author <a HREF="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
35  *
36  * @version CVS $Id: RendererAspect.java 330865 2005-11-04 18:54:05Z rgoers $
37  */

38 public interface RendererAspect
39     extends Component {
40     
41     String JavaDoc ROLE = RendererAspect.class.getName();
42     
43     /**
44      * Stream out raw layout
45      */

46     void toSAX(RendererAspectContext context,
47                 Layout layout,
48                 PortalService service,
49                 ContentHandler JavaDoc handler)
50     throws SAXException JavaDoc;
51
52     /**
53      * Return the aspects required for this renderer
54      * @return An iterator for the aspect descriptions or null.
55      */

56     Iterator JavaDoc getAspectDescriptions(Object JavaDoc preparedConfiguration);
57
58     /**
59      * Compile the configuration.
60      * A renderer aspect can "compile" the configuration in
61      * order to increase performance.
62      * If the renderer does not want to compile it should
63      * simply return the configuration.
64      * The "compiled" configuration is passed to the
65      * {@link #getAspectDescriptions(Object)} method and
66      * is available during streaming via the context object.
67      * This method can also be used for validation the configuration.
68      */

69     Object JavaDoc prepareConfiguration(Parameters configuration)
70     throws ParameterException;
71
72     boolean isRequired();
73 }
74
Popular Tags