01: /*
02:
03: Licensed to the Apache Software Foundation (ASF) under one or more
04: contributor license agreements. See the NOTICE file distributed with
05: this work for additional information regarding copyright ownership.
06: The ASF licenses this file to You under the Apache License, Version 2.0
07: (the "License"); you may not use this file except in compliance with
08: the License. You may obtain a copy of the License at
09:
10: http://www.apache.org/licenses/LICENSE-2.0
11:
12: Unless required by applicable law or agreed to in writing, software
13: distributed under the License is distributed on an "AS IS" BASIS,
14: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: See the License for the specific language governing permissions and
16: limitations under the License.
17:
18: */
19: package org.apache.batik.bridge;
20:
21: import java.util.Iterator;
22:
23: import org.w3c.dom.Element;
24:
25: /**
26: * This is a Service interface for classes that want to extend the
27: * functionality of the Bridge, to support new tags in the rendering tree.
28: *
29: * @author <a href="mailto:thomas.deweese@kodak.com">Thomas DeWeese</a>
30: * @version $Id: BridgeExtension.java 478160 2006-11-22 13:35:06Z dvholten $
31: */
32: public interface BridgeExtension {
33:
34: /**
35: * Return the priority of this Extension. Extensions are
36: * registered from lowest to highest priority. So if for some
37: * reason you need to come before/after another existing extension
38: * make sure your priority is lower/higher than theirs.
39: */
40: float getPriority();
41:
42: /**
43: * This should return the list of extensions implemented
44: * by this BridgeExtension, these are added to the list of
45: * requiredExtensions that the User Agent supports for purposes
46: * of the 'switch' element in SVG.
47: * @return An iterator containing strings one for each implemented
48: * extension.
49: */
50: Iterator getImplementedExtensions();
51:
52: /**
53: * This should return the individual or company name responsible
54: * for the this implementation of the extension.
55: */
56: String getAuthor();
57:
58: /**
59: * This should return a contact address (usually an e-mail address).
60: */
61: String getContactAddress();
62:
63: /**
64: * This should return a URL where information can be obtained on
65: * this extension.
66: */
67: String getURL();
68:
69: /**
70: * Human readable description of the extension.
71: * Perhaps that should be a resource for internationalization?
72: * (although I suppose it could be done internally)
73: */
74: String getDescription();
75:
76: /**
77: * This method should update the BridgeContext with support
78: * for the tags in this extension. In some rare cases it may
79: * be necessary to replace existing tag handlers, although this
80: * is discouraged.
81: *
82: * @param ctx The BridgeContext instance to be updated
83: */
84: void registerTags(BridgeContext ctx);
85:
86: /**
87: * Whether the presence of the specified element should cause
88: * the document to be dynamic. If this element isn't handled
89: * by this BridgeExtension, just return false.
90: *
91: * @param e The element to check.
92: */
93: boolean isDynamicElement(Element e);
94: }
|