mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-19 00:35:20 +01:00
Refine JavaDoc and move Log filters to 'output'
This commit is contained in:
parent
690a8d67a3
commit
b0e619d412
@ -17,6 +17,8 @@ import fr.xephi.authme.hooks.BungeeCordMessage;
|
||||
import fr.xephi.authme.hooks.EssSpawn;
|
||||
import fr.xephi.authme.listener.*;
|
||||
import fr.xephi.authme.modules.ModuleManager;
|
||||
import fr.xephi.authme.output.ConsoleFilter;
|
||||
import fr.xephi.authme.output.Log4JFilter;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.output.Messages;
|
||||
import fr.xephi.authme.permission.PermissionsManager;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package fr.xephi.authme;
|
||||
package fr.xephi.authme.output;
|
||||
|
||||
import java.util.logging.Filter;
|
||||
import java.util.logging.LogRecord;
|
||||
@ -7,20 +7,9 @@ import java.util.logging.LogRecord;
|
||||
* Console filter Class
|
||||
*
|
||||
* @author Xephi59
|
||||
* @version $Revision: 1.0 $
|
||||
*/
|
||||
public class ConsoleFilter implements Filter {
|
||||
|
||||
public ConsoleFilter() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Method isLoggable.
|
||||
*
|
||||
* @param record LogRecord
|
||||
*
|
||||
* @return boolean * @see java.util.logging.Filter#isLoggable(LogRecord)
|
||||
*/
|
||||
@Override
|
||||
public boolean isLoggable(LogRecord record) {
|
||||
try {
|
@ -1,4 +1,4 @@
|
||||
package fr.xephi.authme;
|
||||
package fr.xephi.authme.output;
|
||||
|
||||
import fr.xephi.authme.util.StringUtils;
|
||||
import org.apache.logging.log4j.Level;
|
||||
@ -11,7 +11,6 @@ import org.apache.logging.log4j.message.Message;
|
||||
* Implements a filter for Log4j to skip sensitive AuthMe commands.
|
||||
*
|
||||
* @author Xephi59
|
||||
* @version $Revision: 1.0 $
|
||||
*/
|
||||
public class Log4JFilter implements org.apache.logging.log4j.core.Filter {
|
||||
|
@ -6,6 +6,8 @@ import org.bukkit.command.CommandSender;
|
||||
|
||||
/**
|
||||
* Class for retrieving and sending translatable messages to players.
|
||||
* This class detects when the language settings have changed and will
|
||||
* automatically update to use a new language file.
|
||||
*/
|
||||
public class Messages {
|
||||
|
||||
@ -19,6 +21,11 @@ public class Messages {
|
||||
this.manager = manager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the instance of Messages.
|
||||
*
|
||||
* @return The Messages instance
|
||||
*/
|
||||
public static Messages getInstance() {
|
||||
if (singleton == null) {
|
||||
MessagesManager manager = new MessagesManager(Settings.messageFile);
|
||||
@ -65,6 +72,9 @@ public class Messages {
|
||||
return StringUtils.join("\n", retrieve(key));
|
||||
}
|
||||
|
||||
/**
|
||||
* Reload the messages manager.
|
||||
*/
|
||||
public void reloadManager() {
|
||||
manager = new MessagesManager(Settings.messageFile);
|
||||
}
|
||||
|
@ -6,7 +6,10 @@ import fr.xephi.authme.settings.CustomConfiguration;
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* Class for retrieving and sending translatable messages to players.
|
||||
* Class responsible for reading messages from a file and formatting them for Minecraft.
|
||||
* <p />
|
||||
* This class is used within {@link Messages}, which offers a high-level interface for accessing
|
||||
* or sending messages from a properties file.
|
||||
*/
|
||||
class MessagesManager extends CustomConfiguration {
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
package fr.xephi.authme;
|
||||
package fr.xephi.authme.output;
|
||||
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.junit.Assert.assertThat;
|
||||
@ -12,8 +12,6 @@ import org.mockito.Mockito;
|
||||
|
||||
/**
|
||||
* Test for {@link Log4JFilter}.
|
||||
* @author Gabriele
|
||||
* @version $Revision: 1.0 $
|
||||
*/
|
||||
public class Log4JFilterTest {
|
||||
|
@ -20,7 +20,8 @@ public class PlayerPermissionTest {
|
||||
// when/then
|
||||
for (PlayerPermission permission : PlayerPermission.values()) {
|
||||
if (!permission.getNode().startsWith(requiredPrefix)) {
|
||||
fail("The permission '" + permission + "' does not start with the required prefix '" + requiredPrefix + "'");
|
||||
fail("The permission '" + permission + "' does not start with the required prefix '" + requiredPrefix
|
||||
+ "'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user