Modified the comments to better fit the (virtual) coding guidelines.
authorMarco Zanon <info@marcozanon.com>
Tue, 27 Oct 2015 14:13:23 +0000 (14:13 +0000)
committerMarco Zanon <info@marcozanon.com>
Tue, 27 Oct 2015 14:13:23 +0000 (14:13 +0000)
22 files changed:
4.x/src/java/com/marcozanon/macaco/MInformation.java
4.x/src/java/com/marcozanon/macaco/conversion/MDateConverter.java
4.x/src/java/com/marcozanon/macaco/conversion/MNumberConverter.java
4.x/src/java/com/marcozanon/macaco/json/MJsonArray.java
4.x/src/java/com/marcozanon/macaco/json/MJsonBoolean.java
4.x/src/java/com/marcozanon/macaco/json/MJsonNull.java
4.x/src/java/com/marcozanon/macaco/json/MJsonNumber.java
4.x/src/java/com/marcozanon/macaco/json/MJsonObject.java
4.x/src/java/com/marcozanon/macaco/json/MJsonString.java
4.x/src/java/com/marcozanon/macaco/json/MJsonValue.java
4.x/src/java/com/marcozanon/macaco/logging/MLogDatabaseTable.java
4.x/src/java/com/marcozanon/macaco/logging/MLogFilter.java
4.x/src/java/com/marcozanon/macaco/logging/MLogMessage.java
4.x/src/java/com/marcozanon/macaco/logging/MLogPlainTextFile.java
4.x/src/java/com/marcozanon/macaco/logging/MLogTarget.java
4.x/src/java/com/marcozanon/macaco/sql/MSqlConnection.java
4.x/src/java/com/marcozanon/macaco/sql/MSqlConnectionGenerator.java
4.x/src/java/com/marcozanon/macaco/sql/MSqlConnectionPool.java
4.x/src/java/com/marcozanon/macaco/sql/MSqlStatementResults.java
4.x/src/java/com/marcozanon/macaco/sql/MSqlTable.java
4.x/src/java/com/marcozanon/macaco/text/MText.java
4.x/src/java/com/marcozanon/macaco/text/MTranslator.java

index a7d0a67dfdcccb254282380ac379a7d1cfd47812..c2766cfd4b9beb5fd221b37a9a8453f53ba2d59f 100644 (file)
@@ -16,7 +16,7 @@ public class MInformation extends MObject {
 
     public static final String TEXT_ENCODING = "UTF-8";
 
-    /* Macaco information */
+    /* Generic information. */
 
     public static String getMacacoVersion() {
         return MInformation.MACACO_VERSION;
@@ -35,7 +35,7 @@ public class MInformation extends MObject {
         return s.toString();
     }
 
-    /* Exceptions */
+    /* Exceptions. */
 
     public static String getExceptionAsString(Exception exception) {
         if (null == exception) {
index 37c6afd486937471996f64717d36a551875c449c..4a53334e59de94955dc92f6414612a27f361cf51 100644 (file)
@@ -50,7 +50,7 @@ public class MDateConverter extends MObject {
         return new MDateConverter(this.getDateFormats(), this.getLocale(), this.getTimeZone());
     }
 
-    /* Date formats */
+    /* Date formats. */
 
     public void setDateFormats(LinkedHashSet<String> dateFormats) {
         if (null == dateFormats) {
@@ -93,7 +93,7 @@ public class MDateConverter extends MObject {
         return this.getDateFormatsReference().iterator().next();
     }
 
-    /* Locale */
+    /* Locale. */
 
     protected void setLocale(Locale locale) {
         if (null == locale) {
@@ -107,7 +107,7 @@ public class MDateConverter extends MObject {
         return this.locale;
     }
 
-    /* Time zone */
+    /* Time zone. */
 
     protected void setTimeZone(TimeZone timeZone) {
         if (null == timeZone) {
@@ -125,7 +125,7 @@ public class MDateConverter extends MObject {
         return (TimeZone)this.getTimeZoneReference().clone();
     }
 
-    /* Conversion */
+    /* Conversions. */
 
     protected static void checkDateFormat(String dateFormat) {
         if (MText.isBlank(dateFormat)) {
@@ -216,7 +216,7 @@ public class MDateConverter extends MObject {
         return this.getStringFromDateByParameters(x, this.getDefaultDateFormat(), this.getLocale(), this.getTimeZoneReference());
     }
 
-    /* Helper methods */
+    /* Helpers. */
 
     public static Date getFlatDate(Date x) {
         if (null == x) {
index 6bcc00808d6404c7699e581e28640b2184107e63..2b69a632d1d7ca49ab78908be3745a1479cb79f7 100644 (file)
@@ -41,7 +41,7 @@ public class MNumberConverter extends MObject {
         return new MNumberConverter(this.getNumberFormats(), this.getLocale());
     }
 
-    /* Number formats */
+    /* Number formats. */
 
     public void setNumberFormats(LinkedHashSet<String> numberFormats) {
         if (null == numberFormats) {
@@ -84,7 +84,7 @@ public class MNumberConverter extends MObject {
         return this.getNumberFormatsReference().iterator().next();
     }
 
-    /* Locale */
+    /* Locale. */
 
     protected void setLocale(Locale locale) {
         if (null == locale) {
@@ -98,7 +98,7 @@ public class MNumberConverter extends MObject {
         return this.locale;
     }
 
-    /* Conversion */
+    /* Conversions. */
 
     protected static void checkNumberFormat(String numberFormat) {
         if (MText.isBlank(numberFormat)) {
index 10f680b606065a1c931bb18517742a126e010f22..1b170bc931764621958956976c497a18381ed16c 100644 (file)
@@ -42,7 +42,7 @@ public class MJsonArray extends MJsonValue {
         return tmpMJsonArray;
     }
 
-    /* Values handlers */
+    /* Value handlers. */
 
     public void addValue(MJsonValue x) {
         if (null == x) {
@@ -91,7 +91,7 @@ public class MJsonArray extends MJsonValue {
         this.getValuesReference().clear();
     }
 
-    /* Parsers */
+    /* Parsers. */
 
     protected static int getTokenLength(String x) {
         if (null == x) {
@@ -190,7 +190,7 @@ public class MJsonArray extends MJsonValue {
         }
     }
 
-    /* Formatter */
+    /* Formatter. */
 
     public String getJsonValue() {
         StringBuilder s = new StringBuilder("");
index a3c4162003498a6ba41bd362a2009d83008a71e4..313e9c581daac48981d1ab30292b76f6e9f24837 100644 (file)
@@ -34,7 +34,7 @@ public class MJsonBoolean extends MJsonValue {
         return tmpMJsonBoolean;
     }
 
-    /* Value handlers */
+    /* Value handlers. */
 
     public void setValue(Boolean x) {
         if (null == x) {
@@ -48,7 +48,7 @@ public class MJsonBoolean extends MJsonValue {
         return this.value;
     }
 
-    /* Parsers */
+    /* Parsers. */
 
     protected static int getTokenLength(String x) {
         if (null == x) {
@@ -75,7 +75,7 @@ public class MJsonBoolean extends MJsonValue {
         this.setValue(Boolean.valueOf(x));
     }
 
-    /* Formatter */
+    /* Formatter. */
 
     public String getJsonValue() {
         return this.getValue().toString();
index 44263401f3c298442aa0ec336516c7611984e88f..356916a483081a27d7f8b87833baa57319482ce6 100644 (file)
@@ -32,7 +32,7 @@ public class MJsonNull extends MJsonValue {
         return tmpMJsonNull;
     }
 
-    /* Parsers */
+    /* Parsers. */
 
     protected static int getTokenLength(String x) {
         if (null == x) {
@@ -55,7 +55,7 @@ public class MJsonNull extends MJsonValue {
         }
     }
 
-    /* Formatter */
+    /* Formatter. */
 
     public String getJsonValue() {
         return "null";
index 044360360fbda1ea0d2957299427bd439eaaa7a6..5bd485982e6454d3bfd22f19c4843dcd275b214a 100644 (file)
@@ -35,7 +35,7 @@ public class MJsonNumber extends MJsonValue {
         return tmpMJsonNumber;
     }
 
-    /* Value handlers */
+    /* Value handlers. */
 
     public void setValue(Number x) {
         if (null == x) {
@@ -49,7 +49,7 @@ public class MJsonNumber extends MJsonValue {
         return this.value;
     }
 
-    /* Parsers */
+    /* Parsers. */
 
     protected static int getTokenLength(String x) {
         if (null == x) {
@@ -95,7 +95,7 @@ public class MJsonNumber extends MJsonValue {
         this.setValue(y);
     }
 
-    /* Formatter */
+    /* Formatter. */
 
     public String getJsonValue() {
         return this.getValue().toString();
index bb42c7f248aae673e7e6a8f940235b02b9174446..6c5060ac983b458c9e10821f8f863e1f85e8caf2 100644 (file)
@@ -45,7 +45,7 @@ public class MJsonObject extends MJsonValue {
         return tmpMJsonObject;
     }
 
-    /* Values handlers */
+    /* Value handlers. */
 
     public void setValue(String key, MJsonValue x) {
         if (MText.isBlank(key)) {
@@ -108,7 +108,7 @@ public class MJsonObject extends MJsonValue {
         return keys;
     }
 
-    /* Parsers */
+    /* Parsers. */
 
     protected static int getTokenLength(String x) {
         if (null == x) {
@@ -240,7 +240,7 @@ public class MJsonObject extends MJsonValue {
         }
     }
 
-    /* Formatter */
+    /* Formatter. */
 
     public String getJsonValue() {
         StringBuilder s = new StringBuilder("");
index ba42617abef55b6ea55d0cfccc0ec8efb53b6f93..173c0c49113e548471664ce576856cf894eac290 100644 (file)
@@ -41,7 +41,7 @@ public class MJsonString extends MJsonValue {
         return tmpMJsonString;
     }
 
-    /* Extended escape mode */
+    /* Extended escape mode. */
 
     public void setExtendedEscapeMode(boolean extendedEscapeMode) {
         this.extendedEscapeMode = extendedEscapeMode;
@@ -51,7 +51,7 @@ public class MJsonString extends MJsonValue {
         return this.extendedEscapeMode;
     }
 
-    /* Value handlers */
+    /* Value handlers. */
 
     public void setValue(String x) {
         if (null == x) {
@@ -65,7 +65,7 @@ public class MJsonString extends MJsonValue {
         return this.value;
     }
 
-    /* Helpers */
+    /* Helpers. */
 
     protected static String getEscapedString(String x, boolean extendedEscapeMode) {
         if (null == x) {
@@ -235,7 +235,7 @@ public class MJsonString extends MJsonValue {
         return y.toString();
     }
 
-    /* Parsers */
+    /* Parsers. */
 
     protected static int getTokenLength(String x) {
         if (null == x) {
@@ -283,7 +283,7 @@ public class MJsonString extends MJsonValue {
         this.setValue(MJsonString.getUnescapedString(y));
     }
 
-    /* Formatter */
+    /* Formatter. */
 
     public String getJsonValue() {
         return "\"" + MJsonString.getEscapedString(this.getValue(), this.getExtendedEscapeMode()) + "\"";
index e08b7a94177d0d092db287c77928cdd726848b86..ac63400677890356cb59942f6a202dc32d7f7378 100644 (file)
@@ -14,7 +14,7 @@ public abstract class MJsonValue extends MObject {
 
     public abstract MJsonValue clone();
 
-    /* Helpers */
+    /* Helpers. */
 
     protected static boolean isWhitespace(int c) {
         return ((' ' == c) || ('\t' == c) || ('\n' == c) || ('\r' == c));
@@ -36,7 +36,7 @@ public abstract class MJsonValue extends MObject {
         return ((']' == c) || ('}' == c));
     }
 
-    /* Formatter */
+    /* Formatter. */
 
     public abstract String getJsonValue();
 
index ed0a1960f91809d267a683f4966be49f47cadf1c..5c4610b4254340ebc5d64fbea89837dd3558ac14 100644 (file)
@@ -59,13 +59,13 @@ public class MLogDatabaseTable extends MLogTarget {
         }
     }
 
-    /* Sql connection generator */
+    /* Sql connection generator. */
 
     protected MSqlConnectionGenerator getSqlConnectionGeneratorReference() {
         return this.sqlConnectionGenerator;
     }
 
-    /* Logging database parameters */
+    /* Database logging parameters. */
 
     protected String getLogDatabaseTable() {
         return this.logDatabaseTable;
@@ -79,13 +79,13 @@ public class MLogDatabaseTable extends MLogTarget {
         return this.logDatabaseField;
     }
 
-    /* Sql connection */
+    /* Sql connection. */
 
     protected MSqlConnection getSqlConnectionReference() {
         return this.sqlConnection;
     }
 
-    /* Output */
+    /* Output. */
 
     public void appendMessage(String message) throws MLoggingException {
         this.appendMessage(message, 0);
index 5a380af05082d1215099e9554600590f09905b78..4669c922fe73b3a5c7b81e3e87a82afe1282a050 100644 (file)
@@ -46,7 +46,7 @@ public class MLogFilter extends MObject {
         }
     }
 
-    /* Threshold */
+    /* Threshold. */
 
     public void setThreshold(MLogFilter.Threshold threshold) {
         if (null == threshold) {
@@ -60,7 +60,7 @@ public class MLogFilter extends MObject {
         return this.threshold;
     }
 
-    /* Log targets */
+    /* Log targets. */
 
     public void addLogTarget(MLogTarget logTarget) {
         if (null == logTarget) {
@@ -76,7 +76,7 @@ public class MLogFilter extends MObject {
         return this.logTargets;
     }
 
-    /* Output */
+    /* Output. */
 
     public void setPausedState(boolean pausedState) throws MLoggingException {
         this.pausedState = pausedState;
index becf101787db4649341530f58d18d3fc37e7a61c..018ed714649ad372160cebca58e5336ff645e14e 100644 (file)
@@ -27,7 +27,7 @@ public class MLogMessage extends MObject {
         this.indentation = indentation;
     }
 
-    /* Values */
+    /* Values. */
 
     public String getMessage() {
         return this.message;
index 45f0a649af12d85e9b6abec74f33c6cb5d52a70b..0f225d51fe31f6d93c84ed1512f50ceab8a232cd 100644 (file)
@@ -52,19 +52,19 @@ public class MLogPlainTextFile extends MLogTarget {
         }
     }
 
-    /* File */
+    /* File. */
 
     protected String getFile() {
         return this.file;
     }
 
-    /* Buffer */
+    /* Buffer. */
 
     protected BufferedWriter getBufferReference() {
         return this.buffer;
     }
 
-    /* Output */
+    /* Output. */
 
     public void appendMessage(String message) throws MLoggingException {
         this.appendMessage(message, 0);
index 01a256ffe499915817d7b4ef69ab159c48595734..7e9bb7a7ef0ed890b321e52a44ee15f8259a282c 100644 (file)
@@ -22,7 +22,7 @@ public abstract class MLogTarget extends MObject {
         }
     }
 
-    /* Output */
+    /* Output. */
 
     public abstract void appendMessage(String message) throws MLoggingException;
 
index 9ea683eb818f9a7b10ab32719e62db6cc127f220..dc8c5ea66c877845400856247e8a7fd57332f759 100644 (file)
@@ -53,7 +53,7 @@ public class MSqlConnection extends MObject {
         this.url = url;
         this.username = username;
         this.password = password;
-        // load driver
+        // Load driver.
         try {
             Class.forName(this.getDriver()).newInstance();
         }
@@ -66,14 +66,14 @@ public class MSqlConnection extends MObject {
         catch (InstantiationException exception) {
             throw new MSqlConnectionFailureException("Could not load driver.", exception);
         }
-        // establish connection
+        // Establish a connection.
         try {
             this.connection = DriverManager.getConnection(this.getUrl(), this.getUsername(), this.getPassword());
         }
         catch (SQLException exception) {
             throw new MSqlConnectionFailureException("Could not get connection.", exception);
         }
-        // set SQL mode
+        // Set SQL mode to standard ANSI.
         try {
             this.getConnectionReference().createStatement().executeUpdate("SET SQL_MODE='ANSI'");
         }
@@ -108,37 +108,37 @@ public class MSqlConnection extends MObject {
         }
     }
 
-    /* Driver */
+    /* Driver. */
 
     public String getDriver() {
         return this.driver;
     }
 
-    /* Url */
+    /* Url. */
 
     public String getUrl() {
         return this.url;
     }
 
-    /* Username */
+    /* Username. */
 
     public String getUsername() {
         return this.username;
     }
 
-    /* Password */
+    /* Password. */
 
     public String getPassword() {
         return this.password;
     }
 
-    /* Connection */
+    /* Connection. */
 
     protected Connection getConnectionReference() {
         return this.connection;
     }
 
-    /* Transactions */
+    /* Transactions. */
 
     protected void setTransactionStatus(MSqlConnection.TransactionStatus transactionStatus) {
         if (null == transactionStatus) {
@@ -202,7 +202,7 @@ public class MSqlConnection extends MObject {
         }
     }
 
-    /* Statements */
+    /* Statements. */
 
     public MSqlStatementResults executePreparedStatement(String statement) throws MSqlStatementException {
         return this.executePreparedStatement(statement, new LinkedList<Object>());
@@ -219,12 +219,12 @@ public class MSqlConnection extends MObject {
         MSqlStatementResults results = null;
         PreparedStatement preparedStatement = null;
         try {
-            // prepare the statement
+            // Prepare the statement.
             preparedStatement = this.getConnectionReference().prepareStatement(statement, PreparedStatement.RETURN_GENERATED_KEYS);
             for (int p = 0; parameters.size() > p; p++) {
                 preparedStatement.setObject(p + 1, parameters.get(p));
             }
-            // execute the statement and parse the results
+            // Execute the statement and parse the results.
             preparedStatement.execute();
             results = new MSqlStatementResults(preparedStatement);
         }
@@ -237,7 +237,7 @@ public class MSqlConnection extends MObject {
         return results;
     }
 
-    /* Tables */
+    /* Tables. */
 
     public MSqlTable getTable(String table, String primaryKey) {
         return new MSqlTable(this, table, primaryKey);
index f33036537378473e49ac98625977d44f7c355153..79f0a676308e423fd7610d4f6e48bd091bc23321 100644 (file)
@@ -40,31 +40,31 @@ public class MSqlConnectionGenerator extends MObject {
         this.password = password;
     }
 
-    /* Driver */
+    /* Driver. */
 
     public String getDriver() {
         return this.driver;
     }
 
-    /* Url */
+    /* Url. */
 
     public String getUrl() {
         return this.url;
     }
 
-    /* Username */
+    /* Username. */
 
     public String getUsername() {
         return this.username;
     }
 
-    /* Password */
+    /* Password. */
 
     public String getPassword() {
         return this.password;
     }
 
-    /* Generator */
+    /* Generator. */
 
     public MSqlConnection getConnection() throws MSqlConnectionFailureException {
         return new MSqlConnection(this.getDriver(), this.getUrl(), this.getUsername(), this.getPassword());
index 5315211ea25abfc4519653537261cd7e35e9ae87..4a5e24f6f541677b4091fa61a4e23b6fb78bb81f 100644 (file)
@@ -39,13 +39,13 @@ public class MSqlConnectionPool extends MObject {
         this.initializeConnectionPool();
     }
 
-    /* Connection generator */
+    /* Connection generator. */
 
     protected MSqlConnectionGenerator getConnectionGenerator() {
         return this.connectionGenerator;
     }
 
-    /* Connection pool */
+    /* Connection pool. */
 
     protected int getMinimumSize() {
         return this.minimumSize;
index 5c496e7ce08a5bda75e08ede6cbbf45ef6bcd584..459d228de36ddc94679ebbf9b1201cbcd320681f 100644 (file)
@@ -87,7 +87,7 @@ public class MSqlStatementResults extends MObject {
         }
     }
 
-    /* References */
+    /* References. */
 
     protected PreparedStatement getPreparedStatementReference() {
         return this.preparedStatement;
@@ -97,7 +97,7 @@ public class MSqlStatementResults extends MObject {
         return this.resultSet;
     }
 
-    /* Records */
+    /* Records. */
 
     protected LinkedList<LinkedHashMap<String, Object>> getRecordsReference() {
         return this.records;
@@ -131,7 +131,7 @@ public class MSqlStatementResults extends MObject {
         return recordsByField;
     }
 
-    /* Generated keys */
+    /* Generated keys. */
 
     protected LinkedHashSet<Object> getGeneratedKeysReference() {
         return this.generatedKeys;
index acbc6d490c535ad60c38f35b531f12b9c288fabd..e172e77bc0259dd082e336ee20619ade6020b6f9 100644 (file)
@@ -38,25 +38,25 @@ public class MSqlTable extends MObject {
         this.primaryKey = primaryKey;
     }
 
-    /* Connection */
+    /* Connection. */
 
     protected MSqlConnection getConnectionReference() {
         return this.connection;
     }
 
-    /* Table */
+    /* Table. */
 
     public String getTable() {
         return this.table;
     }
 
-    /* Primary key */
+    /* Primary key. */
 
     public String getPrimaryKey() {
         return this.primaryKey;
     }
 
-    /* Statements */
+    /* Statements. */
 
     protected MSqlStatementResults insertRecord(LinkedHashMap<String, Object> map) throws MSqlStatementException {
         if (null == map) {
index 7b5fd84bbddc52317c77d01e9d67c6ed6f02dc24..a25c4f00f1703732a177b40bd2e0a94905cfdd29 100644 (file)
@@ -26,7 +26,7 @@ import org.xml.sax.helpers.DefaultHandler;
 
 public class MText extends MObject {
 
-    /* Checks */
+    /* Checks. */
 
     public static boolean isEmpty(String x) {
         if ((null != x) && ("".equals(x))) {
@@ -42,7 +42,7 @@ public class MText extends MObject {
         return false;
     }
 
-    /* Utility methods */
+    /* Utility methods. */
 
     public static String repeat(String x, int times) {
         if (1 > times) {
@@ -69,7 +69,7 @@ public class MText extends MObject {
         return y.toString();
     }
 
-    /* Javascript escape */
+    /* Javascript escape. */
 
     public static String getJavascriptEscapedString(String x) {
         if (null == x) {
@@ -84,7 +84,7 @@ public class MText extends MObject {
         return text;
     }
 
-    /* Xhtml escape and safety */
+    /* Xhtml escape and safety. */
 
     public static String getXhtmlEscapedString(String x) { // similar to PHP's htmlspecialchars()
         if (null == x) {
@@ -377,7 +377,7 @@ public class MText extends MObject {
         fakeXhtmlPageContent.append("<head><title /></head>");
         fakeXhtmlPageContent.append(String.format("<body>%s</body>", text));
         fakeXhtmlPageContent.append("</html>");
-        // validate Xhtml (without dangerous tags and event attributes)
+        // Validate Xhtml (with no dangerous tags and event attributes).
         try {
             SAXParserFactory factory = SAXParserFactory.newInstance();
             factory.setValidating(true);
@@ -432,7 +432,7 @@ public class MText extends MObject {
         }
         catch (IOException exception) { // cannot happen; put here not to bypass UnsupportedEncodingException
         }
-        // also convert named entities to numeric entities
+        // Also convert named entities to numeric entities.
         return MText.getXhtmlNumericEntitiesString(text);
     }
 
index 3e88e5b02bf09a49bf6c33e29eb62104eb915881..9e2a3b5359aa2205c833b75d606f6b9136ef0b36 100644 (file)
@@ -49,19 +49,19 @@ public class MTranslator extends MObject {
         return tmpMTranslator;
     }
 
-    /* File */
+    /* File. */
 
     protected String getFile() {
         return this.file;
     }
 
-    /* Locale */
+    /* Locale. */
 
     protected Locale getBasicLocale() {
         return this.basicLocale;
     }
 
-    /* Strings management */
+    /* String management. */
 
     protected LinkedHashMap<String, LinkedHashMap<String, String>> getMessagesReference() {
         return this.messages;