From: Marco Zanon <info@marcozanon.com>
Date: Mon, 10 Jul 2017 12:48:25 +0000 (+0000)
Subject: Moved all constants to MConstants.
X-Git-Tag: SVN-to-Git~66
X-Git-Url: https://gitweb.marcozanon.com/?a=commitdiff_plain;h=02cc67db358e8fc526d727e5d8d2f4bb1ad0635a;p=Macaco

Moved all constants to MConstants.
---

diff --git a/5.x/src/java/com/marcozanon/macaco/MInformation.java b/5.x/src/java/com/marcozanon/macaco/MInformation.java
index 79791ea..32a9516 100644
--- a/5.x/src/java/com/marcozanon/macaco/MInformation.java
+++ b/5.x/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/5.x/src/java/com/marcozanon/macaco/logging/MLogPlainTextFile.java b/5.x/src/java/com/marcozanon/macaco/logging/MLogPlainTextFile.java
index 9b2011f..20b4bb7 100644
--- a/5.x/src/java/com/marcozanon/macaco/logging/MLogPlainTextFile.java
+++ b/5.x/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/5.x/src/java/com/marcozanon/macaco/text/MText.java b/5.x/src/java/com/marcozanon/macaco/text/MText.java
index f89852b..44fdb03 100644
--- a/5.x/src/java/com/marcozanon/macaco/text/MText.java
+++ b/5.x/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("<?xml version=\"1.0\" encoding=\"%s\" ?>", MInformation.TEXT_ENCODING));
+        fakeXhtmlPageContent.append(String.format("<?xml version=\"1.0\" encoding=\"%s\" ?>", MConstants.TEXT_ENCODING));
         fakeXhtmlPageContent.append("<!DOCTYPE html SYSTEM \"fake-dtd\" >");
         fakeXhtmlPageContent.append("<html xmlns=\"http://www.w3.org/1999/xhtml\">");
         fakeXhtmlPageContent.append("<head><title /></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/5.x/src/java/com/marcozanon/macaco/text/MTranslator.java b/5.x/src/java/com/marcozanon/macaco/text/MTranslator.java
index 8c3f8e3..cdddd3b 100644
--- a/5.x/src/java/com/marcozanon/macaco/text/MTranslator.java
+++ b/5.x/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);