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.markup.parser.IMarkupFilter;
20: import org.apache.wicket.markup.parser.XmlPullParser;
21: import org.apache.wicket.settings.IMarkupSettings;
22:
23: /**
24: * Default implementation of IMarkupParserFactory. It creates a MarkupParser
25: * with a standard set of IMarkupFilter. You may add IMarkupFilters like shown
26: * below, but don't forget to register your own MarkupParserFactory with
27: * Settings to become activated.
28: *
29: * <pre>
30: * class MyMarkupParserFactory
31: * {
32: * ...
33: * public MarkupParser newMarkupParser(final MarkupResourceStream resource)
34: * {
35: * MarkupParser parser = new MarkupParser(new XmlPullParser(), resource);
36: * parser.appendMarkupFilter(new MyOwnFilter());
37: * return parser;
38: * }
39: * ...
40: * }
41: * </pre>
42: *
43: * @see IMarkupFilter
44: * @see MarkupParser
45: * @see IMarkupSettings
46: *
47: * @author Igor Vaynberg (ivaynberg)
48: * @author Juergen Donnerstag
49: */
50: public class MarkupParserFactory implements IMarkupParserFactory {
51: /**
52: * Construct.
53: *
54: */
55: public MarkupParserFactory() {
56: }
57:
58: /**
59: * @see org.apache.wicket.markup.IMarkupParserFactory#newMarkupParser(org.apache.wicket.markup.MarkupResourceStream)
60: */
61: public MarkupParser newMarkupParser(
62: final MarkupResourceStream resource) {
63: return new MarkupParser(new XmlPullParser(), resource);
64: }
65: }
|