01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.wicket.markup;
18:
19: import org.apache.wicket.MarkupContainer;
20: import org.apache.wicket.util.resource.IResourceStream;
21:
22: /**
23: * To be implemented by MarkupContainer which whish to implement there own
24: * algorithms for loading the markup resource stream.
25: * <p>
26: * Note: IResourceStreamLocators should be used in case the strategy to find a
27: * markup resource is meant to be applied to ALL components of your application.
28: * <p>
29: * Note: See IMarkupCacheKeyProvider if you whish to implement your own cache
30: * key algorithm, which sometimes is useful when the MarkupContainer implements
31: * its own IMarkupResourceStreamProvider as well.
32: *
33: * @see IMarkupCacheKeyProvider
34: *
35: * @author Juergen Donnerstag
36: */
37: public interface IMarkupResourceStreamProvider {
38: /**
39: * Create a new markup resource stream for the container.
40: * <p>
41: * Note: usually it will only called once, as the IResourceStream will be
42: * cached by MarkupCache.
43: *
44: * @param container
45: * The MarkupContainer which requests to load the Markup resource
46: * stream
47: * @param containerClass
48: * The container the markup should be associated with
49: * @return A IResourceStream if the resource was found
50: */
51: IResourceStream getMarkupResourceStream(
52: final MarkupContainer container, Class containerClass);
53: }
|