diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-06 08:55:09 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-08-12 09:41:28 +0200 |
commit | 0477e6c39b7ce8b7f6560fbf222c19fe4f358dc8 (patch) | |
tree | 218eba20dd23c6a865cf01aa7532bf1261a69bc8 /xmerge | |
parent | e2e55a7c49079dfd896da6515b98d451e4c8735b (diff) |
java: add @Override annotation to overriding methods
Change-Id: I086964c6f6ce52c60c52b6dbc445d3c21d22c80a
Diffstat (limited to 'xmerge')
20 files changed, 46 insertions, 6 deletions
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PalmDB.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PalmDB.java index 5a24b43c4426..18356e0fe1fc 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PalmDB.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PalmDB.java @@ -402,6 +402,7 @@ public final class PalmDB { * @return true if <code>obj</code> is equal to this, otherwise * false. */ + @Override public boolean equals(Object obj) { boolean bool = false; diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/Record.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/Record.java index d3f68bd47ee1..b66d1cab6303 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/Record.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/Record.java @@ -172,6 +172,7 @@ public final class Record { * * @return true if obj is equal, otherwise false. */ + @Override public boolean equals(Object obj) { boolean bool = false; diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/EmbeddedBinaryObject.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/EmbeddedBinaryObject.java index 95e4a6f272d5..18635b275814 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/EmbeddedBinaryObject.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/EmbeddedBinaryObject.java @@ -92,6 +92,7 @@ public class EmbeddedBinaryObject extends EmbeddedObject { * @param zip An <code>OfficeZip</code> instance representing the file * the data is to be written to. */ + @Override void write(OfficeZip zip) { if (hasChanged) { zip.setNamedBytes(objName, objData); @@ -103,6 +104,7 @@ public class EmbeddedBinaryObject extends EmbeddedObject { * Package private method that constructs the manifest.xml entries for this * embedded object. */ + @Override void writeManifestData(Document manifestDoc) throws DOMException { Element objNode = manifestDoc.createElement(OfficeConstants.TAG_MANIFEST_FILE); diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/EmbeddedXMLObject.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/EmbeddedXMLObject.java index f0c3a728ef5b..7711879006cb 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/EmbeddedXMLObject.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/EmbeddedXMLObject.java @@ -219,6 +219,7 @@ public class EmbeddedXMLObject extends EmbeddedObject { * @param zip An <code>OfficeZip</code> instance representing the file * the data is to be written to. */ + @Override void write(OfficeZip zip) throws IOException { if (hasChanged == true) { if (contentDOM != null) { @@ -242,6 +243,7 @@ public class EmbeddedXMLObject extends EmbeddedObject { * * @param manifestDoc <code>Document</code> containing the manifest entries. */ + @Override void writeManifestData(Document manifestDoc) throws DOMException { Node root = manifestDoc.getDocumentElement(); diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/ParaStyle.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/ParaStyle.java index ba409f6cb40d..53d5202a7c5b 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/ParaStyle.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/ParaStyle.java @@ -34,6 +34,7 @@ abstract class conversionAlgorithm { * This algorithm expects only values in millimeters, e.g. "20.3mm". */ class horizSize extends conversionAlgorithm { + @Override int I(String value) { if (value.endsWith("mm")) { float size = (float)0.0; @@ -59,6 +60,7 @@ class horizSize extends conversionAlgorithm { * a percentage. */ class lineHeight extends conversionAlgorithm { + @Override int I(String value) { if (value.endsWith("mm")) { float size = (float)0.0; @@ -91,6 +93,7 @@ class lineHeight extends conversionAlgorithm { * This class converts alignment values. */ class alignment extends conversionAlgorithm { + @Override int I(String value) { if (value.equals("end")) return ParaStyle.ALIGN_RIGHT; diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/ColumnStyle.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/ColumnStyle.java index 4a8d87c11b1b..8122562932c2 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/ColumnStyle.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/ColumnStyle.java @@ -165,6 +165,7 @@ public class ColumnStyle extends Style implements Cloneable { * @return The <code>Style</code> in which to look up * ancestors. */ + @Override public Style getResolved() { // Create a new object to return, which is a clone of this one. ColumnStyle resolved = null; @@ -215,6 +216,7 @@ public class ColumnStyle extends Style implements Cloneable { * * @return Created <code>Node</code>. */ + @Override public Node createNode(org.w3c.dom.Document parentDoc, String name) { Element node = parentDoc.createElement(name); writeAttributes(node); @@ -231,6 +233,7 @@ public class ColumnStyle extends Style implements Cloneable { * @return true if <code>style</code> is a subset, false * otherwise. */ + @Override public boolean isSubset(Style style) { if (style.getClass() != this.getClass()) return false; diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/Format.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/Format.java index d39a4d9f1da5..44e025204485 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/Format.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/Format.java @@ -380,7 +380,8 @@ public class Format implements Cloneable { * * @return A string indicating the value and category. */ - public String toString() { + @Override + public String toString() { return new String("Value : " + getValue() + " Category : " + getCategory()); } diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/RowStyle.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/RowStyle.java index 4d0d2f091317..1e4ca4cd375d 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/RowStyle.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/RowStyle.java @@ -165,6 +165,7 @@ public class RowStyle extends Style implements Cloneable { * @return The <code>StyleCatalog</code> in which to look up * ancestors. */ + @Override public Style getResolved() { // Create a new object to return, which is a clone of this one. RowStyle resolved = null; @@ -215,6 +216,7 @@ public class RowStyle extends Style implements Cloneable { * * @return Created <code>Node</code>. */ + @Override public Node createNode(org.w3c.dom.Document parentDoc, String name) { Element node = parentDoc.createElement(name); writeAttributes(node); @@ -231,6 +233,7 @@ public class RowStyle extends Style implements Cloneable { * @return true if <code>style</code> is a subset, false * otherwise. */ + @Override public boolean isSubset(Style style) { if (style.getClass() != this.getClass()) return false; diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocument.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocument.java index e41a2f4df724..fe977d8fa482 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocument.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocument.java @@ -57,6 +57,7 @@ public class SxcDocument extends OfficeDocument { * * @return The Office file extension for the SXC format. */ + @Override protected String getFileExtension() { return OfficeConstants.SXC_FILE_EXTENSION; } @@ -66,6 +67,7 @@ public class SxcDocument extends OfficeDocument { * * @return The Office attribute for the SXC format. */ + @Override protected String getOfficeClassAttribute() { return OfficeConstants.SXC_TYPE; } @@ -75,6 +77,7 @@ public class SxcDocument extends OfficeDocument { * * @return String The document's MIME type. */ + @Override protected final String getDocumentMimeType() { return OfficeConstants.SXC_MIME_TYPE; } diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcPluginFactory.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcPluginFactory.java index 39ec87bfdf0a..b034dcab2dda 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcPluginFactory.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcPluginFactory.java @@ -50,6 +50,7 @@ public abstract class SxcPluginFactory } + @Override public Document createOfficeDocument(String name, InputStream is) throws IOException { @@ -60,7 +61,8 @@ public abstract class SxcPluginFactory return doc; } - 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 diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxw/SxwDocument.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxw/SxwDocument.java index a0a269fa2d3e..8728319d953e 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxw/SxwDocument.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxw/SxwDocument.java @@ -58,6 +58,7 @@ public class SxwDocument extends OfficeDocument { * * @return The Office file extension for the SXW format. */ + @Override protected String getFileExtension() { return OfficeConstants.SXW_FILE_EXTENSION; } @@ -68,6 +69,7 @@ public class SxwDocument extends OfficeDocument { * * @return The Office attribute for the SXW format. */ + @Override protected String getOfficeClassAttribute() { return OfficeConstants.SXW_TYPE; } @@ -77,6 +79,7 @@ public class SxwDocument extends OfficeDocument { * * @return String The document's MIME type. */ + @Override protected final String getDocumentMimeType() { return OfficeConstants.SXW_MIME_TYPE; } diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxw/SxwPluginFactory.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxw/SxwPluginFactory.java index 7eb3585cfc2d..c0cb42d1a122 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxw/SxwPluginFactory.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxw/SxwPluginFactory.java @@ -46,6 +46,7 @@ public abstract class SxwPluginFactory extends PluginFactory { } + @Override public Document createOfficeDocument(String name, InputStream is) throws IOException { @@ -55,7 +56,8 @@ public abstract class SxwPluginFactory extends PluginFactory { return doc; } - public Document createOfficeDocument(String name, InputStream is,boolean isZip) + @Override + public Document createOfficeDocument(String name, InputStream is,boolean isZip) throws IOException { // read XML stream diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/GenericOfficeDocument.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/GenericOfficeDocument.java index 1cbe6e52b237..f06f90ec4c32 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/GenericOfficeDocument.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/GenericOfficeDocument.java @@ -56,6 +56,7 @@ public class GenericOfficeDocument extends OfficeDocument { * * @return The Office file extension for the generic format. */ + @Override protected String getFileExtension() { return ""; } @@ -65,6 +66,7 @@ public class GenericOfficeDocument extends OfficeDocument { * * @return The Office attribute for the generic format. */ + @Override protected String getOfficeClassAttribute() { return ""; @@ -75,6 +77,7 @@ public class GenericOfficeDocument extends OfficeDocument { * * @return String The document's MIME type. */ + @Override protected String getDocumentMimeType() { /* TODO: Determine the MIME-type from the input. */ return ""; 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 39aa2b3a9c63..11c29459a2e2 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 @@ -95,7 +95,8 @@ public final class PluginFactoryImpl extends PluginFactory return new DocumentDeserializerImpl(this,cd); } - public org.openoffice.xmerge.Document createDeviceDocument(java.lang.String str, java.io.InputStream inputStream) throws java.io.IOException { + @Override + public org.openoffice.xmerge.Document createDeviceDocument(java.lang.String str, java.io.InputStream inputStream) throws java.io.IOException { String ext = this.getDeviceFileExtension(); DOMDocument domDoc = new DOMDocument(str,ext); domDoc.read(inputStream); @@ -103,7 +104,8 @@ public final class PluginFactoryImpl extends PluginFactory } - public Document createOfficeDocument(String name, InputStream is) + @Override + public Document createOfficeDocument(String name, InputStream is) throws IOException { // read zipped XML stream @@ -112,7 +114,8 @@ public final class PluginFactoryImpl extends PluginFactory return doc; } - 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 diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/Difference.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/Difference.java index 7378f5b1be98..feccb757a085 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/Difference.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/Difference.java @@ -176,6 +176,7 @@ public final class Difference { * * @return true if equal, false otherwise. */ + @Override public boolean equals(Object obj) { if (obj instanceof Difference) { Difference diff = (Difference) obj; @@ -223,6 +224,7 @@ public final class Difference { * * @return orgPosition, modPosition and operation as a single string. */ + @Override public String toString() { return orgPosition + " " + modPosition + " " + operation; diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CellNodeIterator.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CellNodeIterator.java index c2cad735c5f9..9e7eb332d6a5 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CellNodeIterator.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CellNodeIterator.java @@ -61,6 +61,7 @@ public final class CellNodeIterator extends NodeIterator { * * @return true if the <code>Node</code> is supported, false otherwise. */ + @Override protected boolean nodeSupported(Node node) { // can use an array later to check all possible tags for @@ -70,6 +71,7 @@ public final class CellNodeIterator extends NodeIterator { } + @Override protected boolean childrenEqual(Node node1, Node node2) { boolean equal = false; diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/ParaNodeIterator.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/ParaNodeIterator.java index 48d63474f648..a5e8b9e6ff7e 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/ParaNodeIterator.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/ParaNodeIterator.java @@ -63,6 +63,7 @@ public final class ParaNodeIterator extends NodeIterator { * @return true if the <code>Node</code> is supported, false * otherwise. */ + @Override protected boolean nodeSupported(Node node) { // can use an array later to check all possible tags for diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/RowIterator.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/RowIterator.java index 02ac53f37a4c..9425d4c1bb70 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/RowIterator.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/RowIterator.java @@ -52,6 +52,7 @@ public final class RowIterator extends NodeIterator { * * @return true if the <code>Node</code> is supported, false otherwise. */ + @Override protected boolean nodeSupported(Node node) { // can use an array later to check all possible tags for diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/TextNodeIterator.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/TextNodeIterator.java index 61b886b99aa1..791122c398dc 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/TextNodeIterator.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/TextNodeIterator.java @@ -56,6 +56,7 @@ public final class TextNodeIterator extends NodeIterator { * @return true if the <code>Node</code> is supported, false * otherwise. */ + @Override protected boolean nodeSupported(Node node) { // can use an array later to check all possible tags for diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/SheetMerge.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/SheetMerge.java index 0af951fe0337..60e19e3d6712 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/SheetMerge.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/SheetMerge.java @@ -51,6 +51,7 @@ public final class SheetMerge extends DocumentMerge { * * @param node <code>Node</code> to remove. */ + @Override protected void removeNode(Node node) { clearRow(node); |