1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 package org.openoffice.xmerge.converter.xml.sxw.aportisdoc;
25 
26 import org.openoffice.xmerge.ConverterCapabilities;
27 import org.openoffice.xmerge.converter.xml.OfficeConstants;
28 
29 /**
30  *  <p>AportisDoc implementation of <code>ConverterCapabilities</code> for
31  *  the {@link
32  *  org.openoffice.xmerge.converter.xml.sxw.aportisdoc.PluginFactoryImpl
33  *  PluginFactoryImpl}.</p>
34  *
35  *  <p>Used with StarWriter XML to/from AportisDoc conversions.  The
36  *  <code>ConverterCapibilies</code> specify which &quot;Office&quot;
37  *  <code>Document</code> tags and attributes are supported on the
38  *  &quot;Device&quot; <code>Document</code> format.</p>
39  */
40 public final class ConverterCapabilitiesImpl
41     implements ConverterCapabilities {
42 
canConvertTag(String tag)43     public boolean canConvertTag(String tag) {
44 
45         if (OfficeConstants.TAG_OFFICE_DOCUMENT.equals(tag))
46             return true;
47         else if (OfficeConstants.TAG_OFFICE_DOCUMENT_CONTENT.equals(tag))
48             return true;
49         else if (OfficeConstants.TAG_OFFICE_BODY.equals(tag))
50             return true;
51         else if (OfficeConstants.TAG_PARAGRAPH.equals(tag))
52             return true;
53         else if (OfficeConstants.TAG_HEADING.equals(tag))
54             return true;
55         else if (OfficeConstants.TAG_ORDERED_LIST.equals(tag))
56             return true;
57         else if (OfficeConstants.TAG_UNORDERED_LIST.equals(tag))
58             return true;
59         else if (OfficeConstants.TAG_LIST_ITEM.equals(tag))
60             return true;
61         else if (OfficeConstants.TAG_LIST_HEADER.equals(tag))
62             return true;
63         else if (OfficeConstants.TAG_SPAN.equals(tag))
64             return true;
65         else if (OfficeConstants.TAG_HYPERLINK.equals(tag))
66             return true;
67         else if (OfficeConstants.TAG_LINE_BREAK.equals(tag))
68             return true;
69         else if (OfficeConstants.TAG_SPACE.equals(tag))
70             return true;
71         else if (OfficeConstants.TAG_TAB_STOP.equals(tag))
72             return true;
73 
74         return false;
75     }
76 
canConvertAttribute(String tag, String attribute)77     public boolean canConvertAttribute(String tag,
78                                        String attribute) {
79 
80         if (OfficeConstants.TAG_SPACE.equals(tag)) {
81 
82             if (OfficeConstants.ATTRIBUTE_SPACE_COUNT.equals(attribute))
83                 return true;
84         }
85 
86         return false;
87     }
88 }
89 
90