KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > fop > fo > extensions > xmp > XMPElementMapping


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * 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
18 /* $Id$ */
19
20 package org.apache.fop.fo.extensions.xmp;
21
22 import java.util.HashMap JavaDoc;
23
24 import org.apache.fop.fo.FONode;
25 import org.apache.fop.fo.ElementMapping;
26 import org.apache.xmlgraphics.xmp.XMPConstants;
27
28 import org.w3c.dom.DOMImplementation JavaDoc;
29
30 /**
31  * Setup the element mapping for XMP metadata.
32  */

33 public class XMPElementMapping extends ElementMapping {
34     
35     /** Main constructor. */
36     public XMPElementMapping() {
37         namespaceURI = XMPConstants.XMP_NAMESPACE;
38     }
39
40     /** @see org.apache.fop.fo.ElementMapping#getDOMImplementation() */
41     public DOMImplementation JavaDoc getDOMImplementation() {
42         return getDefaultDOMImplementation();
43     }
44
45     /** @see org.apache.fop.fo.ElementMapping#initialize() */
46     protected void initialize() {
47         if (foObjs == null) {
48             foObjs = new HashMap JavaDoc();
49             foObjs.put("xmpmeta", new XMPMetaElementMaker());
50         }
51     }
52
53     static class XMPMetaElementMaker extends ElementMapping.Maker {
54         public FONode make(FONode parent) {
55             return new XMPMetaElement(parent);
56         }
57     }
58
59 }
60
Popular Tags