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;
25 
26 import org.openoffice.xmerge.converter.xml.OfficeDocument;
27 import org.openoffice.xmerge.converter.xml.OfficeConstants;
28 
29 /**
30  *  This class is an implementation of <code>OfficeDocument</code> for
31  *  the SXW format.
32  */
33 public class SxwDocument extends OfficeDocument {
34 
35 
36     /**
37      *  Constructor with arguments to set <code>name</code>.
38      *
39      *  @param  name  The name of the <code>Document</code>
40      */
SxwDocument(String name)41     public SxwDocument(String name) {
42         super(name);
43     }
44 
45 
46     /**
47      *  Constructor with arguments to set <code>name</code>, the
48      *  <code>namespaceAware</code> flag, and the <code>validating</code>
49      *  flag.
50      *
51      *  @param  name            The name of the <code>Document</code>.
52      *  @param  namespaceAware  The value of the namespaceAware flag.
53      *  @param  validating      The value of the validating flag.
54      */
SxwDocument(String name, boolean namespaceAware, boolean validating)55     public SxwDocument(String name, boolean namespaceAware, boolean validating) {
56 
57         super(name, namespaceAware, validating);
58     }
59 
60 
61     /**
62      *  Returns the Office file extension for the SXW format.
63      *
64      *  @return  The Office file extension for the SXW format.
65      */
getFileExtension()66     protected String getFileExtension() {
67         return OfficeConstants.SXW_FILE_EXTENSION;
68     }
69 
70 
71     /**
72      *  Returns the Office attribute for the SXW format.
73      *
74      *  @return  The Office attribute for the SXW format.
75      */
getOfficeClassAttribute()76     protected String getOfficeClassAttribute() {
77         return OfficeConstants.SXW_TYPE;
78     }
79 
80     /**
81      * Method to return the MIME type of the document.
82      *
83      * @return  String  The document's MIME type.
84      */
getDocumentMimeType()85     protected final String getDocumentMimeType() {
86         return OfficeConstants.SXW_MIME_TYPE;
87     }
88 
89 }
90 
91