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.loader;
18:
19: import java.io.IOException;
20:
21: import org.apache.wicket.MarkupContainer;
22: import org.apache.wicket.markup.Markup;
23: import org.apache.wicket.markup.MarkupCache;
24: import org.apache.wicket.markup.MarkupParser;
25: import org.apache.wicket.markup.MarkupParserFactory;
26: import org.apache.wicket.markup.MarkupResourceStream;
27: import org.apache.wicket.util.resource.ResourceStreamNotFoundException;
28:
29: /**
30: * IMarkupLoader are loading the actual markup for a specific Wicket container
31: * and resource stream. In case of markup inheritance it means that 2+ markup
32: * files must be read and merged. In order to be flexible the interface has been
33: * designed in a way that multiple IMarkupLoader can be chained to easily build
34: * up more complex loaders.
35: *
36: * @see MarkupCache
37: * @see MarkupParser
38: * @see MarkupParserFactory
39: *
40: * @author Juergen Donnerstag
41: */
42: public interface IMarkupLoader {
43: /**
44: * Loads markup from a resource stream.
45: *
46: * @param container
47: * The original requesting markup container
48: * @param markupResourceStream
49: * The markup resource stream to load
50: * @param baseLoader
51: * This parameter can be use to chain IMarkupLoaders
52: * @param enforceReload
53: * The cache will be ignored and all, including inherited markup
54: * files, will be reloaded. Whatever is in the cache, it will be
55: * ignored
56: * @return The markup
57: * @throws IOException
58: * @throws ResourceStreamNotFoundException
59: */
60: Markup loadMarkup(final MarkupContainer container,
61: final MarkupResourceStream markupResourceStream,
62: final IMarkupLoader baseLoader, final boolean enforceReload)
63: throws IOException, ResourceStreamNotFoundException;
64: }
|