summaryrefslogtreecommitdiff
path: root/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/PluginFactoryImpl.java
diff options
context:
space:
mode:
authorrbuj <robert.buj@gmail.com>2014-09-04 15:58:32 +0200
committerNoel Grandin <noelgrandin@gmail.com>2014-09-04 09:08:09 -0500
commita5a9457609e8bbe76a8c6d620b81b8666c2e4491 (patch)
tree9651dc29fa39243b87b0ffc79b20b6d5305f0a42 /xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/PluginFactoryImpl.java
parent8e4dc1d760d85e09bbc3f3bbb5b8be2947db1b63 (diff)
xmerge: javadoc maintenance and minor code formatting
Javadoc: * Replaces <code>..</code> tags with {@code ..}. * Replaces HTML entities with {@literal ..} * Removes <p>..</p> tags in the first sentence. * Reduces code snippet spacing. * Adds tables. * Uses only one space after a comment delimiter. * Adjusts the margins. Minor code formating: * Removes some extra blank lines (very few). * Fixes some indentations (very few). * Adjusts the margins in some method headers (very few). Change-Id: I01bd9df58e4cb41bc3a38a2b2d3d7d2612081c32 Reviewed-on: https://gerrit.libreoffice.org/11202 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/PluginFactoryImpl.java')
-rw-r--r--xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/PluginFactoryImpl.java144
1 files changed, 60 insertions, 84 deletions
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/PluginFactoryImpl.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/PluginFactoryImpl.java
index 593ed3402c5c..c89fb72329aa 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/PluginFactoryImpl.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/PluginFactoryImpl.java
@@ -37,21 +37,18 @@ import org.openoffice.xmerge.converter.dom.DOMDocument;
import org.openoffice.xmerge.util.registry.ConverterInfo;
/**
- * <p>Xslt implementation of the <code>PluginFactory</code>.
- * This encapsulates conversion of StarWriter XML format to and from
- * a supported format.</p>
+ * Xslt implementation of the {@code PluginFactory}.
*
- * <p>The superclass produces a particular
- * {@link org.openoffice.xmerge.Document Document}
- * object, i.e. {@link
- * org.openoffice.xmerge.converter.xml.sxw.SxwDocument
- * SxwDocument} that the converters in this class work with. Thus,
- * this class only implements the methods that produces the converters,
- * i.e. {@link
- * org.openoffice.xmerge.DocumentSerializer
- * DocumentSerializer} and {@link
- * org.openoffice.xmerge.DocumentDeserializer
- * DocumentDeserializer}</p>
+ * <p>This encapsulates conversion of StarWriter XML format to and from a
+ * supported format.</p>
+ *
+ * <p>The superclass produces a particular {@link org.openoffice.xmerge.Document
+ * Document} object, i.e. {@link
+ * org.openoffice.xmerge.converter.xml.sxw.SxwDocument xwDocument} that the
+ * converters in this class work with. Thus, this class only implements the
+ * methods that produces the converters, i.e. {@link
+ * org.openoffice.xmerge.DocumentSerializer DocumentSerializer} and {@link
+ * org.openoffice.xmerge.DocumentDeserializer DocumentDeserializer}</p>
*/
public final class PluginFactoryImpl extends PluginFactory
implements DocumentDeserializerFactory, DocumentSerializerFactory, DocumentMergerFactory
@@ -65,46 +62,41 @@ public final class PluginFactoryImpl extends PluginFactory
private final static ConverterCapabilities converterCap =
new ConverterCapabilitiesImpl();
-
/**
- * Returns an instance of <code>DocumentSerializerImpl</code>,
- * which is an implementation of the <code>DocumentSerializer</code>
- * interface.
+ * Returns an instance of {@code DocumentSerializerImpl}, which is an
+ * implementation of the {@code DocumentSerializer} interface.
*
- * @param doc <code>Document</code> object to be
- * converted/serialized.
+ * @param doc {@code Document} object to be converted/serialized.
*
- * @return A <code>DocumentSerializerImpl</code> object.
+ * @return A {@code DocumentSerializerImpl} object.
*/
public DocumentSerializer createDocumentSerializer(Document doc) {
return new DocumentSerializerImpl(this,doc);
}
-
/**
- * Returns an instance of <code>DocumentDeserializerImpl</code>,
- * which is an implementation of the <code>DocumentDeserializer</code>
- * interface.
+ * Returns an instance of <code>DocumentDeserializerImpl</code>,
+ * which is an implementation of the <code>DocumentDeserializer</code>
+ * interface.
*
- * @param cd <code>ConvertData</code> object.
+ * @param cd {@code ConvertData} object.
*
- * @return A DocumentDeserializerImpl object.
+ * @return A {@code DocumentDeserializerImpl} object.
*/
public DocumentDeserializer createDocumentDeserializer(ConvertData cd) {
-
return new DocumentDeserializerImpl(this,cd);
}
- @Override
- public org.openoffice.xmerge.Document createDeviceDocument(String str, java.io.InputStream inputStream) throws java.io.IOException {
+ @Override
+ public org.openoffice.xmerge.Document createDeviceDocument(String str,
+ java.io.InputStream inputStream) throws java.io.IOException {
String ext = this.getDeviceFileExtension();
DOMDocument domDoc = new DOMDocument(str,ext);
domDoc.read(inputStream);
return domDoc;
}
-
- @Override
+ @Override
public Document createOfficeDocument(String name, InputStream is)
throws IOException {
@@ -114,8 +106,8 @@ public final class PluginFactoryImpl extends PluginFactory
return doc;
}
- @Override
- public Document createOfficeDocument(String name, InputStream is,boolean isZip)
+ @Override
+ public Document createOfficeDocument(String name, InputStream is, boolean isZip)
throws IOException {
// read zipped XML stream
@@ -125,67 +117,51 @@ public final class PluginFactoryImpl extends PluginFactory
}
/**
- * Returns a <code>String</code> containing the file extension of a
- * <code>Document</code>. This method uses a properties file to determine
- * a mapping from the device mime in the <code>ConverterInfo</code> to a
- * particular file extension. If a mapping is not specified, the default
- * is ".txt".
+ * Returns a {@code String} containing the file extension of a
+ * {@code Document}.
+ *
+ * <p>This method uses a properties file to determine a mapping from the
+ * device mime in the {@code ConverterInfo} to a particular file extension.
+ * If a mapping is not specified, the default is ".txt".</p>
*
- * @return <code>String</code>.
+ * @return The file extension of a {@code Document}.
*/
-
-
- public String getDeviceFileExtension(){
- Class<? extends PluginFactoryImpl> c = this.getClass();
- InputStream is = c.getResourceAsStream("XsltPlugin.properties");
- Properties props = new Properties();
- String ext= ".txt";
- String mimeType = null;
- ConverterInfo ci = this.getConverterInfo();
- Iterator<String> enumerate = ci.getDeviceMime();
- while (enumerate.hasNext()) {
- mimeType= enumerate.next();
- }
- try {
- props.load(is);
-
- String info = props.getProperty(mimeType);
- if (info != null) {
- ext = info;
- }
- } catch (Exception e) {
+ public String getDeviceFileExtension() {
+ Class<? extends PluginFactoryImpl> c = this.getClass();
+ InputStream is = c.getResourceAsStream("XsltPlugin.properties");
+ Properties props = new Properties();
+ String ext = ".txt";
+ String mimeType = null;
+ ConverterInfo ci = this.getConverterInfo();
+ Iterator<String> enumerate = ci.getDeviceMime();
+ while (enumerate.hasNext()) {
+ mimeType = enumerate.next();
+ }
+ try {
+ props.load(is);
+
+ String info = props.getProperty(mimeType);
+ if (info != null) {
+ ext = info;
+ }
+ } catch (Exception e) {
// It is okay for the property file to not exist.
-
- }
- return ext;
+ }
+ return ext;
}
/**
- * Returns an instance of <code>DocumentMergerImpl</code>,
- * which is an implementation of the <code>DocumentMerger</code>
- * interface.
+ * Returns an instance of {@code DocumentMergerImpl}, which is an
+ * implementation of the {@code DocumentMerger} interface.
*
- * @param doc <code>Document</code> to merge.
+ * @param doc {@code Document} to merge.
*
- * @return A DocumentMergerImpl object.
+ * @return A {@code DocumentMergerImpl} object.
*/
public DocumentMerger createDocumentMerger(Document doc) {
- ConverterCapabilities cc = converterCap;
+ ConverterCapabilities cc = converterCap;
DocumentMergerImpl merger = new DocumentMergerImpl(doc, cc);
return merger;
-
}
-
-}
-
-
-
-
-
-
-
-
-
-
-
+} \ No newline at end of file