From: Marco Zanon Date: Mon, 10 Jul 2017 12:48:25 +0000 (+0000) Subject: Moved all constants to MConstants. X-Git-Tag: 5.0.0~2 X-Git-Url: https://gitweb.marcozanon.com/?a=commitdiff_plain;h=dda7de53a7fff609f067199c891ca37eda051812;p=Macaco Moved all constants to MConstants. --- diff --git a/src/java/com/marcozanon/macaco/MInformation.java b/src/java/com/marcozanon/macaco/MInformation.java index 79791ea..32a9516 100644 --- a/src/java/com/marcozanon/macaco/MInformation.java +++ b/src/java/com/marcozanon/macaco/MInformation.java @@ -12,14 +12,10 @@ import java.io.StringWriter; public class MInformation extends MObject { - public static final String MACACO_VERSION = "5.x"; - - public static final String TEXT_ENCODING = "UTF-8"; - /* Generic information. */ public static String getMacacoVersion() { - return MInformation.MACACO_VERSION; + return MConstants.MACACO_VERSION; } public static String getMacacoFullName() { diff --git a/src/java/com/marcozanon/macaco/logging/MLogPlainTextFile.java b/src/java/com/marcozanon/macaco/logging/MLogPlainTextFile.java index 9b2011f..20b4bb7 100644 --- a/src/java/com/marcozanon/macaco/logging/MLogPlainTextFile.java +++ b/src/java/com/marcozanon/macaco/logging/MLogPlainTextFile.java @@ -6,6 +6,7 @@ package com.marcozanon.macaco.logging; +import com.marcozanon.macaco.MConstants; import com.marcozanon.macaco.MInformation; import com.marcozanon.macaco.text.MText; import java.io.BufferedWriter; @@ -34,7 +35,7 @@ public class MLogPlainTextFile extends MLogTarget { // this.file = file; try { - this.buffer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(this.getFile(), true), MInformation.TEXT_ENCODING)); + this.buffer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(this.getFile(), true), MConstants.TEXT_ENCODING)); } catch (FileNotFoundException exception) { throw new MLoggingException("Could not open file.", exception); diff --git a/src/java/com/marcozanon/macaco/text/MText.java b/src/java/com/marcozanon/macaco/text/MText.java index f89852b..44fdb03 100644 --- a/src/java/com/marcozanon/macaco/text/MText.java +++ b/src/java/com/marcozanon/macaco/text/MText.java @@ -6,6 +6,7 @@ package com.marcozanon.macaco.text; +import com.marcozanon.macaco.MConstants; import com.marcozanon.macaco.MInformation; import com.marcozanon.macaco.MObject; import java.io.BufferedInputStream; @@ -371,7 +372,7 @@ public class MText extends MObject { String text = x; // StringBuilder fakeXhtmlPageContent = new StringBuilder(""); - fakeXhtmlPageContent.append(String.format("", MInformation.TEXT_ENCODING)); + fakeXhtmlPageContent.append(String.format("", MConstants.TEXT_ENCODING)); fakeXhtmlPageContent.append(""); fakeXhtmlPageContent.append(""); fakeXhtmlPageContent.append("</head>"); @@ -421,7 +422,7 @@ public class MText extends MObject { }); // - reader.parse(new InputSource(new ByteArrayInputStream(fakeXhtmlPageContent.toString().getBytes(MInformation.TEXT_ENCODING)))); + reader.parse(new InputSource(new ByteArrayInputStream(fakeXhtmlPageContent.toString().getBytes(MConstants.TEXT_ENCODING)))); } catch (ParserConfigurationException exception) { // cannot happen } diff --git a/src/java/com/marcozanon/macaco/text/MTranslator.java b/src/java/com/marcozanon/macaco/text/MTranslator.java index 8c3f8e3..cdddd3b 100644 --- a/src/java/com/marcozanon/macaco/text/MTranslator.java +++ b/src/java/com/marcozanon/macaco/text/MTranslator.java @@ -6,6 +6,7 @@ package com.marcozanon.macaco.text; +import com.marcozanon.macaco.MConstants; import com.marcozanon.macaco.MInformation; import com.marcozanon.macaco.MObject; import java.io.FileInputStream; @@ -74,7 +75,7 @@ public class MTranslator extends MObject { // LineNumberReader buffer = null; try { - buffer = new LineNumberReader(new InputStreamReader(new FileInputStream(file), MInformation.TEXT_ENCODING)); + buffer = new LineNumberReader(new InputStreamReader(new FileInputStream(file), MConstants.TEXT_ENCODING)); } catch (FileNotFoundException exception) { throw new MTranslationFileParsingException("Could not open file.", exception);