Compare commits
72 commits
Author | SHA1 | Date | |
---|---|---|---|
8bd0896415 | |||
20580fb80b | |||
a45f010196 | |||
69cf668c4d | |||
7560e150af | |||
b643735d0b | |||
d12206b925 | |||
dde8972feb | |||
6425442c25 | |||
d1d8e305ed | |||
a6a41f5cec | |||
7cf9a4f418 | |||
ea93d12151 | |||
c533a06148 | |||
4281f946be | |||
5021f2cc35 | |||
edd28bef2f | |||
7c0b7e1e90 | |||
0966a43d5e | |||
2730aa0f61 | |||
ed1c8b9d3e | |||
d3a01c2c66 | |||
a21ef1bc5f | |||
a619746e8d | |||
e42ac8a08e | |||
ffcf4604a4 | |||
6f8d190d6f | |||
c2028cfa33 | |||
40894bedba | |||
6d7701a7c3 | |||
665ea05041 | |||
37ac235662 | |||
01ea995177 | |||
294ec217ea | |||
4c9bfb3732 | |||
f6c99b66e8 | |||
643bda6c28 | |||
281e7db708 | |||
2d558f8482 | |||
0d5f19ee31 | |||
8456e92a52 | |||
d0a68b22d2 | |||
2cf769b599 | |||
25a944baf4 | |||
f4019455cc | |||
cdde093b31 | |||
8a52e991fd | |||
6cd38377b2 | |||
bed5811b70 | |||
1e6fa79716 | |||
cdd68833cb | |||
175b0248d9 | |||
b3ef38b6be | |||
10e3b26ac0 | |||
7a7da3729c | |||
2f0bc19e7c | |||
9d19dd8b57 | |||
bd05235af9 | |||
a0fdfd2722 | |||
a77794b105 | |||
3bd6a26e59 | |||
5e829771a7 | |||
9922c672f6 | |||
0075b465cd | |||
46b52173fd | |||
26294b3fa0 | |||
f81d27060a | |||
dd4ebcd88a | |||
02aa744098 | |||
a4224f9c51 | |||
b68a7855dc | |||
f1b3bb5b88 |
320 changed files with 8236 additions and 7546 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -42,3 +42,6 @@ bin/
|
||||||
|
|
||||||
### Mac OS ###
|
### Mac OS ###
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
### Java ###
|
||||||
|
hs_err_pid*.log
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* STAROPENSOURCE ENGINE SOURCE FILE
|
* STAROPENSOURCE ENGINE SOURCE FILE
|
||||||
* Copyright (c) 2024 The StarOpenSource Engine Contributors
|
* Copyright (c) 2024 The StarOpenSource Engine Authors
|
||||||
* Licensed under the GNU Affero General Public License v3
|
* Licensed under the GNU Affero General Public License v3
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
@ -16,6 +16,7 @@
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Plugins
|
// Plugins
|
||||||
plugins {
|
plugins {
|
||||||
id("java")
|
id("java")
|
||||||
|
@ -23,9 +24,8 @@ plugins {
|
||||||
id("maven-publish")
|
id("maven-publish")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Project dependencies
|
// Dependencies
|
||||||
dependencies {
|
dependencies {
|
||||||
// -> Runtime <-
|
|
||||||
// Lombok
|
// Lombok
|
||||||
compileOnly("org.projectlombok:lombok:${dependencyLombok}")
|
compileOnly("org.projectlombok:lombok:${dependencyLombok}")
|
||||||
annotationProcessor("org.projectlombok:lombok:${dependencyLombok}")
|
annotationProcessor("org.projectlombok:lombok:${dependencyLombok}")
|
||||||
|
@ -33,36 +33,11 @@ dependencies {
|
||||||
// JetBrains Annotations
|
// JetBrains Annotations
|
||||||
compileOnly("org.jetbrains:annotations:${dependencyJetbrainsAnnotations}")
|
compileOnly("org.jetbrains:annotations:${dependencyJetbrainsAnnotations}")
|
||||||
|
|
||||||
// ANSI support
|
// Jansi
|
||||||
implementation("org.fusesource.jansi:jansi:${dependencyJansi}")
|
implementation("org.fusesource.jansi:jansi:${dependencyJansi}")
|
||||||
|
|
||||||
// Project
|
// Project
|
||||||
implementation(project(":base"))
|
implementation(project(":base"))
|
||||||
|
|
||||||
// -> Testing <-
|
|
||||||
// Jetbrains Annotations
|
|
||||||
testCompileOnly("org.jetbrains:annotations:${dependencyJetbrainsAnnotations}")
|
|
||||||
|
|
||||||
// JUnit
|
|
||||||
testImplementation(platform("org.junit:junit-bom:${dependencyJunit}"))
|
|
||||||
testImplementation("org.junit.jupiter:junit-jupiter")
|
|
||||||
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fix delombok task
|
|
||||||
delombok.doFirst {
|
|
||||||
File target = file("${project.projectDir}/src/main/module-info.java")
|
|
||||||
File source = file("${project.projectDir}/src/main/java/module-info.java")
|
|
||||||
|
|
||||||
target.delete()
|
|
||||||
source.renameTo(target)
|
|
||||||
}
|
|
||||||
delombok.doLast {
|
|
||||||
File target = file("${project.projectDir}/src/main/java/module-info.java")
|
|
||||||
File source = file("${project.projectDir}/src/main/module-info.java")
|
|
||||||
|
|
||||||
target.delete()
|
|
||||||
source.renameTo(target)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Javadoc configuration
|
// Javadoc configuration
|
||||||
|
@ -88,26 +63,6 @@ javadoc {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unit testing configuration
|
|
||||||
test {
|
|
||||||
useJUnitPlatform()
|
|
||||||
|
|
||||||
// Pass test configuration to test VMs
|
|
||||||
Map<String, String> testConfiguration = new HashMap<>();
|
|
||||||
for (String property : project.properties.keySet())
|
|
||||||
if (property.startsWith("test."))
|
|
||||||
testConfiguration.put(property, project.properties.get(property).toString())
|
|
||||||
systemProperties(testConfiguration)
|
|
||||||
|
|
||||||
setMaxParallelForks(project.hasProperty("jobs") ? Integer.parseInt((String) project.property("jobs")) : 8)
|
|
||||||
setForkEvery(1)
|
|
||||||
setFailFast(true)
|
|
||||||
|
|
||||||
testLogging {
|
|
||||||
events("passed", "skipped", "failed")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Include javadoc and source jar during publishing
|
// Include javadoc and source jar during publishing
|
||||||
java {
|
java {
|
||||||
withJavadocJar()
|
withJavadocJar()
|
||||||
|
@ -120,7 +75,7 @@ publishing {
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
maven {
|
||||||
name = "staropensource"
|
name = "staropensource"
|
||||||
url = uri("https://mvn.staropensource.de/sosengine")
|
url = uri("https://mvn.staropensource.de/engine")
|
||||||
credentials(org.gradle.api.credentials.PasswordCredentials)
|
credentials(org.gradle.api.credentials.PasswordCredentials)
|
||||||
authentication {
|
authentication {
|
||||||
//noinspection GroovyAssignabilityCheck
|
//noinspection GroovyAssignabilityCheck
|
||||||
|
@ -139,3 +94,19 @@ publishing {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fix delombok task
|
||||||
|
delombok.doFirst {
|
||||||
|
File target = file("${project.projectDir}/src/main/module-info.java")
|
||||||
|
File source = file("${project.projectDir}/src/main/java/module-info.java")
|
||||||
|
|
||||||
|
target.delete()
|
||||||
|
source.renameTo(target)
|
||||||
|
}
|
||||||
|
delombok.doLast {
|
||||||
|
File target = file("${project.projectDir}/src/main/java/module-info.java")
|
||||||
|
File source = file("${project.projectDir}/src/main/module-info.java")
|
||||||
|
|
||||||
|
target.delete()
|
||||||
|
source.renameTo(target)
|
||||||
|
}
|
||||||
|
|
|
@ -17,16 +17,15 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.ansi;
|
package de.staropensource.engine.ansi;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.EngineConfiguration;
|
import de.staropensource.engine.base.EngineConfiguration;
|
||||||
import de.staropensource.sosengine.base.implementable.LoggingAdapter;
|
import de.staropensource.engine.base.implementable.LoggingAdapter;
|
||||||
import de.staropensource.sosengine.base.logging.Logger;
|
import de.staropensource.engine.base.logging.Logger;
|
||||||
import de.staropensource.sosengine.base.type.logging.LogLevel;
|
import de.staropensource.engine.base.type.logging.LogLevel;
|
||||||
import org.fusesource.jansi.Ansi;
|
import org.fusesource.jansi.Ansi;
|
||||||
import org.fusesource.jansi.AnsiConsole;
|
import org.fusesource.jansi.AnsiConsole;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints colored log output using the Jansi library.
|
* Prints colored log output using the Jansi library.
|
||||||
|
@ -37,34 +36,22 @@ import org.jetbrains.annotations.Nullable;
|
||||||
*/
|
*/
|
||||||
public class AnsiLoggingAdapter implements LoggingAdapter {
|
public class AnsiLoggingAdapter implements LoggingAdapter {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this class.
|
||||||
*
|
*
|
||||||
* @since v1-alpha2
|
* @since v1-alpha2
|
||||||
*/
|
*/
|
||||||
public AnsiLoggingAdapter() {}
|
public AnsiLoggingAdapter() {}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
|
||||||
@Override
|
|
||||||
public @NotNull String prePlaceholder(@NotNull LogLevel level, @NotNull Class<?> issuerClass, @NotNull String issuerOrigin, @Nullable String issuerMetadata, @NotNull String message, @NotNull String format) {
|
|
||||||
return format; // No modifications necessary
|
|
||||||
}
|
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
|
||||||
@Override
|
|
||||||
public @NotNull String postPlaceholder(@NotNull LogLevel level, @NotNull Class<?> issuerClass, @NotNull String issuerOrigin, @Nullable String issuerMetadata, @NotNull String message, @NotNull String format) {
|
|
||||||
return format; // No modifications necessary
|
|
||||||
}
|
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings({ "resource" }) // Using try-with-resources will cause issues here
|
@SuppressWarnings({ "resource" }) // Using try-with-resources will cause issues here
|
||||||
public void print(@NotNull LogLevel level, @NotNull Class<?> issuerClass, @NotNull String issuerOrigin, @Nullable String issuerMetadata, @NotNull String message, @NotNull String format) {
|
public void print(@NotNull LogLevel level, @NotNull StackTraceElement issuer, @NotNull String message, @NotNull String format) {
|
||||||
// Convert to Ansi
|
// Convert to Ansi
|
||||||
Ansi output = new AnsiShortcodeConverter(format, true).getAnsi();
|
Ansi output = new AnsiShortcodeParser(format, true).getAnsi();
|
||||||
|
|
||||||
// Print message
|
// Print message
|
||||||
if (level == LogLevel.ERROR || level == LogLevel.CRASH)
|
if (level == LogLevel.ERROR || level == LogLevel.CRASH)
|
||||||
if (EngineConfiguration.getInstance().isLoggerForceStandardOutput())
|
if (EngineConfiguration.getInstance().isLogForceStandardOutput())
|
||||||
AnsiConsole.out().println(output);
|
AnsiConsole.out().println(output);
|
||||||
else
|
else
|
||||||
AnsiConsole.err().println(output);
|
AnsiConsole.err().println(output);
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.ansi;
|
package de.staropensource.engine.ansi;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.ShortcodeParser;
|
import de.staropensource.engine.base.implementable.ShortcodeParser;
|
||||||
import de.staropensource.sosengine.base.exception.ParserException;
|
import de.staropensource.engine.base.exception.ParserException;
|
||||||
import org.fusesource.jansi.Ansi;
|
import org.fusesource.jansi.Ansi;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
@ -28,21 +28,22 @@ import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts shortcodes such as {@code <bold>} or {@code <blink>} into a usable {@link Ansi} escape sequence.
|
* Implementation of the {@link ShortcodeParser} class
|
||||||
|
* with ANSI support using the Jansi library.
|
||||||
*
|
*
|
||||||
* @see ShortcodeParser
|
* @see ShortcodeParser
|
||||||
* @since v1-alpha2
|
* @since v1-alpha8
|
||||||
*/
|
*/
|
||||||
public final class AnsiShortcodeConverter extends ShortcodeParser {
|
public final class AnsiShortcodeParser extends ShortcodeParser {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this class.
|
||||||
*
|
*
|
||||||
* @param string string to convert
|
* @param string string to convert
|
||||||
* @param ignoreInvalidEscapes will ignore invalid escapes and print treat them like regular text
|
* @param ignoreInvalidEscapes will ignore invalid escapes and print treat them like regular text
|
||||||
* @throws ParserException when parsing failed
|
* @throws ParserException when parsing failed
|
||||||
* @since v1-alpha2
|
* @since v1-alpha2
|
||||||
*/
|
*/
|
||||||
public AnsiShortcodeConverter(@NotNull String string, boolean ignoreInvalidEscapes) throws ParserException {
|
public AnsiShortcodeParser(@NotNull String string, boolean ignoreInvalidEscapes) throws ParserException {
|
||||||
super(string, ignoreInvalidEscapes);
|
super(string, ignoreInvalidEscapes);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,19 +17,19 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.ansi;
|
package de.staropensource.engine.ansi;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.annotation.EngineSubsystem;
|
import de.staropensource.engine.base.annotation.EngineSubsystem;
|
||||||
import de.staropensource.sosengine.base.implementable.SubsystemClass;
|
import de.staropensource.engine.base.implementable.SubsystemClass;
|
||||||
import de.staropensource.sosengine.base.utility.information.EngineInformation;
|
import de.staropensource.engine.base.utility.information.EngineInformation;
|
||||||
import de.staropensource.sosengine.base.implementation.versioning.StarOpenSourceVersioningSystem;
|
import de.staropensource.engine.base.implementation.versioning.StarOpenSourceVersioningSystem;
|
||||||
import de.staropensource.sosengine.base.logging.Logger;
|
import de.staropensource.engine.base.logging.Logger;
|
||||||
import de.staropensource.sosengine.base.type.DependencyVector;
|
import de.staropensource.engine.base.type.DependencyVector;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main object for the ANSI Compatibility subsystem.
|
* Main class of the ANSI Compatibility subsystem.
|
||||||
*
|
*
|
||||||
* @since v1-alpha2
|
* @since v1-alpha2
|
||||||
*/
|
*/
|
||||||
|
@ -50,7 +50,7 @@ public final class AnsiSubsystem extends SubsystemClass {
|
||||||
private static AnsiSubsystem instance = null;
|
private static AnsiSubsystem instance = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs this subsystem.
|
* Initializes this subsystem.
|
||||||
*
|
*
|
||||||
* @since v1-alpha2
|
* @since v1-alpha2
|
||||||
*/
|
*/
|
||||||
|
@ -59,7 +59,7 @@ public final class AnsiSubsystem extends SubsystemClass {
|
||||||
if (instance == null)
|
if (instance == null)
|
||||||
instance = this;
|
instance = this;
|
||||||
else
|
else
|
||||||
logger.crash("Only one instance of this class is allowed, use getInstance() instead of creating a new instance");
|
Logger.crash("Only one instance of this class is allowed, use getInstance() instead of creating a new instance");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
|
@ -20,4 +20,4 @@
|
||||||
/**
|
/**
|
||||||
* Contains the ANSI subsystem code.
|
* Contains the ANSI subsystem code.
|
||||||
*/
|
*/
|
||||||
package de.staropensource.sosengine.ansi;
|
package de.staropensource.engine.ansi;
|
|
@ -16,8 +16,8 @@ module sosengine.ansi {
|
||||||
requires org.fusesource.jansi;
|
requires org.fusesource.jansi;
|
||||||
|
|
||||||
// API access
|
// API access
|
||||||
exports de.staropensource.sosengine.ansi;
|
exports de.staropensource.engine.ansi;
|
||||||
|
|
||||||
// Reflection access
|
// Reflection access
|
||||||
opens de.staropensource.sosengine.ansi;
|
opens de.staropensource.engine.ansi;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<!--
|
<!--
|
||||||
~ STAROPENSOURCE ENGINE SOURCE FILE
|
~ STAROPENSOURCE ENGINE SOURCE FILE
|
||||||
~ Copyright (c) 2024 The StarOpenSource Engine Contributors
|
~ Copyright (c) 2024 The StarOpenSource Engine Authors
|
||||||
~ Licensed under the GNU Affero General Public License v3
|
~ Licensed under the GNU Affero General Public License v3
|
||||||
~
|
~
|
||||||
~ This program is free software: you can redistribute it and/or modify
|
~ This program is free software: you can redistribute it and/or modify
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* STAROPENSOURCE ENGINE SOURCE FILE
|
* STAROPENSOURCE ENGINE SOURCE FILE
|
||||||
* Copyright (c) 2024 The StarOpenSource Engine Contributors
|
* Copyright (c) 2024 The StarOpenSource Engine Authors
|
||||||
* Licensed under the GNU Affero General Public License v3
|
* Licensed under the GNU Affero General Public License v3
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
@ -26,9 +26,9 @@ plugins {
|
||||||
id("maven-publish")
|
id("maven-publish")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Project dependencies
|
// Dependencies
|
||||||
dependencies {
|
dependencies {
|
||||||
// -> Runtime <-
|
// -> Runtime
|
||||||
// Lombok
|
// Lombok
|
||||||
compileOnly("org.projectlombok:lombok:${dependencyLombok}")
|
compileOnly("org.projectlombok:lombok:${dependencyLombok}")
|
||||||
annotationProcessor("org.projectlombok:lombok:${dependencyLombok}")
|
annotationProcessor("org.projectlombok:lombok:${dependencyLombok}")
|
||||||
|
@ -39,7 +39,7 @@ dependencies {
|
||||||
// Reflections
|
// Reflections
|
||||||
implementation("org.reflections:reflections:${dependencyReflections}")
|
implementation("org.reflections:reflections:${dependencyReflections}")
|
||||||
|
|
||||||
// -> Testing <-
|
// -> Testing
|
||||||
// Jetbrains Annotations
|
// Jetbrains Annotations
|
||||||
testCompileOnly("org.jetbrains:annotations:${dependencyJetbrainsAnnotations}")
|
testCompileOnly("org.jetbrains:annotations:${dependencyJetbrainsAnnotations}")
|
||||||
|
|
||||||
|
@ -48,65 +48,10 @@ dependencies {
|
||||||
testImplementation("org.junit.jupiter:junit-jupiter")
|
testImplementation("org.junit.jupiter:junit-jupiter")
|
||||||
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
||||||
|
|
||||||
// -> Project <-
|
// Project
|
||||||
testImplementation(project(":testing"))
|
testImplementation(project(":testing"))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fix delombok task
|
|
||||||
delombok.doFirst {
|
|
||||||
File target = file("${project.projectDir}/src/main/module-info.java")
|
|
||||||
File source = file("${project.projectDir}/src/main/java/module-info.java")
|
|
||||||
|
|
||||||
target.delete()
|
|
||||||
source.renameTo(target)
|
|
||||||
}
|
|
||||||
delombok.doLast {
|
|
||||||
File target = file("${project.projectDir}/src/main/java/module-info.java")
|
|
||||||
File source = file("${project.projectDir}/src/main/module-info.java")
|
|
||||||
|
|
||||||
target.delete()
|
|
||||||
source.renameTo(target)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copy gradle.properties file
|
|
||||||
// for inclusion in final build
|
|
||||||
tasks.register("copyGradleProperties") {
|
|
||||||
doFirst {
|
|
||||||
File target = file("${project.projectDir}/src/main/resources/sosengine-gradle.properties")
|
|
||||||
File source = file(project(":").projectDir.getPath() + "/gradle.properties")
|
|
||||||
target.delete()
|
|
||||||
Files.copy(source.toPath(), target.toPath())
|
|
||||||
}
|
|
||||||
|
|
||||||
outputs.upToDateWhen({ false }) // Force task execution
|
|
||||||
}
|
|
||||||
processResources.dependsOn(copyGradleProperties)
|
|
||||||
|
|
||||||
// Git properties configuration
|
|
||||||
// Allows us to embed git commit information in the engine build
|
|
||||||
gitProperties {
|
|
||||||
dotGitDirectory = file("${rootProject.rootDir}/.git")
|
|
||||||
failOnNoGitDirectory = false // Allow continuing if .git directory is missing for the few who use tarballs
|
|
||||||
extProperty = "gitProps"
|
|
||||||
|
|
||||||
dateFormat = "yyyy-MM-dd'T'HH:mmZ"
|
|
||||||
dateFormatTimeZone = "UTC"
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.register("writeGitProperties") { // This task's only purpose is to copy the git.properties from our git properties plugin to the resources directory so it's included in the final build
|
|
||||||
doLast {
|
|
||||||
File target = file("${project.projectDir}/src/main/resources/sosengine-git.properties")
|
|
||||||
File source = file("${project.projectDir}/build/resources/main/git.properties")
|
|
||||||
|
|
||||||
target.delete()
|
|
||||||
source.renameTo(target)
|
|
||||||
}
|
|
||||||
|
|
||||||
outputs.upToDateWhen({ false }) // Force task execution
|
|
||||||
}
|
|
||||||
generateGitProperties.outputs.upToDateWhen({ false }) // Force task execution
|
|
||||||
processResources.dependsOn(writeGitProperties) // Ensure git.properties file is present
|
|
||||||
|
|
||||||
// Javadoc configuration
|
// Javadoc configuration
|
||||||
javadoc {
|
javadoc {
|
||||||
outputs.upToDateWhen { false } // Force task execution
|
outputs.upToDateWhen { false } // Force task execution
|
||||||
|
@ -162,7 +107,7 @@ publishing {
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
maven {
|
||||||
name = "staropensource"
|
name = "staropensource"
|
||||||
url = uri("https://mvn.staropensource.de/sosengine")
|
url = uri("https://mvn.staropensource.de/engine")
|
||||||
credentials(org.gradle.api.credentials.PasswordCredentials)
|
credentials(org.gradle.api.credentials.PasswordCredentials)
|
||||||
authentication {
|
authentication {
|
||||||
//noinspection GroovyAssignabilityCheck
|
//noinspection GroovyAssignabilityCheck
|
||||||
|
@ -181,3 +126,58 @@ publishing {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Copy gradle.properties file
|
||||||
|
// for inclusion in final build
|
||||||
|
tasks.register("copyGradleProperties") {
|
||||||
|
doFirst {
|
||||||
|
File target = file("${project.projectDir}/src/main/resources/sosengine-gradle.properties")
|
||||||
|
File source = file(project(":").projectDir.getPath() + "/gradle.properties")
|
||||||
|
target.delete()
|
||||||
|
Files.copy(source.toPath(), target.toPath())
|
||||||
|
}
|
||||||
|
|
||||||
|
outputs.upToDateWhen({ false }) // Force task execution
|
||||||
|
}
|
||||||
|
processResources.dependsOn(copyGradleProperties)
|
||||||
|
|
||||||
|
// Git properties configuration
|
||||||
|
// Allows us to embed git commit information in the engine build
|
||||||
|
gitProperties {
|
||||||
|
dotGitDirectory = file("${rootProject.rootDir}/.git")
|
||||||
|
failOnNoGitDirectory = false // Allow continuing if .git directory is missing for the few who use tarballs
|
||||||
|
extProperty = "gitProps"
|
||||||
|
|
||||||
|
dateFormat = "yyyy-MM-dd'T'HH:mmZ"
|
||||||
|
dateFormatTimeZone = "UTC"
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register("writeGitProperties") { // This task's only purpose is to copy the git.properties from our git properties plugin to the resources directory so it's included in the final build
|
||||||
|
doLast {
|
||||||
|
File target = file("${project.projectDir}/src/main/resources/sosengine-git.properties")
|
||||||
|
File source = file("${project.projectDir}/build/resources/main/git.properties")
|
||||||
|
|
||||||
|
target.delete()
|
||||||
|
source.renameTo(target)
|
||||||
|
}
|
||||||
|
|
||||||
|
outputs.upToDateWhen({ false }) // Force task execution
|
||||||
|
}
|
||||||
|
generateGitProperties.outputs.upToDateWhen({ false }) // Force task execution
|
||||||
|
processResources.dependsOn(writeGitProperties) // Ensure git.properties file is present
|
||||||
|
|
||||||
|
// Fix delombok task
|
||||||
|
delombok.doFirst {
|
||||||
|
File target = file("${project.projectDir}/src/main/module-info.java")
|
||||||
|
File source = file("${project.projectDir}/src/main/java/module-info.java")
|
||||||
|
|
||||||
|
target.delete()
|
||||||
|
source.renameTo(target)
|
||||||
|
}
|
||||||
|
delombok.doLast {
|
||||||
|
File target = file("${project.projectDir}/src/main/java/module-info.java")
|
||||||
|
File source = file("${project.projectDir}/src/main/module-info.java")
|
||||||
|
|
||||||
|
target.delete()
|
||||||
|
source.renameTo(target)
|
||||||
|
}
|
||||||
|
|
|
@ -17,27 +17,31 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base;
|
package de.staropensource.engine.base;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.annotation.EngineSubsystem;
|
import de.staropensource.engine.base.annotation.EngineSubsystem;
|
||||||
import de.staropensource.sosengine.base.event.*;
|
import de.staropensource.engine.base.event.*;
|
||||||
import de.staropensource.sosengine.base.exception.IllegalAccessException;
|
import de.staropensource.engine.base.exception.IllegalAccessException;
|
||||||
import de.staropensource.sosengine.base.exception.dependency.UnmetDependenciesException;
|
import de.staropensource.engine.base.exception.dependency.UnmetDependenciesException;
|
||||||
import de.staropensource.sosengine.base.implementable.ShutdownHandler;
|
import de.staropensource.engine.base.implementable.ShutdownHandler;
|
||||||
import de.staropensource.sosengine.base.implementable.SubsystemClass;
|
import de.staropensource.engine.base.implementable.SubsystemClass;
|
||||||
import de.staropensource.sosengine.base.implementable.helper.EventHelper;
|
import de.staropensource.engine.base.implementable.helper.EventHelper;
|
||||||
import de.staropensource.sosengine.base.implementation.versioning.StarOpenSourceVersioningSystem;
|
import de.staropensource.engine.base.implementation.versioning.StarOpenSourceVersioningSystem;
|
||||||
import de.staropensource.sosengine.base.internal.event.InternalEngineShutdownEvent;
|
import de.staropensource.engine.base.event.InternalEngineShutdownEvent;
|
||||||
import de.staropensource.sosengine.base.internal.type.DependencySubsystemVector;
|
import de.staropensource.engine.base.internal.type.DependencySubsystemVector;
|
||||||
import de.staropensource.sosengine.base.logging.*;
|
import de.staropensource.engine.base.logging.PrintStreamService;
|
||||||
import de.staropensource.sosengine.base.type.DependencyVector;
|
import de.staropensource.engine.base.logging.*;
|
||||||
import de.staropensource.sosengine.base.type.EngineState;
|
import de.staropensource.engine.base.logging.backend.async.LoggingQueue;
|
||||||
import de.staropensource.sosengine.base.type.immutable.ImmutableLinkedList;
|
import de.staropensource.engine.base.logging.backend.async.LoggingThread;
|
||||||
import de.staropensource.sosengine.base.utility.DependencyResolver;
|
import de.staropensource.engine.base.type.DependencyVector;
|
||||||
import de.staropensource.sosengine.base.utility.Miscellaneous;
|
import de.staropensource.engine.base.type.EngineState;
|
||||||
import de.staropensource.sosengine.base.utility.PlaceholderEngine;
|
import de.staropensource.engine.base.type.immutable.ImmutableLinkedList;
|
||||||
import de.staropensource.sosengine.base.utility.information.EngineInformation;
|
import de.staropensource.engine.base.utility.DependencyResolver;
|
||||||
import de.staropensource.sosengine.base.utility.information.JvmInformation;
|
import de.staropensource.engine.base.utility.FileAccess;
|
||||||
|
import de.staropensource.engine.base.utility.Miscellaneous;
|
||||||
|
import de.staropensource.engine.base.utility.PlaceholderEngine;
|
||||||
|
import de.staropensource.engine.base.utility.information.EngineInformation;
|
||||||
|
import de.staropensource.engine.base.utility.information.JvmInformation;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
@ -56,7 +60,6 @@ import java.util.*;
|
||||||
* @see EngineConfiguration
|
* @see EngineConfiguration
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
||||||
@EngineSubsystem
|
|
||||||
@SuppressWarnings({ "JavadocDeclaration" })
|
@SuppressWarnings({ "JavadocDeclaration" })
|
||||||
public final class Engine extends SubsystemClass {
|
public final class Engine extends SubsystemClass {
|
||||||
/**
|
/**
|
||||||
|
@ -85,14 +88,6 @@ public final class Engine extends SubsystemClass {
|
||||||
@Getter
|
@Getter
|
||||||
private static final ThreadGroup threadGroup = new ThreadGroup("sos!engine");
|
private static final ThreadGroup threadGroup = new ThreadGroup("sos!engine");
|
||||||
|
|
||||||
/**
|
|
||||||
* Contains the {@link LoggerInstance} for this instance.
|
|
||||||
*
|
|
||||||
* @see LoggerInstance
|
|
||||||
* @since v1-alpha0
|
|
||||||
*/
|
|
||||||
private static final LoggerInstance logger = new LoggerInstance.Builder().setClazz(Engine.class).setOrigin("ENGINE").setMetadata(EngineInformation.getVersioningCodename()).build();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains the engine state.
|
* Contains the engine state.
|
||||||
*
|
*
|
||||||
|
@ -104,7 +99,7 @@ public final class Engine extends SubsystemClass {
|
||||||
* @since v1-alpha2
|
* @since v1-alpha2
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
private @NotNull EngineState state = EngineState.UNKNOWN;
|
private @NotNull EngineState state;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains a list of all registered subsystems.
|
* Contains a list of all registered subsystems.
|
||||||
|
@ -170,189 +165,194 @@ public final class Engine extends SubsystemClass {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Print warning about shutdown
|
// Print warning about shutdown
|
||||||
logger.warn("Trying to shut down engine using shutdown hook.\nThis approach to shutting down the engine and JVM is NOT RECOMMENDED, please use Engine#shutdown() instead.");
|
Logger.warn("Trying to shut down engine using shutdown hook.\nThis approach to shutting down the engine and JVM is NOT RECOMMENDED, please use Engine#shutdown() instead.");
|
||||||
|
|
||||||
// Shutdown
|
// Shutdown
|
||||||
Engine.getInstance().shutdown();
|
Engine.getInstance().shutdown();
|
||||||
|
|
||||||
// Print last message
|
// Print last message
|
||||||
InitLogger.warn(getClass(), "ENGINE", EngineInformation.getVersioningCodename(), "Engine successfully shut down using shutdown hook. PLEASE USE Engine#shutdown() INSTEAD OF System#exit() or Runtime#exit()!");
|
Logger.warn("Engine successfully shut down using shutdown hook. PLEASE USE Engine#shutdown() INSTEAD OF System#exit() or Runtime#exit()!");
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the StarOpenSource Engine.
|
* Initializes the StarOpenSource Engine.
|
||||||
*
|
*
|
||||||
* @throws IllegalStateException when running in an incompatible environment
|
* @throws RuntimeException for all exceptions thrown by this constructor
|
||||||
* @since v1-alpha0
|
* @since v1-alpha8
|
||||||
*/
|
*/
|
||||||
public Engine() throws IllegalStateException {
|
private Engine() throws RuntimeException {
|
||||||
if (instance == null)
|
try {
|
||||||
instance = this;
|
instance = this;
|
||||||
else
|
|
||||||
return;
|
|
||||||
|
|
||||||
long initTime = Miscellaneous.measureExecutionTime(() -> {
|
|
||||||
state = EngineState.EARLY_STARTUP;
|
state = EngineState.EARLY_STARTUP;
|
||||||
|
|
||||||
|
// For measuring the initialization time
|
||||||
|
long initTimeEarly = System.currentTimeMillis();
|
||||||
|
long initTimeLate = initTimeEarly;
|
||||||
|
|
||||||
|
// Check for incompatible JVM implementations
|
||||||
|
checkJvmIncompatibilities();
|
||||||
|
|
||||||
|
// Display that the engine is initializing
|
||||||
|
Logger.verb("Initializing engine");
|
||||||
|
|
||||||
|
// Start the logging thread
|
||||||
|
Logger.diag("Starting logging infrastructure");
|
||||||
|
LoggingThread.startThread(false);
|
||||||
|
PrintStreamService.initializeStreams();
|
||||||
|
|
||||||
|
// Initialize EngineInternals
|
||||||
|
Logger.diag("Initializing EngineInternals class");
|
||||||
|
new EngineInternals();
|
||||||
|
|
||||||
|
// Load engine configuration
|
||||||
|
Logger.diag("Loading engine configuration");
|
||||||
new EngineConfiguration();
|
new EngineConfiguration();
|
||||||
EngineConfiguration.getInstance().loadConfiguration();
|
EngineConfiguration.getInstance().loadConfiguration();
|
||||||
|
|
||||||
logger.info("Initializing engine");
|
// Load engine build information
|
||||||
initializeClasses(); // Initialize classes
|
Logger.diag("Loading engine build information");
|
||||||
if (checkEnvironment()) // Check environment
|
EngineInformation.update();
|
||||||
throw new IllegalStateException("Running in an incompatible environment");
|
|
||||||
ensureEnvironment(); // Prepare the environment and ensure safety
|
|
||||||
populateCrashContent(); // Populate crash content
|
|
||||||
cacheEvents(); // Cache event listeners
|
|
||||||
startThreads(); // Start threads
|
|
||||||
|
|
||||||
logger.verb("Completing early initialization stage");
|
// Check for reflective classpath scanning compatibility
|
||||||
|
checkReflectiveClasspathScanningCompatibility();
|
||||||
|
|
||||||
|
// Check for Java version incompatibilities
|
||||||
|
checkJavaVersion();
|
||||||
|
|
||||||
|
// Initialize PlaceholderEngine
|
||||||
|
Logger.diag("Initializing PlaceholderEngine");
|
||||||
|
PlaceholderEngine.initialize();
|
||||||
|
|
||||||
|
// Initialize static FileAccess instances
|
||||||
|
Logger.diag("Initializing static FileAccess instances");
|
||||||
|
FileAccess.initializeInstances();
|
||||||
|
|
||||||
|
// Install the safety shutdown hook
|
||||||
|
Logger.diag("Installing safety shutdown hook");
|
||||||
|
EngineInternals.getInstance().installSafetyShutdownHook(true);
|
||||||
|
|
||||||
|
// Cache events
|
||||||
|
Logger.diag("Caching event listeners");
|
||||||
|
cacheEvents();
|
||||||
|
|
||||||
|
// Complete early initialization stage
|
||||||
|
Logger.verb("Completing early initialization stage");
|
||||||
state = EngineState.STARTUP;
|
state = EngineState.STARTUP;
|
||||||
|
initTimeEarly = System.currentTimeMillis() - initTimeEarly;
|
||||||
|
|
||||||
// Perform automatic subsystem initialization
|
// Perform automatic subsystem initialization
|
||||||
if (EngineConfiguration.getInstance().isInitialPerformSubsystemInitialization()) {
|
if (EngineConfiguration.getInstance().isInitialPerformSubsystemInitialization()) {
|
||||||
collectSubsystems(); // Collect subsystems
|
// Collect all subsystems
|
||||||
|
Logger.diag("Collecting subsystems");
|
||||||
|
collectSubsystems();
|
||||||
|
|
||||||
// Initialize subsystems
|
// Initialize subsystems
|
||||||
try {
|
try {
|
||||||
initializeSubsystems();
|
initializeSubsystems();
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
logger.crash("Subsystem dependency resolution failed", exception);
|
Logger.error("Subsystem dependency resolution failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
logger.verb("Completing late initialization stage");
|
// Complete late initialization stage
|
||||||
|
Logger.verb("Completing late initialization stage");
|
||||||
state = EngineState.RUNNING;
|
state = EngineState.RUNNING;
|
||||||
logger.info("Initialized sos!engine %engine_version% (commit %engine_git_commit_id_long%-%engine_git_branch%, dirty %engine_git_dirty%) in " + initTime + "ms\nThe StarOpenSource Engine is licensed under the GNU AGPL v3. Copyright (c) 2024 The StarOpenSource Engine Authors.");
|
initTimeLate = System.currentTimeMillis() - initTimeLate;
|
||||||
|
|
||||||
|
// Print welcome message
|
||||||
|
Logger.info(
|
||||||
|
"""
|
||||||
|
Welcome to the StarOpenSource Engine "%engine_version_codename%" %engine_version%!
|
||||||
|
Running commit %engine_git_commit_id_long% (dirty %engine_git_dirty%).
|
||||||
|
Initialization took %init_time_total%ms (early %init_time_early%ms, late %init_time_late%ms).
|
||||||
|
|
||||||
|
Copyright (c) 2024 The StarOpenSource Engine Authors
|
||||||
|
Licensed under the GNU Affero General Public License v3"""
|
||||||
|
.replace("%init_time_total%", String.valueOf(initTimeEarly + initTimeLate))
|
||||||
|
.replace("%init_time_early%", String.valueOf(initTimeEarly))
|
||||||
|
.replace("%init_time_late%", String.valueOf(initTimeLate))
|
||||||
|
);
|
||||||
|
} catch (Exception exception) {
|
||||||
|
throw new RuntimeException(exception);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes all classes.
|
* Initializes the StarOpenSource
|
||||||
|
* Engine, if it isn't already.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @throws IllegalStateException when running in an incompatible environment
|
||||||
|
* @throws RuntimeException on engine initialization failure
|
||||||
|
* @since v1-alpha6
|
||||||
*/
|
*/
|
||||||
private void initializeClasses() {
|
public static void initialize() throws RuntimeException {
|
||||||
logger.verb("Initializing engine classes");
|
try {
|
||||||
new EngineInternals();
|
if (instance == null)
|
||||||
new PlaceholderEngine();
|
new Engine();
|
||||||
|
} catch (RuntimeException exception) {
|
||||||
|
Logger.error("Engine initialization failed");
|
||||||
|
Logger.error(Miscellaneous.getStackTraceHeader(exception.getCause()));
|
||||||
|
for (String line : Miscellaneous.getStackTraceAsString(exception.getCause(), true).split("\n"))
|
||||||
|
Logger.error(line);
|
||||||
|
|
||||||
EngineInformation.update();
|
throw new RuntimeException("Engine initialization failed", exception.getCause());
|
||||||
PrintStreamService.initializeStreams();
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the environment is compatible with the engine build.
|
* Checks if the running JVM implementation is not supported by the engine.
|
||||||
*
|
*
|
||||||
* @since v1-alpha4
|
* @since v1-alpha8
|
||||||
*/
|
*/
|
||||||
private boolean checkEnvironment() {
|
private void checkJvmIncompatibilities() {
|
||||||
logger.diag("Checking environment");
|
if (System.getProperties().getProperty("sosengine.base.allowUnsupportedJVMInitialization", "false").equals("true")) {
|
||||||
|
Logger.warn("Skipping JVM implementation incompatibilities check");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Warn about potential Java incompatibilities
|
// Substrate VM (GraalVM Community)
|
||||||
if (JvmInformation.getJavaVersion() > EngineInformation.getJavaSource())
|
|
||||||
logger.warn("The StarOpenSource Engine is running on an untested Java version.\nThings may not work as expected or features which can improve performance, stability, compatibility or ease of use may be missing.\nIf you encounter issues, try running a JVM implementing Java " + EngineInformation.getJavaSource());
|
|
||||||
|
|
||||||
// Shutdown if running in an unsupported JVM
|
|
||||||
if (JvmInformation.getImplementationName().equals("Substrate VM") && JvmInformation.getImplementationVendor().equals("GraalVM Community")) {
|
if (JvmInformation.getImplementationName().equals("Substrate VM") && JvmInformation.getImplementationVendor().equals("GraalVM Community")) {
|
||||||
logger.error("##############################################################################################");
|
Logger.error("##############################################################################################");
|
||||||
logger.error("## Running in Substrate VM, which is the name of the JVM used by GraalVM native-image. ##");
|
Logger.error("## Running in Substrate VM, which is the name of the JVM used by GraalVM native-image. ##");
|
||||||
logger.error("## The StarOpenSource Engine does not support native-image as using reflection in a certain ##");
|
Logger.error("## The StarOpenSource Engine does not support native-image as using reflection in a certain ##");
|
||||||
logger.error("## way seems to cause the Substrate JVM to crash. Workarounds have failed. ##");
|
Logger.error("## way seems to cause the Substrate JVM to crash. Workarounds have failed. ##");
|
||||||
logger.error("## This has already been noted in issue #3, which you can view here: ##");
|
Logger.error("## This has already been noted in issue #3, which you can view here: ##");
|
||||||
logger.error("## https://git.staropensource.de/StarOpenSource/Engine/issues/3 ##");
|
Logger.error("## https://git.staropensource.de/StarOpenSource/Engine/issues/3 ##");
|
||||||
logger.error("## ##");
|
Logger.error("## ##");
|
||||||
logger.error("## While this is sad, we unfortunately can't do anything against it unless we introduce ##");
|
Logger.error("## While this is sad, we unfortunately can't do anything against it unless we introduce ##");
|
||||||
logger.error("## annoying and stupid changes into the engine, which we don't want to do. ##");
|
Logger.error("## annoying and stupid changes into the engine, which we don't want to do. ##");
|
||||||
logger.error("## ##");
|
Logger.error("## ##");
|
||||||
logger.error("## We're truly sorry for this inconvenience. The sos!engine will now terminate. ##");
|
Logger.error("## We're truly sorry for this inconvenience. The sos!engine will now terminate. ##");
|
||||||
logger.error("##############################################################################################");
|
Logger.error("##############################################################################################");
|
||||||
Runtime.getRuntime().exit(255);
|
Runtime.getRuntime().exit(255);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if reflective classpath scanning is supported.
|
||||||
|
*
|
||||||
|
* @since v1-alpha8
|
||||||
|
*/
|
||||||
|
private void checkReflectiveClasspathScanningCompatibility() {
|
||||||
// Check if reflective classpath scanning is supported
|
// Check if reflective classpath scanning is supported
|
||||||
if (checkClasspathScanningSupport()) {
|
if (System.getProperties().getProperty("sosengine.base.considerEnvironmentUnfriendlyToClasspathScanning", "false").equals("true")) {
|
||||||
logger.warn("Running in an classpath scanning-unfriendly environment, disabling.");
|
Logger.warn("Running in an classpath scanning-unfriendly environment, disabling classpath scanning support.");
|
||||||
logger.warn("If shit doesn't work and is expected to be discovered by annotations, you'll need to");
|
Logger.warn("If shit doesn't work and is expected to be discovered by annotations, you'll need to");
|
||||||
logger.warn("either register it first or have to place classes in some package.");
|
Logger.warn("either register it first or have to update some engine configuration setting.");
|
||||||
logger.warn("Please consult sos!engine's documentation for more information about this issue.");
|
Logger.warn("Please consult sos!engine's documentation for more information about this issue.");
|
||||||
EngineInternals.getInstance().overrideReflectiveClasspathScanning(false);
|
EngineInternals.getInstance().overrideReflectiveClasspathScanning(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether scanning the classpath is supported.
|
* Checks and warns if the Java version of the
|
||||||
|
* running JVM is higher than the engine supports.
|
||||||
*
|
*
|
||||||
* @return test results
|
* @since v1-alpha8
|
||||||
* @since v1-alpha5
|
|
||||||
*/
|
*/
|
||||||
private boolean checkClasspathScanningSupport() {
|
private void checkJavaVersion() {
|
||||||
// This may be expanded in the future
|
if (JvmInformation.getJavaVersion() > EngineInformation.getJavaSource())
|
||||||
return EngineConfiguration.getInstance().isInitialForceDisableClasspathScanning();
|
Logger.warn("The StarOpenSource Engine is running on an untested Java version.\nThings may not work as expected or features which can improve performance, stability, compatibility or ease of use may be missing.\nIf you encounter issues, try running a JVM implementing Java " + EngineInformation.getJavaSource());
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Ensures the execution safety of the environment.
|
|
||||||
*
|
|
||||||
* @since v1-alpha4
|
|
||||||
*/
|
|
||||||
private void ensureEnvironment() {
|
|
||||||
EngineInternals.getInstance().installSafetyShutdownHook(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method populates {@link CrashHandler#crashContent} with content.
|
|
||||||
*
|
|
||||||
* @see CrashHandler#getCrashContent()
|
|
||||||
* @since v1-alpha0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings({ "ExtractMethodRecommender" })
|
|
||||||
private void populateCrashContent() {
|
|
||||||
logger.diag("Populating crash content");
|
|
||||||
|
|
||||||
// Issuer
|
|
||||||
Map<@NotNull String, @NotNull String> crashContentIssuer = new LinkedHashMap<>();
|
|
||||||
crashContentIssuer.put("Code part", "%issuer_origin%");
|
|
||||||
crashContentIssuer.put("Classpath", "%issuer_path%");
|
|
||||||
crashContentIssuer.put("Additional information", "%issuer_metadata%");
|
|
||||||
crashContentIssuer.put("Message", "%crash_message%");
|
|
||||||
|
|
||||||
// Engine -> Dependencies
|
|
||||||
LinkedList<@NotNull String> crashContentEngineDependencies = new LinkedList<>();
|
|
||||||
crashContentEngineDependencies.add("Subsystem 'base': Reflections: %engine_dependency_reflections%");
|
|
||||||
crashContentEngineDependencies.add("Subsystem 'ansi': Jansi: %engine_dependency_jansi%");
|
|
||||||
crashContentEngineDependencies.add("Subsystem 'slf4j-compat': SLF4J: %engine_dependency_slf4j%");
|
|
||||||
crashContentEngineDependencies.add("Subsystems 'glfw', 'opengl' & 'vulkan': LWJGL: %engine_dependency_lwjgl%");
|
|
||||||
// Engine -> *
|
|
||||||
Map<@NotNull String, @NotNull Object> crashContentEngine = new LinkedHashMap<>();
|
|
||||||
crashContentEngine.put("Version", "%engine_version%");
|
|
||||||
crashContentEngine.put("Dependencies", crashContentEngineDependencies);
|
|
||||||
|
|
||||||
// JVM -> Implementation
|
|
||||||
Map<@NotNull String, @NotNull String> crashContentJvmImplementation = new LinkedHashMap<>();
|
|
||||||
crashContentJvmImplementation.put("Name", "%jvm_implementation_name%");
|
|
||||||
crashContentJvmImplementation.put("Version", "%jvm_implementation_version%");
|
|
||||||
crashContentJvmImplementation.put("Vendor", "%jvm_implementation_vendor%");
|
|
||||||
// JVM -> *
|
|
||||||
Map<@NotNull String, @NotNull Object> crashContentJvm = new LinkedHashMap<>();
|
|
||||||
crashContentJvm.put("Java Version", "%jvm_java%");
|
|
||||||
crashContentJvm.put("Implementation", crashContentJvmImplementation);
|
|
||||||
crashContentJvm.put("Arguments", JvmInformation.getArguments());
|
|
||||||
|
|
||||||
// Operating system
|
|
||||||
Map<@NotNull String, @NotNull String> crashContentOS = new LinkedHashMap<>();
|
|
||||||
crashContentOS.put("Time", "%time_hour%:%time_minute%:%time_second% (%time_zone%, UNIX Epoch: %time_epoch%)");
|
|
||||||
crashContentOS.put("Date", "%date_day%.%date_month%.%date_year%");
|
|
||||||
|
|
||||||
// Add to crash handler
|
|
||||||
CrashHandler.getCrashContent().put("Issuer", crashContentIssuer);
|
|
||||||
CrashHandler.getCrashContent().put("Engine", crashContentEngine);
|
|
||||||
CrashHandler.getCrashContent().put("Java Virtual Machine", crashContentJvm);
|
|
||||||
CrashHandler.getCrashContent().put("Operating system", crashContentOS);
|
|
||||||
CrashHandler.getCrashContent().put("Stacktrace", "\n%stacktrace%");
|
|
||||||
CrashHandler.getCrashContent().put("Stacktrace for all threads", "\n%stacktrace_all%");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -361,30 +361,14 @@ public final class Engine extends SubsystemClass {
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
||||||
private void cacheEvents() {
|
private void cacheEvents() {
|
||||||
logger.diag("Caching events");
|
|
||||||
|
|
||||||
// Internal events
|
|
||||||
EventHelper.cacheEvent(InternalEngineShutdownEvent.class);
|
|
||||||
|
|
||||||
// General events
|
|
||||||
EventHelper.cacheEvent(EngineCrashEvent.class);
|
EventHelper.cacheEvent(EngineCrashEvent.class);
|
||||||
EventHelper.cacheEvent(EngineShutdownEvent.class);
|
EventHelper.cacheEvent(EngineShutdownEvent.class);
|
||||||
EventHelper.cacheEvent(EngineSoftCrashEvent.class);
|
EventHelper.cacheEvent(EngineSoftCrashEvent.class);
|
||||||
|
EventHelper.cacheEvent(InternalEngineShutdownEvent.class);
|
||||||
EventHelper.cacheEvent(LogEvent.class);
|
EventHelper.cacheEvent(LogEvent.class);
|
||||||
EventHelper.cacheEvent(ThrowableCatchEvent.class);
|
EventHelper.cacheEvent(ThrowableCatchEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Starts engine threads.
|
|
||||||
*
|
|
||||||
* @since v1-alpha1
|
|
||||||
*/
|
|
||||||
public void startThreads() {
|
|
||||||
logger.diag("Starting threads");
|
|
||||||
|
|
||||||
LoggingThread.startThread();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Collects all subsystems by their {@link EngineSubsystem} annotation.
|
* Collects all subsystems by their {@link EngineSubsystem} annotation.
|
||||||
*
|
*
|
||||||
|
@ -406,14 +390,14 @@ public final class Engine extends SubsystemClass {
|
||||||
if (initializedClassRaw instanceof SubsystemClass)
|
if (initializedClassRaw instanceof SubsystemClass)
|
||||||
initializedClass = (SubsystemClass) initializedClassRaw;
|
initializedClass = (SubsystemClass) initializedClassRaw;
|
||||||
else
|
else
|
||||||
logger.crash("Failed to initialize subsystem " + clazz.getName() + ": Does not implement " + SubsystemClass.class.getName());
|
Logger.crash("Failed to initialize subsystem " + clazz.getName() + ": Does not implement " + SubsystemClass.class.getName());
|
||||||
|
|
||||||
//noinspection DataFlowIssue // the crash call will prevent a NullPointerException
|
//noinspection DataFlowIssue // the crash call will prevent a NullPointerException
|
||||||
subsystemsMutable.add(new DependencySubsystemVector(initializedClass.getDependencyVector(), initializedClass));
|
subsystemsMutable.add(new DependencySubsystemVector(initializedClass.getDependencyVector(), initializedClass));
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
if (exception.getClass() == IllegalStateException.class && exception.getMessage().startsWith("The version string is invalid: "))
|
if (exception.getClass() == IllegalStateException.class && exception.getMessage().startsWith("The version string is invalid: "))
|
||||||
logger.crash("Failed to initialize subsystem " + clazz.getName() + ": Invalid version string: " + exception.getMessage().replace("The version string is invalid: ", ""));
|
Logger.crash("Failed to initialize subsystem " + clazz.getName() + ": Invalid version string: " + exception.getMessage().replace("The version string is invalid: ", ""));
|
||||||
logger.crash("Failed to initialize subsystem " + clazz.getName() + ": Method invocation error", exception);
|
Logger.crash("Failed to initialize subsystem " + clazz.getName() + ": Method invocation error", exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update 'subsystems'
|
// Update 'subsystems'
|
||||||
|
@ -443,10 +427,10 @@ public final class Engine extends SubsystemClass {
|
||||||
} else
|
} else
|
||||||
for (String path : EngineConfiguration.getInstance().getInitialIncludeSubsystemClasses())
|
for (String path : EngineConfiguration.getInstance().getInitialIncludeSubsystemClasses())
|
||||||
try {
|
try {
|
||||||
logger.diag("Resolving class " + path);
|
Logger.diag("Resolving class " + path);
|
||||||
classes.add(Class.forName(path));
|
classes.add(Class.forName(path));
|
||||||
} catch (ClassNotFoundException exception) {
|
} catch (ClassNotFoundException exception) {
|
||||||
logger.error("Failed loading subsystem class " + path + ": Class not found");
|
Logger.error("Failed loading subsystem class " + path + ": Class not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
return classes;
|
return classes;
|
||||||
|
@ -463,10 +447,11 @@ public final class Engine extends SubsystemClass {
|
||||||
LinkedList<DependencySubsystemVector> order = new LinkedList<>();
|
LinkedList<DependencySubsystemVector> order = new LinkedList<>();
|
||||||
|
|
||||||
// Add vectors
|
// Add vectors
|
||||||
|
resolver.addVector(getDependencyVector());
|
||||||
resolver.addVectors(subsystems);
|
resolver.addVectors(subsystems);
|
||||||
|
|
||||||
// Resolve dependencies and get order
|
// Resolve dependencies and get order
|
||||||
logger.verb("Resolving subsystem dependencies");
|
Logger.diag("Resolving subsystem dependencies");
|
||||||
try {
|
try {
|
||||||
for (DependencyVector vector : resolver.resolve().getOrder()) // smol workaround
|
for (DependencyVector vector : resolver.resolve().getOrder()) // smol workaround
|
||||||
order.add((DependencySubsystemVector) vector);
|
order.add((DependencySubsystemVector) vector);
|
||||||
|
@ -481,25 +466,25 @@ public final class Engine extends SubsystemClass {
|
||||||
.append("- ")
|
.append("- ")
|
||||||
.append(error);
|
.append(error);
|
||||||
|
|
||||||
logger.crash("Found unresolved dependencies:" + list, throwable);
|
Logger.crash("Found unresolved dependencies:" + list, throwable);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
logger.crash("An error occurred trying to resolve subsystem dependencies: " + throwable.getClass().getName() + (throwable.getMessage() == null ? "" : ": " + throwable.getMessage()));
|
Logger.crash("An error occurred trying to resolve subsystem dependencies: " + throwable.getClass().getName() + (throwable.getMessage() == null ? "" : ": " + throwable.getMessage()));
|
||||||
throw throwable;
|
throw throwable;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize subsystems
|
// Initialize subsystems
|
||||||
logger.verb("Initializing engine subsystems");
|
Logger.diag("Initializing engine subsystems");
|
||||||
long initTime;
|
long initTime;
|
||||||
for (DependencySubsystemVector vector : subsystems) {
|
for (DependencySubsystemVector vector : subsystems) {
|
||||||
logger.diag("Initializing subsystem " + vector.getSubsystemClass().getName() + " (" + vector.getSubsystemClass().getClass().getName() + ")");
|
Logger.diag("Initializing subsystem '" + vector.getSubsystemClass().getName() + "' (" + vector.getSubsystemClass().getClass().getName() + ")");
|
||||||
try {
|
try {
|
||||||
initTime = Miscellaneous.measureExecutionTime(() -> vector.getSubsystemClass().initializeSubsystem());
|
initTime = Miscellaneous.measureExecutionTime(() -> vector.getSubsystemClass().initializeSubsystem());
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
logger.crash("An error occurred trying to initialize subsystem " + vector.getSubsystemClass().getName() + " (" + vector.getSubsystemClass().getClass().getName() + "): " + throwable.getClass().getName() + (throwable.getMessage() == null ? "" : ": " + throwable.getMessage()));
|
Logger.crash("An error occurred trying to initialize subsystem " + vector.getSubsystemClass().getName() + " (" + vector.getSubsystemClass().getClass().getName() + "): " + throwable.getClass().getName() + (throwable.getMessage() == null ? "" : ": " + throwable.getMessage()));
|
||||||
throw throwable;
|
throw throwable;
|
||||||
}
|
}
|
||||||
logger.diag("Initialized subsystem " + vector.getSubsystemClass().getName() + " (" + vector.getSubsystemClass().getClass().getName() + ") in " + initTime + "ms");
|
Logger.diag("Initialized subsystem '" + vector.getSubsystemClass().getName() + "' (" + vector.getSubsystemClass().getClass().getName() + ") in " + initTime + "ms");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update 'subsystems'
|
// Update 'subsystems'
|
||||||
|
@ -516,7 +501,7 @@ public final class Engine extends SubsystemClass {
|
||||||
if (state == EngineState.UNKNOWN || state == EngineState.SHUTDOWN)
|
if (state == EngineState.UNKNOWN || state == EngineState.SHUTDOWN)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
logger.info("Shutting engine down");
|
Logger.info("Shutting engine down");
|
||||||
if (state != EngineState.CRASHED)
|
if (state != EngineState.CRASHED)
|
||||||
state = EngineState.SHUTDOWN;
|
state = EngineState.SHUTDOWN;
|
||||||
|
|
||||||
|
@ -527,7 +512,7 @@ public final class Engine extends SubsystemClass {
|
||||||
EngineConfiguration.getInstance().loadConfiguration(properties);
|
EngineConfiguration.getInstance().loadConfiguration(properties);
|
||||||
|
|
||||||
// Flush log messages
|
// Flush log messages
|
||||||
Logger.flushLogMessages();
|
LoggingQueue.flush();
|
||||||
|
|
||||||
// Disable safety shutdown hook
|
// Disable safety shutdown hook
|
||||||
try {
|
try {
|
||||||
|
@ -535,14 +520,17 @@ public final class Engine extends SubsystemClass {
|
||||||
} catch (Exception ignored) {}
|
} catch (Exception ignored) {}
|
||||||
|
|
||||||
// Send events
|
// Send events
|
||||||
logger.verb("Notifying classes about shutdown");
|
Logger.verb("Notifying classes about shutdown");
|
||||||
new EngineShutdownEvent().callEvent();
|
new EngineShutdownEvent().callEvent();
|
||||||
|
|
||||||
logger.verb("Notifying subsystems about shutdown");
|
Logger.verb("Notifying subsystems about shutdown");
|
||||||
new InternalEngineShutdownEvent().callEvent();
|
new InternalEngineShutdownEvent().callEvent();
|
||||||
|
|
||||||
|
// Delete scheduled files
|
||||||
|
FileAccess.deleteScheduled();
|
||||||
|
|
||||||
// Invoke shutdown handler
|
// Invoke shutdown handler
|
||||||
logger.verb("Invoking shutdown handler (code " + exitCode + ")");
|
Logger.verb("Invoking shutdown handler (code " + exitCode + ")");
|
||||||
shutdownHandler.shutdown((short) exitCode);
|
shutdownHandler.shutdown((short) exitCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -562,7 +550,11 @@ public final class Engine extends SubsystemClass {
|
||||||
return "base";
|
return "base";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/**
|
||||||
|
* This method does nothing.
|
||||||
|
*
|
||||||
|
* @since v1-alpha1
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void initializeSubsystem() {}
|
public void initializeSubsystem() {}
|
||||||
|
|
||||||
|
@ -584,8 +576,8 @@ public final class Engine extends SubsystemClass {
|
||||||
* @since v1-alpha2
|
* @since v1-alpha2
|
||||||
*/
|
*/
|
||||||
public void setState(@NotNull EngineState state) throws IllegalAccessException {
|
public void setState(@NotNull EngineState state) throws IllegalAccessException {
|
||||||
if (!Thread.currentThread().getStackTrace()[2].getClassName().startsWith("de.staropensource.sosengine.base."))
|
if (!Thread.currentThread().getStackTrace()[2].getClassName().startsWith("de.staropensource.engine.base."))
|
||||||
throw new IllegalAccessException("Only classes inside the \"de.staropensource.sosengine.base\" package are allowed to call this method.");
|
throw new IllegalAccessException("Only classes inside the \"de.staropensource.engine.base\" package are allowed to call this method.");
|
||||||
|
|
||||||
this.state = state;
|
this.state = state;
|
||||||
}
|
}
|
||||||
|
@ -615,12 +607,12 @@ public final class Engine extends SubsystemClass {
|
||||||
Runtime.getRuntime().addShutdownHook(thread);
|
Runtime.getRuntime().addShutdownHook(thread);
|
||||||
Runtime.getRuntime().removeShutdownHook(thread);
|
Runtime.getRuntime().removeShutdownHook(thread);
|
||||||
} catch (IllegalStateException exception) {
|
} catch (IllegalStateException exception) {
|
||||||
logger.warn("Terminating JVM: Already shutting down, skipping");
|
Logger.warn("Terminating JVM: Already shutting down, skipping");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.warn("Terminating JVM");
|
Logger.warn("Terminating JVM");
|
||||||
System.exit(exitCode);
|
Runtime.getRuntime().exit(exitCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,524 @@
|
||||||
|
/*
|
||||||
|
* STAROPENSOURCE ENGINE SOURCE FILE
|
||||||
|
* Copyright (c) 2024 The StarOpenSource Engine Authors
|
||||||
|
* Licensed under the GNU Affero General Public License v3
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package de.staropensource.engine.base;
|
||||||
|
|
||||||
|
import de.staropensource.engine.base.annotation.EngineSubsystem;
|
||||||
|
import de.staropensource.engine.base.event.LogEvent;
|
||||||
|
import de.staropensource.engine.base.implementable.Configuration;
|
||||||
|
import de.staropensource.engine.base.implementable.ShortcodeParser;
|
||||||
|
import de.staropensource.engine.base.implementable.SubsystemClass;
|
||||||
|
import de.staropensource.engine.base.logging.Logger;
|
||||||
|
import de.staropensource.engine.base.logging.backend.async.LoggingThread;
|
||||||
|
import de.staropensource.engine.base.type.EngineState;
|
||||||
|
import de.staropensource.engine.base.type.logging.LogLevel;
|
||||||
|
import de.staropensource.engine.base.type.vector.Vec2f;
|
||||||
|
import de.staropensource.engine.base.type.vector.Vec2i;
|
||||||
|
import de.staropensource.engine.base.utility.PropertiesReader;
|
||||||
|
import lombok.Getter;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides the base engine configuration.
|
||||||
|
* <p>
|
||||||
|
* This class does not only provide engine settings but is also
|
||||||
|
* responsible for loading them into memory from {@link Properties} objects.
|
||||||
|
* <p>
|
||||||
|
* Now you might ask why we didn't go with the string-based approach.
|
||||||
|
* The answer is simple: It's a maintenance burden.
|
||||||
|
* Having various settings strings scattered across many classes will cause
|
||||||
|
* trouble at some point, which will cause some strings to be undocumented
|
||||||
|
* or have an inconsistent naming scheme. Containing settings as variables in
|
||||||
|
* one centralized place mitigates this.
|
||||||
|
*
|
||||||
|
* @since v1-alpha0
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@SuppressWarnings({ "JavadocDeclaration" })
|
||||||
|
public final class EngineConfiguration extends Configuration {
|
||||||
|
/**
|
||||||
|
* Contains the class instance.
|
||||||
|
*
|
||||||
|
* @since v1-alpha0
|
||||||
|
* -- GETTER --
|
||||||
|
* Returns the class instance.
|
||||||
|
*
|
||||||
|
* @return class instance unless {@link Engine} is uninitialized
|
||||||
|
* @since v1-alpha0
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
private static EngineConfiguration instance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains the configuration prefix.
|
||||||
|
*
|
||||||
|
* @since v1-alpha0
|
||||||
|
* -- GETTER --
|
||||||
|
* Returns the configuration prefix.
|
||||||
|
*
|
||||||
|
* @return property group
|
||||||
|
* @since v1-alpha0
|
||||||
|
*/
|
||||||
|
private final @NotNull String group = "sosengine.base.";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains if debugging options should be allowed.
|
||||||
|
* All debugging options will be forcefully set to
|
||||||
|
* {@code false} if this option is set to {@code false}.
|
||||||
|
*
|
||||||
|
* @since v1-alpha0
|
||||||
|
* -- GETTER --
|
||||||
|
* Returns if debugging options should be allowed.
|
||||||
|
* All debugging options will be forcefully set to
|
||||||
|
* {@code false} if this option is set to {@code false}.
|
||||||
|
*
|
||||||
|
* @return debugging enabled?
|
||||||
|
* @since v1-alpha0
|
||||||
|
*/
|
||||||
|
private boolean debug;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains whether or not to log
|
||||||
|
* events being emitted.
|
||||||
|
* <p>
|
||||||
|
* This will cause all events to
|
||||||
|
* be logged, with the exception
|
||||||
|
* of the {@link LogEvent}.
|
||||||
|
*
|
||||||
|
* @since v1-alpha0
|
||||||
|
* -- GETTER --
|
||||||
|
* Returns whether or not to log
|
||||||
|
* events being emitted.
|
||||||
|
* <p>
|
||||||
|
* This will cause all events to
|
||||||
|
* be logged, with the exception
|
||||||
|
* of the {@link LogEvent}.
|
||||||
|
*
|
||||||
|
* @return detailed event logging enabled?
|
||||||
|
* @since v1-alpha0
|
||||||
|
*/
|
||||||
|
private boolean debugEvents;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains whether or not to automatically discover
|
||||||
|
* and initialize any class extending {@link SubsystemClass}
|
||||||
|
* whilst being annotated with {@link EngineSubsystem}.
|
||||||
|
* <p>
|
||||||
|
* This mechanism may fail in certain situations, where
|
||||||
|
* manual subsystem initialization may be desired. Make
|
||||||
|
* sure to disable this setting before engine startup
|
||||||
|
* and then initialize all subsystems manually.
|
||||||
|
*
|
||||||
|
* @see Engine
|
||||||
|
* @since v1-alpha5
|
||||||
|
* -- GETTER --
|
||||||
|
* Returns whether or not to automatically discover
|
||||||
|
* and initialize any class extending {@link SubsystemClass}
|
||||||
|
* whilst being annotated with {@link EngineSubsystem}.
|
||||||
|
* <p>
|
||||||
|
* This mechanism may fail in certain situations, where
|
||||||
|
* manual subsystem initialization may be desired. Make
|
||||||
|
* sure to disable this setting before engine startup
|
||||||
|
* and then initialize all subsystems manually.
|
||||||
|
*
|
||||||
|
* @return automatically discover and initialize subsystems?
|
||||||
|
* @since v1-alpha5
|
||||||
|
*/
|
||||||
|
private boolean initialPerformSubsystemInitialization;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains a set of class names to try to load
|
||||||
|
* and initialize as subsystems. Will only take effect
|
||||||
|
* if {@link #initialPerformSubsystemInitialization} is
|
||||||
|
* turned off.
|
||||||
|
*
|
||||||
|
* @since v1-alpha5
|
||||||
|
* -- GETTER --
|
||||||
|
* Returns a set of class names to try to load
|
||||||
|
* and initialize as subsystems. Will only take effect
|
||||||
|
* if {@link #getInitialIncludeSubsystemClasses()} is
|
||||||
|
* turned off.
|
||||||
|
*
|
||||||
|
* @return set of class names to try and initialize as subsystems
|
||||||
|
* @since v1-alpha5
|
||||||
|
*/
|
||||||
|
private Set<@NotNull String> initialIncludeSubsystemClasses;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains whether or not to complain about invalid
|
||||||
|
* shortcodes.
|
||||||
|
* <p>
|
||||||
|
* Requires the active log level to be set at least
|
||||||
|
* to {@link LogLevel#SILENT_WARNING} to have effect.
|
||||||
|
*
|
||||||
|
* @see #logLevel
|
||||||
|
* @since v1-alpha0
|
||||||
|
* -- GETTER --
|
||||||
|
* Returns whether or not to complain about invalid
|
||||||
|
* shortcodes.
|
||||||
|
* <p>
|
||||||
|
* Requires the active log level to be set at least
|
||||||
|
* to {@link LogLevel#SILENT_WARNING} to have effect.
|
||||||
|
*
|
||||||
|
* @return complain about invalid shortcodes?
|
||||||
|
* @see #getLogLevel()
|
||||||
|
* @since v1-alpha0
|
||||||
|
*/
|
||||||
|
private boolean errorShortcodeParser;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains if to log asynchronously.
|
||||||
|
* <p>
|
||||||
|
* If enabled, will cause a logging thread
|
||||||
|
* to spawn. All log messages will be queued
|
||||||
|
* and printed after a set delay
|
||||||
|
* ({@link #logPollingSpeed}).
|
||||||
|
* Highly recommended to keep enabled, or
|
||||||
|
* the performance of your application will
|
||||||
|
* very likely suffer.
|
||||||
|
*
|
||||||
|
* @see #logPollingSpeed
|
||||||
|
* @since v1-alpha0
|
||||||
|
* -- GETTER --
|
||||||
|
* Returns if to log asynchronously.
|
||||||
|
* <p>
|
||||||
|
* If enabled, will cause a logging thread
|
||||||
|
* to spawn. All log messages will be queued
|
||||||
|
* and printed after a set delay
|
||||||
|
* ({@link #getLogPollingSpeed()}).
|
||||||
|
* Highly recommended to keep enabled, or
|
||||||
|
* the performance of your application will
|
||||||
|
* very likely suffer.
|
||||||
|
*
|
||||||
|
* @return log asynchronously?
|
||||||
|
* @see #getLogPollingSpeed()
|
||||||
|
* @since v1-alpha0
|
||||||
|
*/
|
||||||
|
private boolean optimizeLogging;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains whether or not to emit events
|
||||||
|
* asynchronously.
|
||||||
|
* <p>
|
||||||
|
* This will cause a
|
||||||
|
* <a href="https://openjdk.org/jeps/444">VirtualThread</a>
|
||||||
|
* to spawn every time an event is emitted.
|
||||||
|
*
|
||||||
|
* @since v1-alpha0
|
||||||
|
* -- GETTER --
|
||||||
|
* Contains whether or not to emit events
|
||||||
|
* asynchronously.
|
||||||
|
* <p>
|
||||||
|
* This will cause a
|
||||||
|
* <a href="https://openjdk.org/jeps/444">VirtualThread</a>
|
||||||
|
* to spawn every time an event is emitted.
|
||||||
|
*
|
||||||
|
* @return emit events asynchronously?
|
||||||
|
* @since v1-alpha0
|
||||||
|
*/
|
||||||
|
private boolean optimizeEvents;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains the minimum allowed log level.
|
||||||
|
* <p>
|
||||||
|
* The priority list is as follows (from high to low priority):
|
||||||
|
* <ul>
|
||||||
|
* <li>{@link LogLevel#CRASH}</li>
|
||||||
|
* <li>{@link LogLevel#ERROR}</li>
|
||||||
|
* <li>{@link LogLevel#WARNING}</li>
|
||||||
|
* <li>{@link LogLevel#INFORMATIONAL}</li>
|
||||||
|
* <li>{@link LogLevel#SILENT_WARNING}</li>
|
||||||
|
* <li>{@link LogLevel#VERBOSE}</li>
|
||||||
|
* <li>{@link LogLevel#DIAGNOSTIC}</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @since v1-alpha0
|
||||||
|
* -- GETTER --
|
||||||
|
* Returns the minimum allowed log level.
|
||||||
|
* <p>
|
||||||
|
* The priority list is as follows (from high to low priority):
|
||||||
|
* <ul>
|
||||||
|
* <li>{@link LogLevel#CRASH}</li>
|
||||||
|
* <li>{@link LogLevel#ERROR}</li>
|
||||||
|
* <li>{@link LogLevel#WARNING}</li>
|
||||||
|
* <li>{@link LogLevel#INFORMATIONAL}</li>
|
||||||
|
* <li>{@link LogLevel#SILENT_WARNING}</li>
|
||||||
|
* <li>{@link LogLevel#VERBOSE}</li>
|
||||||
|
* <li>{@link LogLevel#DIAGNOSTIC}</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @return minimum allowed log level
|
||||||
|
* @since v1-alpha0
|
||||||
|
*/
|
||||||
|
private LogLevel logLevel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains a comma-separated list of optional
|
||||||
|
* features to add to the final log output.
|
||||||
|
* <p>
|
||||||
|
* Available features (in order of appearance):
|
||||||
|
* <ul>
|
||||||
|
* <li><code>formatting</code></li>
|
||||||
|
* <li><code>runtime</code></li>
|
||||||
|
* <li><code>date</code></li>
|
||||||
|
* <li><code>time</code></li>
|
||||||
|
* <li><code>shortIssuerClass</code></li>
|
||||||
|
* <li><code>moduleName</code></li>
|
||||||
|
* <li><code>moduleVersion</code> (requires <code>moduleName</code>)</li>
|
||||||
|
* <li><code>methodName</code></li>
|
||||||
|
* <li><code>lineNumber</code></li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @since v1-alpha8
|
||||||
|
* -- GETTER --
|
||||||
|
* Returns a comma-separated list of optional
|
||||||
|
* features to add to the final log output.
|
||||||
|
* <p>
|
||||||
|
* Available features (in order of appearance):
|
||||||
|
* <ul>
|
||||||
|
* <li><code>formatting</code></li>
|
||||||
|
* <li><code>runtime</code></li>
|
||||||
|
* <li><code>date</code></li>
|
||||||
|
* <li><code>time</code></li>
|
||||||
|
* <li><code>shortIssuerClass</code></li>
|
||||||
|
* <li><code>moduleName</code></li>
|
||||||
|
* <li><code>moduleVersion</code> (requires <code>moduleName</code>)</li>
|
||||||
|
* <li><code>methodName</code></li>
|
||||||
|
* <li><code>lineNumber</code></li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @return optional features to enable
|
||||||
|
* @since v1-alpha8
|
||||||
|
*/
|
||||||
|
private Set<@NotNull String> logFeatures;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains how fast the logging thread will
|
||||||
|
* poll for queued messages in milliseconds.
|
||||||
|
* This also causes messages to be buffered.
|
||||||
|
* <p>
|
||||||
|
* Only applies if {@code optimizeLogging} is turned on.
|
||||||
|
* Values below {@code 1} will poll for queued messages
|
||||||
|
* as fast as it can. This however has pretty much no
|
||||||
|
* benefit. Leave it at {@code 5}, it works quite well.
|
||||||
|
*
|
||||||
|
* @see #optimizeLogging
|
||||||
|
* @since v1-alpha4
|
||||||
|
* -- GETTER --
|
||||||
|
* Contains how fast the logging thread will
|
||||||
|
* poll for queued messages, in milliseconds.
|
||||||
|
* This also causes messages to be buffered.
|
||||||
|
* <p>
|
||||||
|
* Only applies if {@code optimizeLogging} is turned on.
|
||||||
|
* Values below {@code 1} will poll for queued messages
|
||||||
|
* as fast as it can. This however has pretty much no
|
||||||
|
* benefit. Leave it at {@code 5}, it works quite well.
|
||||||
|
*
|
||||||
|
* @return logging thread polling speed in milliseconds
|
||||||
|
* @see #isOptimizeLogging()
|
||||||
|
* @since v1-alpha4
|
||||||
|
*/
|
||||||
|
private int logPollingSpeed;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains whether or not to forcefully write
|
||||||
|
* to the standard output instead of the
|
||||||
|
* standard error stream.
|
||||||
|
* <p>
|
||||||
|
* This only applies to the {@link LogLevel#ERROR} and
|
||||||
|
* {@link LogLevel#CRASH} log levels, as these use
|
||||||
|
* the standard error stream by default.
|
||||||
|
*
|
||||||
|
* @see <a href="https://man7.org/linux/man-pages/man3/stderr.3.html">man page about standard streams</a>
|
||||||
|
* @since v1-alpha0
|
||||||
|
* -- GETTER --
|
||||||
|
* Contains whether or not to forcefully write
|
||||||
|
* to the standard output instead of the
|
||||||
|
* standard error stream.
|
||||||
|
* <p>
|
||||||
|
* This only applies to the {@link LogLevel#ERROR} and
|
||||||
|
* {@link LogLevel#CRASH} log levels, as these use
|
||||||
|
* the standard error stream by default.
|
||||||
|
*
|
||||||
|
* @return force use stdout?
|
||||||
|
* @see <a href="https://man7.org/linux/man-pages/man3/stderr.3.html">man page about standard streams</a>
|
||||||
|
* @since v1-alpha0
|
||||||
|
*/
|
||||||
|
private boolean logForceStandardOutput;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains if to truncate the full path
|
||||||
|
* of a class when invoking using their
|
||||||
|
* {@link #toString()} method.
|
||||||
|
* <p>
|
||||||
|
* Here's an example: Lets say that you have a
|
||||||
|
* {@link Vec2f} instance and want to convert
|
||||||
|
* it to a String. You can do that by using
|
||||||
|
* {@link Vec2f}'s {@link Vec2f#toString()}
|
||||||
|
* method. With this flag disabled it will
|
||||||
|
* return
|
||||||
|
* {@code de.staropensource.engine.base.types.vectors.}{@link Vec2i}{@code (x=64 y=64)}.
|
||||||
|
* With this flag enabled however the method will return
|
||||||
|
* {@link Vec2i}{@code (x=64 y=64)},
|
||||||
|
* which is much smaller.
|
||||||
|
*
|
||||||
|
* @since v1-alpha2
|
||||||
|
* -- GETTER --
|
||||||
|
* Returns if to truncate the full path
|
||||||
|
* of a class when invoking using their
|
||||||
|
* {@link #toString()} method.
|
||||||
|
* <p>
|
||||||
|
* Here's an example: Lets say that you have a
|
||||||
|
* {@link Vec2f} instance and want to convert
|
||||||
|
* it to a String. You can do that by using
|
||||||
|
* {@link Vec2f}'s {@link Vec2f#toString()}
|
||||||
|
* method. With this flag disabled it will
|
||||||
|
* return
|
||||||
|
* {@code de.staropensource.engine.base.types.vectors.}{@link Vec2i}{@code (x=64 y=64)}.
|
||||||
|
* With this flag enabled however the method will return
|
||||||
|
* {@link Vec2i}{@code (x=64 y=64)},
|
||||||
|
* which is much smaller.
|
||||||
|
*
|
||||||
|
* @return truncate class paths?
|
||||||
|
* @since v1-alpha2
|
||||||
|
*/
|
||||||
|
private boolean hideFullTypePath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs this class.
|
||||||
|
*
|
||||||
|
* @see Engine
|
||||||
|
* @since v1-alpha6
|
||||||
|
*/
|
||||||
|
EngineConfiguration() {
|
||||||
|
super();
|
||||||
|
|
||||||
|
instance = this;
|
||||||
|
|
||||||
|
// Load default configuration
|
||||||
|
loadDefaultConfiguration();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** {@inheritDoc} */
|
||||||
|
@Override
|
||||||
|
protected void matchProperty(@NotNull PropertiesReader parser, @NotNull String property) {
|
||||||
|
try {
|
||||||
|
switch (property) {
|
||||||
|
case "debug" -> debug = parser.getBoolean(group + property);
|
||||||
|
case "debugEvents" -> debugEvents = parser.getBoolean(group + property);
|
||||||
|
|
||||||
|
case "initialPerformSubsystemInitialization" -> initialPerformSubsystemInitialization = parser.getBoolean(group + property);
|
||||||
|
case "initialIncludeSubsystemClasses" -> {
|
||||||
|
initialIncludeSubsystemClasses = new HashSet<>();
|
||||||
|
initialIncludeSubsystemClasses.addAll(Arrays.stream(parser.getString(group + property).split(",")).toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
case "errorShortcodeParser" -> errorShortcodeParser = parser.getBoolean(group + property);
|
||||||
|
|
||||||
|
case "optimizeLogging" -> {
|
||||||
|
optimizeLogging = parser.getBoolean(group + property);
|
||||||
|
|
||||||
|
// Start logging thread automatically
|
||||||
|
if (optimizeLogging && Engine.getInstance().getState() == EngineState.RUNNING) {
|
||||||
|
LoggingThread.startThread(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case "optimizeEvents" -> optimizeEvents = parser.getBoolean(group + property);
|
||||||
|
|
||||||
|
case "logLevel" -> {
|
||||||
|
try {
|
||||||
|
logLevel = LogLevel.valueOf(parser.getString(group + property).toUpperCase());
|
||||||
|
} catch (IllegalArgumentException ignored) {
|
||||||
|
Logger.error("The log level '" + parser.getString(group + property) + "' is not valid");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case "logFeatures" -> logFeatures = Set.copyOf(Arrays.stream(parser.getString(group + property).split(",")).toList());
|
||||||
|
case "logPollingSpeed" -> logPollingSpeed = parser.getInteger(group + property, true);
|
||||||
|
case "logForceStandardOutput" -> logForceStandardOutput = parser.getBoolean(group + property);
|
||||||
|
|
||||||
|
case "hideFullTypePath" -> hideFullTypePath = parser.getBoolean(group + property);
|
||||||
|
}
|
||||||
|
} catch (NullPointerException ignored) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** {@inheritDoc} */
|
||||||
|
@Override
|
||||||
|
protected void processSettings(@NotNull PropertiesReader parser) {
|
||||||
|
// Disable all debugging switches if 'debug' is disabled
|
||||||
|
if (!debug) {
|
||||||
|
debugEvents = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** {@inheritDoc} */
|
||||||
|
@Override
|
||||||
|
public void loadDefaultConfiguration() {
|
||||||
|
debug = false;
|
||||||
|
debugEvents = false;
|
||||||
|
|
||||||
|
initialPerformSubsystemInitialization = true;
|
||||||
|
initialIncludeSubsystemClasses = new HashSet<>();
|
||||||
|
|
||||||
|
errorShortcodeParser = true;
|
||||||
|
|
||||||
|
optimizeLogging = true;
|
||||||
|
optimizeEvents = true;
|
||||||
|
|
||||||
|
logLevel = LogLevel.INFORMATIONAL;
|
||||||
|
logFeatures = Set.of("formatting", "time", "methodName", "lineNumber");
|
||||||
|
logPollingSpeed = 5;
|
||||||
|
logForceStandardOutput = false;
|
||||||
|
|
||||||
|
hideFullTypePath = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** {@inheritDoc} */
|
||||||
|
@Override
|
||||||
|
public @Nullable Object getSetting(@NotNull String setting) {
|
||||||
|
return switch (setting) {
|
||||||
|
case "debug" -> debug;
|
||||||
|
case "debugEvents" -> debugEvents;
|
||||||
|
|
||||||
|
case "initialPerformSubsystemInitialization" -> initialPerformSubsystemInitialization;
|
||||||
|
case "initialIncludeSubsystemClasses" -> initialIncludeSubsystemClasses;
|
||||||
|
|
||||||
|
case "errorShortcodeParser" -> errorShortcodeParser;
|
||||||
|
|
||||||
|
case "optimizeLogging" -> optimizeLogging;
|
||||||
|
case "optimizeEvents" -> optimizeEvents;
|
||||||
|
|
||||||
|
case "logLevel" -> logLevel;
|
||||||
|
case "logFeatures" -> logFeatures;
|
||||||
|
case "logPollingSpeed" -> logPollingSpeed;
|
||||||
|
case "logForceStandardOutput" -> logForceStandardOutput;
|
||||||
|
|
||||||
|
case "hideFullTypePath" -> hideFullTypePath;
|
||||||
|
default -> null;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
|
@ -17,15 +17,15 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base;
|
package de.staropensource.engine.base;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.exception.IllegalAccessException;
|
import de.staropensource.engine.base.exception.IllegalAccessException;
|
||||||
import de.staropensource.sosengine.base.implementable.EventListenerCode;
|
import de.staropensource.engine.base.implementable.EventListenerCode;
|
||||||
import de.staropensource.sosengine.base.implementable.ShutdownHandler;
|
import de.staropensource.engine.base.implementable.ShutdownHandler;
|
||||||
import de.staropensource.sosengine.base.implementable.helper.EventHelper;
|
import de.staropensource.engine.base.implementable.helper.EventHelper;
|
||||||
import de.staropensource.sosengine.base.logging.LoggerInstance;
|
import de.staropensource.engine.base.logging.Logger;
|
||||||
import de.staropensource.sosengine.base.type.EventPriority;
|
import de.staropensource.engine.base.type.EventPriority;
|
||||||
import de.staropensource.sosengine.base.type.InternalAccessArea;
|
import de.staropensource.engine.base.type.InternalAccessArea;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
@ -54,14 +54,6 @@ public final class EngineInternals {
|
||||||
@Getter
|
@Getter
|
||||||
private static EngineInternals instance;
|
private static EngineInternals instance;
|
||||||
|
|
||||||
/**
|
|
||||||
* Contains the {@link LoggerInstance} for this instance.
|
|
||||||
*
|
|
||||||
* @see LoggerInstance
|
|
||||||
* @since v1-alpha4
|
|
||||||
*/
|
|
||||||
private static final LoggerInstance logger = new LoggerInstance.Builder().setClazz(EngineInternals.class).setOrigin("ENGINE").build();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains all disabled internal access areas.
|
* Contains all disabled internal access areas.
|
||||||
*
|
*
|
||||||
|
@ -91,16 +83,16 @@ public final class EngineInternals {
|
||||||
private boolean reflectiveClasspathScanning = true;
|
private boolean reflectiveClasspathScanning = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this class.
|
||||||
*
|
*
|
||||||
* @since v1-alpha4
|
* @since v1-alpha6
|
||||||
*/
|
*/
|
||||||
public EngineInternals() {
|
EngineInternals() {
|
||||||
// Only allow one instance
|
// Only allow one instance
|
||||||
if (instance == null && Engine.getInstance() != null)
|
if (instance == null && Engine.getInstance() != null)
|
||||||
instance = this;
|
instance = this;
|
||||||
else
|
else
|
||||||
logger.crash("Only one instance of this class is allowed, use getInstance() instead of creating a new instance");
|
Logger.crash("Only one instance of this class is allowed, use getInstance() instead of creating a new instance");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -17,9 +17,9 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.annotation;
|
package de.staropensource.engine.base.annotation;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.SubsystemClass;
|
import de.staropensource.engine.base.implementable.SubsystemClass;
|
||||||
|
|
||||||
import java.lang.annotation.*;
|
import java.lang.annotation.*;
|
||||||
|
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.annotation;
|
package de.staropensource.engine.base.annotation;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Event;
|
import de.staropensource.engine.base.implementable.Event;
|
||||||
import de.staropensource.sosengine.base.type.EventPriority;
|
import de.staropensource.engine.base.type.EventPriority;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.lang.annotation.*;
|
import java.lang.annotation.*;
|
|
@ -23,4 +23,4 @@
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
||||||
package de.staropensource.sosengine.base.annotation;
|
package de.staropensource.engine.base.annotation;
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.event;
|
package de.staropensource.engine.base.event;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Event;
|
import de.staropensource.engine.base.implementable.Event;
|
||||||
import de.staropensource.sosengine.base.implementable.helper.EventHelper;
|
import de.staropensource.engine.base.implementable.helper.EventHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called in the event of an engine crash.
|
* Called in the event of an engine crash.
|
||||||
|
@ -29,7 +29,7 @@ import de.staropensource.sosengine.base.implementable.helper.EventHelper;
|
||||||
*/
|
*/
|
||||||
public final class EngineCrashEvent implements Event {
|
public final class EngineCrashEvent implements Event {
|
||||||
/**
|
/**
|
||||||
* Constructs this event.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.event;
|
package de.staropensource.engine.base.event;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Event;
|
import de.staropensource.engine.base.implementable.Event;
|
||||||
import de.staropensource.sosengine.base.implementable.helper.EventHelper;
|
import de.staropensource.engine.base.implementable.helper.EventHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the engine is about to shutdown.
|
* Called when the engine is about to shutdown.
|
||||||
|
@ -29,7 +29,7 @@ import de.staropensource.sosengine.base.implementable.helper.EventHelper;
|
||||||
*/
|
*/
|
||||||
public final class EngineShutdownEvent implements Event {
|
public final class EngineShutdownEvent implements Event {
|
||||||
/**
|
/**
|
||||||
* Constructs this event.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,11 +17,11 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.event;
|
package de.staropensource.engine.base.event;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Event;
|
import de.staropensource.engine.base.implementable.Event;
|
||||||
import de.staropensource.sosengine.base.implementable.helper.EventHelper;
|
import de.staropensource.engine.base.implementable.helper.EventHelper;
|
||||||
import de.staropensource.sosengine.base.logging.Logger;
|
import de.staropensource.engine.base.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called in the event of a soft engine crash
|
* Called in the event of a soft engine crash
|
||||||
|
@ -33,7 +33,7 @@ import de.staropensource.sosengine.base.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public final class EngineSoftCrashEvent implements Event {
|
public final class EngineSoftCrashEvent implements Event {
|
||||||
/**
|
/**
|
||||||
* Constructs this event.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,13 +17,13 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.event;
|
package de.staropensource.engine.base.event;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Event;
|
import de.staropensource.engine.base.implementable.Event;
|
||||||
import de.staropensource.sosengine.base.implementable.helper.EventHelper;
|
import de.staropensource.engine.base.implementable.helper.EventHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the engine is about to shutdown, after {@link de.staropensource.sosengine.base.event.EngineShutdownEvent}.
|
* Called when the engine is about to shutdown, after {@link de.staropensource.engine.base.event.EngineShutdownEvent}.
|
||||||
* <p>
|
* <p>
|
||||||
* Meant for subsystems to perform cleanup and shutdown routines, not for applications.
|
* Meant for subsystems to perform cleanup and shutdown routines, not for applications.
|
||||||
*
|
*
|
||||||
|
@ -31,7 +31,7 @@ import de.staropensource.sosengine.base.implementable.helper.EventHelper;
|
||||||
*/
|
*/
|
||||||
public final class InternalEngineShutdownEvent implements Event {
|
public final class InternalEngineShutdownEvent implements Event {
|
||||||
/**
|
/**
|
||||||
* Constructs this event.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,11 +17,11 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.event;
|
package de.staropensource.engine.base.event;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Event;
|
import de.staropensource.engine.base.implementable.Event;
|
||||||
import de.staropensource.sosengine.base.implementable.helper.EventHelper;
|
import de.staropensource.engine.base.implementable.helper.EventHelper;
|
||||||
import de.staropensource.sosengine.base.type.logging.LogLevel;
|
import de.staropensource.engine.base.type.logging.LogLevel;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.Nullable;
|
||||||
*/
|
*/
|
||||||
public final class LogEvent implements Event {
|
public final class LogEvent implements Event {
|
||||||
/**
|
/**
|
||||||
* Constructs this event.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,11 +17,11 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.event;
|
package de.staropensource.engine.base.event;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Event;
|
import de.staropensource.engine.base.implementable.Event;
|
||||||
import de.staropensource.sosengine.base.implementable.helper.EventHelper;
|
import de.staropensource.engine.base.implementable.helper.EventHelper;
|
||||||
import de.staropensource.sosengine.base.utility.Miscellaneous;
|
import de.staropensource.engine.base.utility.Miscellaneous;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
*/
|
*/
|
||||||
public final class ThrowableCatchEvent implements Event {
|
public final class ThrowableCatchEvent implements Event {
|
||||||
/**
|
/**
|
||||||
* Constructs this event.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -22,4 +22,4 @@
|
||||||
*
|
*
|
||||||
* @since v1-alpha1
|
* @since v1-alpha1
|
||||||
*/
|
*/
|
||||||
package de.staropensource.sosengine.base.event;
|
package de.staropensource.engine.base.event;
|
|
@ -17,7 +17,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.exception;
|
package de.staropensource.engine.base.exception;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
@ -28,14 +28,14 @@ import org.jetbrains.annotations.NotNull;
|
||||||
*/
|
*/
|
||||||
public class IllegalAccessException extends RuntimeException {
|
public class IllegalAccessException extends RuntimeException {
|
||||||
/**
|
/**
|
||||||
* Constructs this exception.
|
* Creates and initializes an instance of this exception.
|
||||||
*
|
*
|
||||||
* @since v1-alpha2
|
* @since v1-alpha2
|
||||||
*/
|
*/
|
||||||
public IllegalAccessException() {}
|
public IllegalAccessException() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs this exception.
|
* Creates and initializes an instance of this exception.
|
||||||
*
|
*
|
||||||
* @param message message
|
* @param message message
|
||||||
* @since v1-alpha2
|
* @since v1-alpha2
|
|
@ -17,7 +17,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.exception;
|
package de.staropensource.engine.base.exception;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
*/
|
*/
|
||||||
public class ParserException extends RuntimeException {
|
public class ParserException extends RuntimeException {
|
||||||
/**
|
/**
|
||||||
* Constructs this exception.
|
* Creates and initializes an instance of this exception.
|
||||||
*
|
*
|
||||||
* @param message parsing error
|
* @param message parsing error
|
||||||
* @since v1-alpha2
|
* @since v1-alpha2
|
|
@ -17,9 +17,9 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.exception;
|
package de.staropensource.engine.base.exception;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.type.Tristate;
|
import de.staropensource.engine.base.type.Tristate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Thrown when converting a {@link Tristate} into a {@link Boolean} fails.
|
* Thrown when converting a {@link Tristate} into a {@link Boolean} fails.
|
||||||
|
@ -32,7 +32,7 @@ import de.staropensource.sosengine.base.type.Tristate;
|
||||||
*/
|
*/
|
||||||
public class TristateConversionException extends RuntimeException {
|
public class TristateConversionException extends RuntimeException {
|
||||||
/**
|
/**
|
||||||
* Constructs this exception.
|
* Creates and initializes an instance of this exception.
|
||||||
*
|
*
|
||||||
* @since v1-alpha2
|
* @since v1-alpha2
|
||||||
*/
|
*/
|
|
@ -17,7 +17,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.exception;
|
package de.staropensource.engine.base.exception;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
*/
|
*/
|
||||||
public class UnexpectedCheckEndException extends RuntimeException {
|
public class UnexpectedCheckEndException extends RuntimeException {
|
||||||
/**
|
/**
|
||||||
* Constructs this exception.
|
* Creates and initializes an instance of this exception.
|
||||||
*
|
*
|
||||||
* @param checkOccurrence the sequence of checks that failed
|
* @param checkOccurrence the sequence of checks that failed
|
||||||
* @since v1-alpha2
|
* @since v1-alpha2
|
||||||
|
@ -38,7 +38,7 @@ public class UnexpectedCheckEndException extends RuntimeException {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs this exception.
|
* Creates and initializes an instance of this exception.
|
||||||
*
|
*
|
||||||
* @since v1-alpha2
|
* @since v1-alpha2
|
||||||
*/
|
*/
|
|
@ -17,9 +17,9 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.exception.dependency;
|
package de.staropensource.engine.base.exception.dependency;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.utility.DependencyResolver;
|
import de.staropensource.engine.base.utility.DependencyResolver;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,7 +29,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
*/
|
*/
|
||||||
public class DependencyCycleException extends RuntimeException {
|
public class DependencyCycleException extends RuntimeException {
|
||||||
/**
|
/**
|
||||||
* Constructs this exception.
|
* Creates and initializes an instance of this exception.
|
||||||
*
|
*
|
||||||
* @param path cycle path
|
* @param path cycle path
|
||||||
* @since v1-alpha1
|
* @since v1-alpha1
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.exception.dependency;
|
package de.staropensource.engine.base.exception.dependency;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.type.DependencyVector;
|
import de.staropensource.engine.base.type.DependencyVector;
|
||||||
import de.staropensource.sosengine.base.utility.DependencyResolver;
|
import de.staropensource.engine.base.utility.DependencyResolver;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ public class UnmetDependenciesException extends Exception {
|
||||||
private final @NotNull List<@NotNull String> unmetDependencies;
|
private final @NotNull List<@NotNull String> unmetDependencies;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs this exception.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @param unmetDependencies map of all unmet dependencies
|
* @param unmetDependencies map of all unmet dependencies
|
||||||
* @see #unmetDependencies
|
* @see #unmetDependencies
|
|
@ -20,7 +20,7 @@
|
||||||
/**
|
/**
|
||||||
* Exceptions related to dependency resolving.
|
* Exceptions related to dependency resolving.
|
||||||
*
|
*
|
||||||
* @see de.staropensource.sosengine.base.utility.DependencyResolver
|
* @see de.staropensource.engine.base.utility.DependencyResolver
|
||||||
* @since v1-alpha1
|
* @since v1-alpha1
|
||||||
*/
|
*/
|
||||||
package de.staropensource.sosengine.base.exception.dependency;
|
package de.staropensource.engine.base.exception.dependency;
|
|
@ -22,4 +22,4 @@
|
||||||
*
|
*
|
||||||
* @since v1-alpha1
|
* @since v1-alpha1
|
||||||
*/
|
*/
|
||||||
package de.staropensource.sosengine.base.exception;
|
package de.staropensource.engine.base.exception;
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.exception.reflection;
|
package de.staropensource.engine.base.exception.reflection;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.type.reflection.ClassType;
|
import de.staropensource.engine.base.type.reflection.ClassType;
|
||||||
import de.staropensource.sosengine.base.utility.ListFormatter;
|
import de.staropensource.engine.base.utility.ListFormatter;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,18 +30,18 @@ import org.jetbrains.annotations.NotNull;
|
||||||
*/
|
*/
|
||||||
public class IncompatibleTypeException extends RuntimeException {
|
public class IncompatibleTypeException extends RuntimeException {
|
||||||
/**
|
/**
|
||||||
* Constructs this exception.
|
* Creates and initializes an instance of this exception.
|
||||||
*
|
*
|
||||||
* @param methodName name of the method that failed
|
* @param methodName name of the method that failed
|
||||||
* @param requiredClassType class type received by the method
|
* @param requiredClassType class type received by the method
|
||||||
* @param compatibleTypes class types the method is compatible with
|
* @param compatibleTypes class types the method is compatible with
|
||||||
*/
|
*/
|
||||||
public IncompatibleTypeException(@NotNull String methodName, @NotNull ClassType requiredClassType, @NotNull ClassType[] compatibleTypes) {
|
public IncompatibleTypeException(@NotNull String methodName, @NotNull ClassType requiredClassType, @NotNull ClassType @NotNull [] compatibleTypes) {
|
||||||
super("The method ReflectionClass#" + methodName + " only applies to type(s) " + ListFormatter.formatArray(compatibleTypes) + ", not " + requiredClassType.name());
|
super("The method ReflectionClass#" + methodName + " only applies to type(s) " + ListFormatter.formatArray(compatibleTypes) + ", not " + requiredClassType.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs this exception.
|
* Creates and initializes an instance of this exception.
|
||||||
*
|
*
|
||||||
* @param methodName name of the method that failed
|
* @param methodName name of the method that failed
|
||||||
* @param requiredClassType class type received by the method
|
* @param requiredClassType class type received by the method
|
|
@ -17,7 +17,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.exception.reflection;
|
package de.staropensource.engine.base.exception.reflection;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
*/
|
*/
|
||||||
public class InstanceMethodFromStaticContextException extends Exception {
|
public class InstanceMethodFromStaticContextException extends Exception {
|
||||||
/**
|
/**
|
||||||
* Constructs this exception.
|
* Creates and initializes an instance of this exception.
|
||||||
*
|
*
|
||||||
* @param methodName name of the method
|
* @param methodName name of the method
|
||||||
* @since v1-alpha2
|
* @since v1-alpha2
|
|
@ -17,9 +17,9 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.exception.reflection;
|
package de.staropensource.engine.base.exception.reflection;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.reflection.ReflectionClass;
|
import de.staropensource.engine.base.reflection.ReflectionClass;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,7 +29,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
*/
|
*/
|
||||||
public class InvalidFieldException extends Exception {
|
public class InvalidFieldException extends Exception {
|
||||||
/**
|
/**
|
||||||
* Constructs this exception.
|
* Creates and initializes an instance of this exception.
|
||||||
*
|
*
|
||||||
* @param clazz caller {@link ReflectionClass}
|
* @param clazz caller {@link ReflectionClass}
|
||||||
* @param fieldName name of the invalid field
|
* @param fieldName name of the invalid field
|
|
@ -17,9 +17,9 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.exception.reflection;
|
package de.staropensource.engine.base.exception.reflection;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.reflection.ReflectionClass;
|
import de.staropensource.engine.base.reflection.ReflectionClass;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,7 +29,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
*/
|
*/
|
||||||
public class InvalidMethodException extends Exception {
|
public class InvalidMethodException extends Exception {
|
||||||
/**
|
/**
|
||||||
* Constructs this exception.
|
* Creates and initializes an instance of this exception.
|
||||||
*
|
*
|
||||||
* @param clazz caller {@link ReflectionClass}
|
* @param clazz caller {@link ReflectionClass}
|
||||||
* @param fieldName name of the invalid method
|
* @param fieldName name of the invalid method
|
|
@ -17,7 +17,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.exception.reflection;
|
package de.staropensource.engine.base.exception.reflection;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
*/
|
*/
|
||||||
public class InvalidMethodSignatureException extends Exception {
|
public class InvalidMethodSignatureException extends Exception {
|
||||||
/**
|
/**
|
||||||
* Constructs this exception.
|
* Creates and initializes an instance of this exception.
|
||||||
*
|
*
|
||||||
* @param methodName method name
|
* @param methodName method name
|
||||||
* @since v1-alpha5
|
* @since v1-alpha5
|
|
@ -17,7 +17,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.exception.reflection;
|
package de.staropensource.engine.base.exception.reflection;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
*/
|
*/
|
||||||
public class NoAccessException extends Exception {
|
public class NoAccessException extends Exception {
|
||||||
/**
|
/**
|
||||||
* Constructs this exception.
|
* Creates and initializes an instance of this exception.
|
||||||
*
|
*
|
||||||
* @param type {@code class}, {@code method} or {@code field}
|
* @param type {@code class}, {@code method} or {@code field}
|
||||||
* @param name class, method or field name
|
* @param name class, method or field name
|
|
@ -17,7 +17,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.exception.reflection;
|
package de.staropensource.engine.base.exception.reflection;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
@ -43,7 +43,7 @@ public class StaticInitializerException extends Exception {
|
||||||
private final @NotNull Throwable throwable;
|
private final @NotNull Throwable throwable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs this exception.
|
* Creates and initializes an instance of this exception.
|
||||||
*
|
*
|
||||||
* @param throwable throwable thrown by the static initializer
|
* @param throwable throwable thrown by the static initializer
|
||||||
* @since v1-alpha2
|
* @since v1-alpha2
|
|
@ -20,7 +20,7 @@
|
||||||
/**
|
/**
|
||||||
* Exceptions related to reflection.
|
* Exceptions related to reflection.
|
||||||
*
|
*
|
||||||
* @see de.staropensource.sosengine.base.reflection
|
* @see de.staropensource.engine.base.reflection
|
||||||
* @since v1-alpha2
|
* @since v1-alpha2
|
||||||
*/
|
*/
|
||||||
package de.staropensource.sosengine.base.exception.reflection;
|
package de.staropensource.engine.base.exception.reflection;
|
|
@ -17,9 +17,9 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.exception.versioning;
|
package de.staropensource.engine.base.exception.versioning;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.VersioningSystem;
|
import de.staropensource.engine.base.implementable.VersioningSystem;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Thrown when trying to compare a {@link VersioningSystem} against another
|
* Thrown when trying to compare a {@link VersioningSystem} against another
|
||||||
|
@ -29,7 +29,7 @@ import de.staropensource.sosengine.base.implementable.VersioningSystem;
|
||||||
*/
|
*/
|
||||||
public class IncompatibleVersioningSystemException extends RuntimeException {
|
public class IncompatibleVersioningSystemException extends RuntimeException {
|
||||||
/**
|
/**
|
||||||
* Constructs this exception.
|
* Creates and initializes an instance of this exception.
|
||||||
*
|
*
|
||||||
* @param required required versioning system ie. the versioning system throwing this error
|
* @param required required versioning system ie. the versioning system throwing this error
|
||||||
* @param found found versioning system ie. the incompatible one
|
* @param found found versioning system ie. the incompatible one
|
|
@ -17,9 +17,9 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.exception.versioning;
|
package de.staropensource.engine.base.exception.versioning;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.VersioningSystem;
|
import de.staropensource.engine.base.implementable.VersioningSystem;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
@ -51,7 +51,7 @@ public class InvalidVersionStringException extends Exception {
|
||||||
private final @Nullable Throwable throwable;
|
private final @Nullable Throwable throwable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs this exception.
|
* Creates and initializes an instance of this exception.
|
||||||
*
|
*
|
||||||
* @param versioningSystem versioning system that is unable to parse version strings
|
* @param versioningSystem versioning system that is unable to parse version strings
|
||||||
* @param versionString version string {@code a}
|
* @param versionString version string {@code a}
|
||||||
|
@ -65,7 +65,7 @@ public class InvalidVersionStringException extends Exception {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs this exception.
|
* Creates and initializes an instance of this exception.
|
||||||
*
|
*
|
||||||
* @param versioningSystem versioning system that is unable to parse version strings
|
* @param versioningSystem versioning system that is unable to parse version strings
|
||||||
* @param versionString version string {@code a}
|
* @param versionString version string {@code a}
|
||||||
|
@ -78,7 +78,7 @@ public class InvalidVersionStringException extends Exception {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs this exception.
|
* Creates and initializes an instance of this exception.
|
||||||
*
|
*
|
||||||
* @param versioningSystem versioning system that is unable to parse version strings
|
* @param versioningSystem versioning system that is unable to parse version strings
|
||||||
* @param versionString version string {@code a}
|
* @param versionString version string {@code a}
|
||||||
|
@ -91,7 +91,7 @@ public class InvalidVersionStringException extends Exception {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs this exception.
|
* Creates and initializes an instance of this exception.
|
||||||
*
|
*
|
||||||
* @param versioningSystem versioning system that is unable to parse version strings
|
* @param versioningSystem versioning system that is unable to parse version strings
|
||||||
* @param versionString version string {@code a}
|
* @param versionString version string {@code a}
|
|
@ -18,9 +18,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exceptions thrown by implementations of {@link de.staropensource.sosengine.base.implementable.VersioningSystem}s.
|
* Exceptions thrown by implementations of {@link de.staropensource.engine.base.implementable.VersioningSystem}s.
|
||||||
*
|
*
|
||||||
* @see de.staropensource.sosengine.base.implementable.VersioningSystem
|
* @see de.staropensource.engine.base.implementable.VersioningSystem
|
||||||
* @since v1-alpha1
|
* @since v1-alpha1
|
||||||
*/
|
*/
|
||||||
package de.staropensource.sosengine.base.exception.versioning;
|
package de.staropensource.engine.base.exception.versioning;
|
|
@ -17,10 +17,9 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.implementable;
|
package de.staropensource.engine.base.implementable;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.logging.LoggerInstance;
|
import de.staropensource.engine.base.utility.PropertiesReader;
|
||||||
import de.staropensource.sosengine.base.utility.PropertiesReader;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
@ -37,23 +36,11 @@ import java.util.Properties;
|
||||||
*/
|
*/
|
||||||
public abstract class Configuration {
|
public abstract class Configuration {
|
||||||
/**
|
/**
|
||||||
* Contains the {@link LoggerInstance} for this instance.
|
* Creates and initializes an instance of this abstract class.
|
||||||
*
|
*
|
||||||
* @see LoggerInstance
|
|
||||||
* @since v1-alpha1
|
|
||||||
*/
|
|
||||||
protected final @NotNull LoggerInstance logger;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs this class.
|
|
||||||
*
|
|
||||||
* @param origin see {@link LoggerInstance.Builder#setOrigin(String)}
|
|
||||||
* @since v1-alpha2
|
* @since v1-alpha2
|
||||||
*/
|
*/
|
||||||
public Configuration(@NotNull String origin) {
|
protected Configuration() {
|
||||||
// Set logger instance
|
|
||||||
logger = new LoggerInstance.Builder().setClazz(getClass()).setOrigin(origin).build();
|
|
||||||
|
|
||||||
// Load default configuration
|
// Load default configuration
|
||||||
loadDefaultConfiguration();
|
loadDefaultConfiguration();
|
||||||
}
|
}
|
|
@ -17,9 +17,9 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.implementable;
|
package de.staropensource.engine.base.implementable;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.helper.EventHelper;
|
import de.staropensource.engine.base.implementable.helper.EventHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents an event.
|
* Represents an event.
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.implementable;
|
package de.staropensource.engine.base.implementable;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.helper.EventHelper;
|
import de.staropensource.engine.base.implementable.helper.EventHelper;
|
||||||
import de.staropensource.sosengine.base.type.EventPriority;
|
import de.staropensource.engine.base.type.EventPriority;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -42,11 +42,11 @@ public abstract class EventListenerCode {
|
||||||
public @NotNull EventPriority priority = EventPriority.DEFAULT;
|
public @NotNull EventPriority priority = EventPriority.DEFAULT;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this abstract class.
|
||||||
*
|
*
|
||||||
* @since v1-alpha5
|
* @since v1-alpha5
|
||||||
*/
|
*/
|
||||||
public EventListenerCode() {}
|
protected EventListenerCode() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invokes the event listener.
|
* Invokes the event listener.
|
|
@ -17,39 +17,27 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder.crashhandler;
|
package de.staropensource.engine.base.implementable;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.logging.Logger;
|
||||||
|
import de.staropensource.engine.base.type.logging.LogLevel;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implements the {@code issuer_path} placeholder.
|
* Interface for implementing custom logger implementations.
|
||||||
*
|
*
|
||||||
* @see Placeholder
|
* @see Logger#setLoggingAdapter(LoggingAdapter)
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({ "unused" })
|
public interface LoggingAdapter {
|
||||||
public final class IssuerPath implements Placeholder {
|
|
||||||
/**
|
/**
|
||||||
* Issuer class to use.
|
* Prints a log message.
|
||||||
*
|
*
|
||||||
|
* @param level level of the log call
|
||||||
|
* @param issuer {@link StackTraceElement} of the issuer
|
||||||
|
* @param message raw message
|
||||||
|
* @param format processed log call output (print this!)
|
||||||
* @since v1-alpha2
|
* @since v1-alpha2
|
||||||
*/
|
*/
|
||||||
private final @NotNull Class<?> issuerClass;
|
void print(@NotNull LogLevel level, @NotNull StackTraceElement issuer, @NotNull String message, @NotNull String format);
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs this class.
|
|
||||||
*
|
|
||||||
* @param issuerClass issuer class to use
|
|
||||||
* @since v1-alpha0
|
|
||||||
*/
|
|
||||||
public IssuerPath(@NotNull Class<?> issuerClass) {
|
|
||||||
this.issuerClass = issuerClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
|
||||||
@Override
|
|
||||||
public @NotNull String replace(@NotNull String text) {
|
|
||||||
return text.replace("%issuer_path%", issuerClass.getName());
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -17,9 +17,9 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.implementable;
|
package de.staropensource.engine.base.implementable;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.utility.PlaceholderEngine;
|
import de.staropensource.engine.base.utility.PlaceholderEngine;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -17,11 +17,11 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.implementable;
|
package de.staropensource.engine.base.implementable;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.EngineConfiguration;
|
import de.staropensource.engine.base.EngineConfiguration;
|
||||||
import de.staropensource.sosengine.base.exception.ParserException;
|
import de.staropensource.engine.base.exception.ParserException;
|
||||||
import de.staropensource.sosengine.base.logging.LoggerInstance;
|
import de.staropensource.engine.base.logging.Logger;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ import java.util.LinkedList;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class for implementing a shortcode converter.
|
* Base class for implementing a shortcode parser.
|
||||||
* <p>
|
* <p>
|
||||||
* This class parses a string and converts it into a list of
|
* This class parses a string and converts it into a list of
|
||||||
* components, which can then be in turn be converted to something
|
* components, which can then be in turn be converted to something
|
||||||
|
@ -48,16 +48,9 @@ import java.util.Locale;
|
||||||
*
|
*
|
||||||
* @since v1-alpha1
|
* @since v1-alpha1
|
||||||
*/
|
*/
|
||||||
|
@Getter
|
||||||
@SuppressWarnings({ "JavadocDeclaration" })
|
@SuppressWarnings({ "JavadocDeclaration" })
|
||||||
public abstract class ShortcodeParser {
|
public abstract class ShortcodeParser {
|
||||||
/**
|
|
||||||
* Contains the {@link LoggerInstance} for this instance.
|
|
||||||
*
|
|
||||||
* @see LoggerInstance
|
|
||||||
* @since v1-alpha1
|
|
||||||
*/
|
|
||||||
protected final @NotNull LoggerInstance logger;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains a list of components the parsed text is made out of.
|
* Contains a list of components the parsed text is made out of.
|
||||||
*
|
*
|
||||||
|
@ -68,19 +61,17 @@ public abstract class ShortcodeParser {
|
||||||
* @return component list
|
* @return component list
|
||||||
* @since v1-alpha1
|
* @since v1-alpha1
|
||||||
*/
|
*/
|
||||||
@Getter
|
|
||||||
protected final @NotNull LinkedList<String> components;
|
protected final @NotNull LinkedList<String> components;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this abstract class.
|
||||||
*
|
*
|
||||||
* @param string string to parse
|
* @param string string to parse
|
||||||
* @param ignoreInvalidEscapes if {@code true}, will ignore and treat invalid escapes as text
|
* @param ignoreInvalidEscapes if {@code true}, will ignore and treat invalid escapes as text
|
||||||
* @throws ParserException on error
|
* @throws ParserException on error
|
||||||
* @since v1-alpha2
|
* @since v1-alpha2
|
||||||
*/
|
*/
|
||||||
public ShortcodeParser(@NotNull String string, boolean ignoreInvalidEscapes) throws ParserException {
|
protected ShortcodeParser(@NotNull String string, boolean ignoreInvalidEscapes) throws ParserException {
|
||||||
logger = new LoggerInstance.Builder().setClazz(getClass()).setOrigin("ENGINE").build();
|
|
||||||
components = parse(string, ignoreInvalidEscapes);
|
components = parse(string, ignoreInvalidEscapes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +83,7 @@ public abstract class ShortcodeParser {
|
||||||
* @param ignoreInvalidEscapes if {@code true}, will ignore and treat invalid escapes as text
|
* @param ignoreInvalidEscapes if {@code true}, will ignore and treat invalid escapes as text
|
||||||
* @return list of components
|
* @return list of components
|
||||||
* @throws ParserException on error
|
* @throws ParserException on error
|
||||||
* @see EngineConfiguration#errorShortcodeConverter
|
* @see EngineConfiguration#errorShortcodeParser
|
||||||
* @since v1-alpha2
|
* @since v1-alpha2
|
||||||
*/
|
*/
|
||||||
protected @NotNull LinkedList<@NotNull String> parse(@NotNull String string, boolean ignoreInvalidEscapes) throws ParserException {
|
protected @NotNull LinkedList<@NotNull String> parse(@NotNull String string, boolean ignoreInvalidEscapes) throws ParserException {
|
||||||
|
@ -128,110 +119,53 @@ public abstract class ShortcodeParser {
|
||||||
tagActive = false;
|
tagActive = false;
|
||||||
|
|
||||||
// fg:*
|
// fg:*
|
||||||
if (part.toString().startsWith("fg:")) {
|
if (part.toString().startsWith("fg:"))
|
||||||
// Print debug message
|
|
||||||
if (EngineConfiguration.getInstance().isDebugShortcodeConverter())
|
|
||||||
System.out.println(getClass().getName() + "#" + string.hashCode() + " tag=fg data=" + part.substring(3).toUpperCase());
|
|
||||||
|
|
||||||
if (isValidColor(part.substring(3).toUpperCase()))
|
if (isValidColor(part.substring(3).toUpperCase()))
|
||||||
components.add("COLOR:FOREGROUND:" + part.substring(3).toUpperCase());
|
components.add("COLOR:FOREGROUND:" + part.substring(3).toUpperCase());
|
||||||
else {
|
else {
|
||||||
// Complain about invalid shortcode
|
// Complain about invalid shortcode
|
||||||
if (EngineConfiguration.getInstance().isErrorShortcodeConverter())
|
if (EngineConfiguration.getInstance() != null && EngineConfiguration.getInstance().isErrorShortcodeParser())
|
||||||
logger.sarn("Invalid shortcode: " + part);
|
Logger.sarn("Invalid shortcode: " + part);
|
||||||
|
|
||||||
// Convert tag regular text
|
// Convert tag regular text
|
||||||
components.add("TEXT:" + "<" + part + ">");
|
components.add("TEXT:" + "<" + part + ">");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// bg:*
|
// bg:*
|
||||||
else if (part.toString().startsWith("bg:")) {
|
else if (part.toString().startsWith("bg:"))
|
||||||
// Print debug message
|
|
||||||
if (EngineConfiguration.getInstance().isDebugShortcodeConverter())
|
|
||||||
System.out.println(getClass().getName() + "#" + string.hashCode() + " tag=bg data=" + part.substring(3).toUpperCase());
|
|
||||||
|
|
||||||
if (isValidColor(part.substring(3).toUpperCase()))
|
if (isValidColor(part.substring(3).toUpperCase()))
|
||||||
components.add("COLOR:BACKGROUND:" + part.substring(3).toUpperCase());
|
components.add("COLOR:BACKGROUND:" + part.substring(3).toUpperCase());
|
||||||
else {
|
else {
|
||||||
// Complain about invalid shortcode
|
// Complain about invalid shortcode
|
||||||
if (EngineConfiguration.getInstance().isErrorShortcodeConverter())
|
if (EngineConfiguration.getInstance() != null && EngineConfiguration.getInstance().isErrorShortcodeParser())
|
||||||
logger.sarn("Invalid shortcode: " + part);
|
Logger.sarn("Invalid shortcode: " + part);
|
||||||
|
|
||||||
// Convert tag regular text
|
// Convert tag regular text
|
||||||
components.add("TEXT:" + "<" + part + ">");
|
components.add("TEXT:" + "<" + part + ">");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// bold
|
// bold
|
||||||
else if (part.toString().equals("bold")) {
|
else if (part.toString().equals("bold"))
|
||||||
// Print debug message
|
|
||||||
if (EngineConfiguration.getInstance().isDebugShortcodeConverter())
|
|
||||||
System.out.println(getClass().getName() + "#" + string.hashCode() + " tag=bold");
|
|
||||||
|
|
||||||
// Insert attribute
|
|
||||||
components.add("ATTRIBUTE:BOLD");
|
components.add("ATTRIBUTE:BOLD");
|
||||||
}
|
|
||||||
|
|
||||||
// italic
|
// italic
|
||||||
else if (part.toString().equals("italic")) {
|
else if (part.toString().equals("italic"))
|
||||||
// Print debug message
|
|
||||||
if (EngineConfiguration.getInstance().isDebugShortcodeConverter())
|
|
||||||
System.out.println(getClass().getName() + "#" + string.hashCode() + " tag=italic");
|
|
||||||
|
|
||||||
// Insert attribute
|
|
||||||
components.add("ATTRIBUTE:ITALIC");
|
components.add("ATTRIBUTE:ITALIC");
|
||||||
}
|
|
||||||
|
|
||||||
// strikethrough
|
// strikethrough
|
||||||
else if (part.toString().equals("strikethrough")) {
|
else if (part.toString().equals("strikethrough"))
|
||||||
// Print debug message
|
|
||||||
if (EngineConfiguration.getInstance().isDebugShortcodeConverter())
|
|
||||||
System.out.println(getClass().getName() + "#" + string.hashCode() + " tag=strikethrough");
|
|
||||||
|
|
||||||
// Insert attribute
|
|
||||||
components.add("ATTRIBUTE:STRIKETHROUGH");
|
components.add("ATTRIBUTE:STRIKETHROUGH");
|
||||||
}
|
|
||||||
|
|
||||||
// underline
|
// underline
|
||||||
else if (part.toString().equals("underline")) {
|
else if (part.toString().equals("underline"))
|
||||||
// Print debug message
|
|
||||||
if (EngineConfiguration.getInstance().isDebugShortcodeConverter())
|
|
||||||
System.out.println(getClass().getName() + "#" + string.hashCode() + " tag=underline");
|
|
||||||
|
|
||||||
// Insert attribute
|
|
||||||
components.add("ATTRIBUTE:UNDERLINE");
|
components.add("ATTRIBUTE:UNDERLINE");
|
||||||
}
|
// blink
|
||||||
|
else if (part.toString().equals("blink"))
|
||||||
// underline
|
|
||||||
else if (part.toString().equals("blink")) {
|
|
||||||
// Print debug message
|
|
||||||
if (EngineConfiguration.getInstance().isDebugShortcodeConverter())
|
|
||||||
System.out.println(getClass().getName() + "#" + string.hashCode() + " tag=blink");
|
|
||||||
|
|
||||||
// Insert attribute
|
|
||||||
components.add("ATTRIBUTE:BLINK");
|
components.add("ATTRIBUTE:BLINK");
|
||||||
}
|
|
||||||
|
|
||||||
// reset
|
// reset
|
||||||
else if (part.toString().equals("reset")) {
|
else if (part.toString().equals("reset"))
|
||||||
// Print debug message
|
|
||||||
if (EngineConfiguration.getInstance().isDebugShortcodeConverter())
|
|
||||||
System.out.println(getClass().getName() + "#" + string.hashCode() + " tag=reset");
|
|
||||||
|
|
||||||
// Insert reset
|
|
||||||
components.add("RESET");
|
components.add("RESET");
|
||||||
}
|
|
||||||
|
|
||||||
// error case
|
// error case
|
||||||
else {
|
else {
|
||||||
// Print debug message
|
|
||||||
if (EngineConfiguration.getInstance().isDebugShortcodeConverter())
|
|
||||||
System.out.println(getClass().getName() + "#" + string.hashCode() + " invalidtag=" + part);
|
|
||||||
|
|
||||||
// Complain about invalid shortcode
|
// Complain about invalid shortcode
|
||||||
if (EngineConfiguration.getInstance().isErrorShortcodeConverter())
|
if (EngineConfiguration.getInstance() != null && EngineConfiguration.getInstance().isErrorShortcodeParser())
|
||||||
logger.sarn("Invalid shortcode: " + part);
|
Logger.sarn("Invalid shortcode: " + part);
|
||||||
|
|
||||||
// Convert tag regular text
|
// Convert tag regular text
|
||||||
components.add("TEXT:" + "<" + part + ">");
|
components.add("TEXT:" + "<" + part + ">");
|
||||||
|
@ -248,9 +182,6 @@ public abstract class ShortcodeParser {
|
||||||
if (character == '<') {
|
if (character == '<') {
|
||||||
if (!part.isEmpty()) {
|
if (!part.isEmpty()) {
|
||||||
// Tag is starting, insert previous text
|
// Tag is starting, insert previous text
|
||||||
if (EngineConfiguration.getInstance().isDebugShortcodeConverter())
|
|
||||||
System.out.println(getClass().getName() + "#" + string.hashCode() + " text=" + part);
|
|
||||||
|
|
||||||
components.add("TEXT:" + part);
|
components.add("TEXT:" + part);
|
||||||
part = new StringBuilder();
|
part = new StringBuilder();
|
||||||
}
|
}
|
||||||
|
@ -264,12 +195,8 @@ public abstract class ShortcodeParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Processing ended, insert leftover text
|
// Processing ended, insert leftover text
|
||||||
if (!part.isEmpty()) {
|
if (!part.isEmpty())
|
||||||
if (EngineConfiguration.getInstance().isDebugShortcodeConverter())
|
|
||||||
System.out.println(getClass().getName() + "#" + string.hashCode() + " endtext=" + part);
|
|
||||||
|
|
||||||
components.add("TEXT:" + part);
|
components.add("TEXT:" + part);
|
||||||
}
|
|
||||||
|
|
||||||
return components;
|
return components;
|
||||||
}
|
}
|
|
@ -17,9 +17,9 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.implementable;
|
package de.staropensource.engine.base.implementable;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.Engine;
|
import de.staropensource.engine.base.Engine;
|
||||||
import org.jetbrains.annotations.Range;
|
import org.jetbrains.annotations.Range;
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -17,37 +17,28 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.implementable;
|
package de.staropensource.engine.base.implementable;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.Engine;
|
import de.staropensource.engine.base.Engine;
|
||||||
import de.staropensource.sosengine.base.annotation.EngineSubsystem;
|
import de.staropensource.engine.base.annotation.EngineSubsystem;
|
||||||
import de.staropensource.sosengine.base.annotation.EventListener;
|
import de.staropensource.engine.base.annotation.EventListener;
|
||||||
import de.staropensource.sosengine.base.internal.event.InternalEngineShutdownEvent;
|
import de.staropensource.engine.base.event.InternalEngineShutdownEvent;
|
||||||
import de.staropensource.sosengine.base.logging.LoggerInstance;
|
import de.staropensource.engine.base.type.DependencyVector;
|
||||||
import de.staropensource.sosengine.base.type.DependencyVector;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for building subsystem main classes.
|
* Abstract class for building subsystem main classes.
|
||||||
*
|
*
|
||||||
* @see EngineSubsystem
|
* @see EngineSubsystem
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
||||||
public abstract class SubsystemClass {
|
public abstract class SubsystemClass {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this abstract class.
|
||||||
*
|
*
|
||||||
* @since v1-alpha2
|
* @since v1-alpha2
|
||||||
*/
|
*/
|
||||||
public SubsystemClass() {}
|
protected SubsystemClass() {}
|
||||||
|
|
||||||
/**
|
|
||||||
* Contains the {@link LoggerInstance} for this instance.
|
|
||||||
*
|
|
||||||
* @see LoggerInstance
|
|
||||||
* @since v1-alpha0
|
|
||||||
*/
|
|
||||||
public final LoggerInstance logger = new LoggerInstance.Builder().setClazz(getClass()).setOrigin("ENGINE").build();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the name of the subsystem.
|
* Returns the name of the subsystem.
|
|
@ -17,9 +17,9 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.implementable;
|
package de.staropensource.engine.base.implementable;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.exception.versioning.IncompatibleVersioningSystemException;
|
import de.staropensource.engine.base.exception.versioning.IncompatibleVersioningSystemException;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Range;
|
import org.jetbrains.annotations.Range;
|
||||||
|
|
|
@ -17,22 +17,23 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.implementable.helper;
|
package de.staropensource.engine.base.implementable.helper;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.EngineConfiguration;
|
import de.staropensource.engine.base.EngineConfiguration;
|
||||||
import de.staropensource.sosengine.base.EngineInternals;
|
import de.staropensource.engine.base.EngineInternals;
|
||||||
import de.staropensource.sosengine.base.annotation.EventListener;
|
import de.staropensource.engine.base.annotation.EventListener;
|
||||||
import de.staropensource.sosengine.base.event.LogEvent;
|
import de.staropensource.engine.base.event.LogEvent;
|
||||||
import de.staropensource.sosengine.base.exception.reflection.InstanceMethodFromStaticContextException;
|
import de.staropensource.engine.base.exception.reflection.InstanceMethodFromStaticContextException;
|
||||||
import de.staropensource.sosengine.base.exception.reflection.InvalidMethodSignatureException;
|
import de.staropensource.engine.base.exception.reflection.InvalidMethodSignatureException;
|
||||||
import de.staropensource.sosengine.base.exception.reflection.NoAccessException;
|
import de.staropensource.engine.base.exception.reflection.NoAccessException;
|
||||||
import de.staropensource.sosengine.base.exception.reflection.StaticInitializerException;
|
import de.staropensource.engine.base.exception.reflection.StaticInitializerException;
|
||||||
import de.staropensource.sosengine.base.implementable.Event;
|
import de.staropensource.engine.base.implementable.Event;
|
||||||
import de.staropensource.sosengine.base.implementable.EventListenerCode;
|
import de.staropensource.engine.base.implementable.EventListenerCode;
|
||||||
import de.staropensource.sosengine.base.internal.implementation.EventListenerMethod;
|
import de.staropensource.engine.base.internal.implementation.EventListenerMethod;
|
||||||
import de.staropensource.sosengine.base.logging.LoggerInstance;
|
|
||||||
import de.staropensource.sosengine.base.type.EventPriority;
|
import de.staropensource.engine.base.logging.Logger;
|
||||||
import de.staropensource.sosengine.base.utility.ListFormatter;
|
import de.staropensource.engine.base.type.EventPriority;
|
||||||
|
import de.staropensource.engine.base.utility.ListFormatter;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
@ -52,14 +53,6 @@ import java.util.*;
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
public final class EventHelper {
|
public final class EventHelper {
|
||||||
/**
|
|
||||||
* Contains the {@link LoggerInstance} for this instance.
|
|
||||||
*
|
|
||||||
* @see LoggerInstance
|
|
||||||
* @since v1-alpha1
|
|
||||||
*/
|
|
||||||
private static final @NotNull LoggerInstance logger = new LoggerInstance.Builder().setClazz(EventHelper.class).setOrigin("ENGINE").build();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds all cached events.
|
* Holds all cached events.
|
||||||
*
|
*
|
||||||
|
@ -68,7 +61,7 @@ public final class EventHelper {
|
||||||
private static final @NotNull Map<@NotNull Class<? extends Event>, LinkedList<@NotNull EventListenerCode>> cachedEventListeners = new HashMap<>();
|
private static final @NotNull Map<@NotNull Class<? extends Event>, LinkedList<@NotNull EventListenerCode>> cachedEventListeners = new HashMap<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this class.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
||||||
|
@ -105,7 +98,7 @@ public final class EventHelper {
|
||||||
cachedEventListeners.put(event, list);
|
cachedEventListeners.put(event, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.diag("Registered event listener " + eventListener + " for event " + event + " with priority " + priority.name());
|
Logger.diag("Registered event listener " + eventListener + " for event " + event + " with priority " + priority.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -177,26 +170,26 @@ public final class EventHelper {
|
||||||
public static void invokeAnnotatedMethods(@NotNull Class<? extends Event> event, Object... arguments) {
|
public static void invokeAnnotatedMethods(@NotNull Class<? extends Event> event, Object... arguments) {
|
||||||
if (event != LogEvent.class && EngineConfiguration.getInstance().isDebugEvents())
|
if (event != LogEvent.class && EngineConfiguration.getInstance().isDebugEvents())
|
||||||
if (arguments.length == 0)
|
if (arguments.length == 0)
|
||||||
logger.diag("Event " + event.getName() + " was emitted");
|
Logger.diag("Event " + event.getName() + " was emitted");
|
||||||
else
|
else
|
||||||
logger.diag("Event " + event.getName() + " was emitted, passing arguments " + ListFormatter.formatArray(arguments));
|
Logger.diag("Event " + event.getName() + " was emitted, passing arguments " + ListFormatter.formatArray(arguments));
|
||||||
|
|
||||||
Runnable eventCode = () -> {
|
Runnable eventCode = () -> {
|
||||||
for (EventListenerCode eventListener : getAnnotatedMethods(event)) {
|
for (EventListenerCode eventListener : getAnnotatedMethods(event)) {
|
||||||
try {
|
try {
|
||||||
eventListener.run(arguments);
|
eventListener.run(arguments);
|
||||||
} catch (NoAccessException exception) {
|
} catch (NoAccessException exception) {
|
||||||
logger.warn("Event listener " + eventListener + " could not be called as the method could not be accessed");
|
Logger.warn("Event listener " + eventListener + " could not be called as the method could not be accessed");
|
||||||
} catch (InvalidMethodSignatureException exception) {
|
} catch (InvalidMethodSignatureException exception) {
|
||||||
logger.warn("Event listener " + eventListener + " has an invalid method signature");
|
Logger.warn("Event listener " + eventListener + " has an invalid method signature");
|
||||||
} catch (InvocationTargetException exception) {
|
} catch (InvocationTargetException exception) {
|
||||||
logger.crash("Event listener " + eventListener + " threw a throwable", exception.getTargetException(), true);
|
Logger.crash("Event listener " + eventListener + " threw a throwable", exception.getTargetException(), true);
|
||||||
} catch (InstanceMethodFromStaticContextException exception) {
|
} catch (InstanceMethodFromStaticContextException exception) {
|
||||||
logger.warn("Event listener " + eventListener + " is not static. Event listener methods must be static for them to be called.");
|
Logger.warn("Event listener " + eventListener + " is not static. Event listener methods must be static for them to be called.");
|
||||||
} catch (StaticInitializerException exception) {
|
} catch (StaticInitializerException exception) {
|
||||||
logger.crash("Event listener " + eventListener + " could not be called as the static initializer failed", exception.getThrowable(), true);
|
Logger.crash("Event listener " + eventListener + " could not be called as the static initializer failed", exception.getThrowable(), true);
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
logger.crash("Event listener " + eventListener + " could not be called as an error occurred during reflection", exception, true);
|
Logger.crash("Event listener " + eventListener + " could not be called as an error occurred during reflection", exception, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
|
@ -23,4 +23,4 @@
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
||||||
package de.staropensource.sosengine.base.implementable.helper;
|
package de.staropensource.engine.base.implementable.helper;
|
|
@ -22,4 +22,4 @@
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
||||||
package de.staropensource.sosengine.base.implementable;
|
package de.staropensource.engine.base.implementable;
|
|
@ -0,0 +1,56 @@
|
||||||
|
/*
|
||||||
|
* STAROPENSOURCE ENGINE SOURCE FILE
|
||||||
|
* Copyright (c) 2024 The StarOpenSource Engine Authors
|
||||||
|
* Licensed under the GNU Affero General Public License v3
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package de.staropensource.engine.base.implementation.logging;
|
||||||
|
|
||||||
|
import de.staropensource.engine.base.EngineConfiguration;
|
||||||
|
import de.staropensource.engine.base.implementable.LoggingAdapter;
|
||||||
|
import de.staropensource.engine.base.logging.Logger;
|
||||||
|
import de.staropensource.engine.base.type.logging.LogLevel;
|
||||||
|
import de.staropensource.engine.base.implementation.shortcode.EmptyShortcodeParser;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prints log messages to the console, without any fancy colors or formatting.
|
||||||
|
*
|
||||||
|
* @see Logger
|
||||||
|
* @see LoggingAdapter
|
||||||
|
* @since v1-alpha1
|
||||||
|
*/
|
||||||
|
public class PlainLoggingAdapter implements LoggingAdapter {
|
||||||
|
/**
|
||||||
|
* Creates and initializes an instance of this class.
|
||||||
|
*
|
||||||
|
* @since v1-alpha1
|
||||||
|
*/
|
||||||
|
public PlainLoggingAdapter() {}
|
||||||
|
|
||||||
|
/** {@inheritDoc} */
|
||||||
|
@Override
|
||||||
|
public void print(@NotNull LogLevel level, @NotNull StackTraceElement issuer, @NotNull String message, @NotNull String format) {
|
||||||
|
format = new EmptyShortcodeParser(format, true).getClean();
|
||||||
|
if (level == LogLevel.ERROR || level == LogLevel.CRASH)
|
||||||
|
if (EngineConfiguration.getInstance() != null && EngineConfiguration.getInstance().isLogForceStandardOutput())
|
||||||
|
System.out.println(format);
|
||||||
|
else
|
||||||
|
System.err.println(format);
|
||||||
|
else
|
||||||
|
System.out.println(format);
|
||||||
|
}
|
||||||
|
}
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.implementation.logging;
|
package de.staropensource.engine.base.implementation.logging;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.LoggingAdapter;
|
import de.staropensource.engine.base.implementable.LoggingAdapter;
|
||||||
import de.staropensource.sosengine.base.type.logging.LogLevel;
|
import de.staropensource.engine.base.type.logging.LogLevel;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.Nullable;
|
||||||
*/
|
*/
|
||||||
public class QuietLoggingAdapter implements LoggingAdapter {
|
public class QuietLoggingAdapter implements LoggingAdapter {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this class.
|
||||||
*
|
*
|
||||||
* @since v1-alpha4
|
* @since v1-alpha4
|
||||||
*/
|
*/
|
||||||
|
@ -40,17 +40,5 @@ public class QuietLoggingAdapter implements LoggingAdapter {
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@Override
|
@Override
|
||||||
public @Nullable String prePlaceholder(@NotNull LogLevel level, @NotNull Class<?> issuerClass, @NotNull String issuerOrigin, @Nullable String issuerMetadata, @NotNull String message, @NotNull String format) {
|
public void print(@NotNull LogLevel level, @NotNull StackTraceElement issuer, @NotNull String message, @NotNull String format) {}
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
|
||||||
@Override
|
|
||||||
public @NotNull String postPlaceholder(@NotNull LogLevel level, @NotNull Class<?> issuerClass, @NotNull String issuerOrigin, @Nullable String issuerMetadata, @NotNull String message, @NotNull String format) {
|
|
||||||
return format;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
|
||||||
@Override
|
|
||||||
public void print(@NotNull LogLevel level, @NotNull Class<?> issuerClass, @NotNull String issuerOrigin, @Nullable String issuerMetadata, @NotNull String message, @NotNull String format) {}
|
|
||||||
}
|
}
|
|
@ -17,12 +17,12 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.implementation.logging;
|
package de.staropensource.engine.base.implementation.logging;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.EngineConfiguration;
|
import de.staropensource.engine.base.EngineConfiguration;
|
||||||
import de.staropensource.sosengine.base.implementable.LoggingAdapter;
|
import de.staropensource.engine.base.implementable.LoggingAdapter;
|
||||||
import de.staropensource.sosengine.base.logging.Logger;
|
import de.staropensource.engine.base.logging.Logger;
|
||||||
import de.staropensource.sosengine.base.type.logging.LogLevel;
|
import de.staropensource.engine.base.type.logging.LogLevel;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ import org.jetbrains.annotations.Nullable;
|
||||||
*/
|
*/
|
||||||
public class RawLoggingAdapter implements LoggingAdapter {
|
public class RawLoggingAdapter implements LoggingAdapter {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this class.
|
||||||
*
|
*
|
||||||
* @since v1-alpha1
|
* @since v1-alpha1
|
||||||
*/
|
*/
|
||||||
|
@ -44,21 +44,9 @@ public class RawLoggingAdapter implements LoggingAdapter {
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@Override
|
@Override
|
||||||
public @Nullable String prePlaceholder(@NotNull LogLevel level, @NotNull Class<?> issuerClass, @NotNull String issuerOrigin, @Nullable String issuerMetadata, @NotNull String message, @NotNull String format) {
|
public void print(@NotNull LogLevel level, @NotNull StackTraceElement issuer, @NotNull String message, @NotNull String format) {
|
||||||
return null; // No modifications necessary
|
|
||||||
}
|
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
|
||||||
@Override
|
|
||||||
public @NotNull String postPlaceholder(@NotNull LogLevel level, @NotNull Class<?> issuerClass, @NotNull String issuerOrigin, @Nullable String issuerMetadata, @NotNull String message, @NotNull String format) {
|
|
||||||
return format; // No modifications necessary
|
|
||||||
}
|
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
|
||||||
@Override
|
|
||||||
public void print(@NotNull LogLevel level, @NotNull Class<?> issuerClass, @NotNull String issuerOrigin, @Nullable String issuerMetadata, @NotNull String message, @NotNull String format) {
|
|
||||||
if (level == LogLevel.ERROR || level == LogLevel.CRASH)
|
if (level == LogLevel.ERROR || level == LogLevel.CRASH)
|
||||||
if (EngineConfiguration.getInstance().isLoggerForceStandardOutput())
|
if (EngineConfiguration.getInstance().isLogForceStandardOutput())
|
||||||
System.out.println(format);
|
System.out.println(format);
|
||||||
else
|
else
|
||||||
System.err.println(format);
|
System.err.println(format);
|
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
* STAROPENSOURCE ENGINE SOURCE FILE
|
||||||
|
* Copyright (c) 2024 The StarOpenSource Engine Authors
|
||||||
|
* Licensed under the GNU Affero General Public License v3
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A set of built-in {@link de.staropensource.engine.base.implementable.LoggingAdapter}s.
|
||||||
|
*
|
||||||
|
* @since v1-alpha1
|
||||||
|
*/
|
||||||
|
package de.staropensource.engine.base.implementation.logging;
|
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
* STAROPENSOURCE ENGINE SOURCE FILE
|
||||||
|
* Copyright (c) 2024 The StarOpenSource Engine Authors
|
||||||
|
* Licensed under the GNU Affero General Public License v3
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implementations for various interfaces and abstract classes.
|
||||||
|
*
|
||||||
|
* @since v1-alpha6
|
||||||
|
*/
|
||||||
|
package de.staropensource.engine.base.implementation;
|
|
@ -17,28 +17,28 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.implementation.shortcode;
|
package de.staropensource.engine.base.implementation.shortcode;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.ShortcodeParser;
|
import de.staropensource.engine.base.implementable.ShortcodeParser;
|
||||||
import de.staropensource.sosengine.base.exception.ParserException;
|
import de.staropensource.engine.base.exception.ParserException;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cleans the string of any tags.
|
* Cleans the string of any tags.
|
||||||
*
|
*
|
||||||
* @see ShortcodeParser
|
* @see ShortcodeParser
|
||||||
* @since v1-alpha1
|
* @since v1-alpha8
|
||||||
*/
|
*/
|
||||||
public final class EmptyShortcodeConverter extends ShortcodeParser {
|
public final class EmptyShortcodeParser extends ShortcodeParser {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this class.
|
||||||
*
|
*
|
||||||
* @param string string to parse
|
* @param string string to parse
|
||||||
* @param ignoreInvalidEscapes if {@code true}, will ignore and treat invalid escapes as text
|
* @param ignoreInvalidEscapes if {@code true}, will ignore and treat invalid escapes as text
|
||||||
* @throws ParserException on error
|
* @throws ParserException on error
|
||||||
* @since v1-alpha1
|
* @since v1-alpha8
|
||||||
*/
|
*/
|
||||||
public EmptyShortcodeConverter(@NotNull String string, boolean ignoreInvalidEscapes) throws ParserException {
|
public EmptyShortcodeParser(@NotNull String string, boolean ignoreInvalidEscapes) throws ParserException {
|
||||||
super(string, ignoreInvalidEscapes);
|
super(string, ignoreInvalidEscapes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ public final class EmptyShortcodeConverter extends ShortcodeParser {
|
||||||
* Returns the parsed string without any tags.
|
* Returns the parsed string without any tags.
|
||||||
*
|
*
|
||||||
* @return cleaned input string
|
* @return cleaned input string
|
||||||
* @since v1-alpha1
|
* @since v1-alpha8
|
||||||
*/
|
*/
|
||||||
public @NotNull String getClean() {
|
public @NotNull String getClean() {
|
||||||
StringBuilder output = new StringBuilder();
|
StringBuilder output = new StringBuilder();
|
|
@ -22,4 +22,4 @@
|
||||||
*
|
*
|
||||||
* @since v1-alpha1
|
* @since v1-alpha1
|
||||||
*/
|
*/
|
||||||
package de.staropensource.sosengine.base.implementation.shortcode;
|
package de.staropensource.engine.base.implementation.shortcode;
|
|
@ -17,12 +17,12 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.implementation.versioning;
|
package de.staropensource.engine.base.implementation.versioning;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.VersioningSystem;
|
import de.staropensource.engine.base.implementable.VersioningSystem;
|
||||||
import de.staropensource.sosengine.base.exception.versioning.IncompatibleVersioningSystemException;
|
import de.staropensource.engine.base.exception.versioning.IncompatibleVersioningSystemException;
|
||||||
import de.staropensource.sosengine.base.exception.versioning.InvalidVersionStringException;
|
import de.staropensource.engine.base.exception.versioning.InvalidVersionStringException;
|
||||||
import de.staropensource.sosengine.base.utility.Miscellaneous;
|
import de.staropensource.engine.base.utility.Miscellaneous;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Range;
|
import org.jetbrains.annotations.Range;
|
||||||
|
@ -90,7 +90,8 @@ public final class FourNumberVersioningSystem implements VersioningSystem {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses a four number-based version string.
|
* Tries to parse the specified version string
|
||||||
|
* and if successful, return a new instance.
|
||||||
*
|
*
|
||||||
* @param versionString version string to parse
|
* @param versionString version string to parse
|
||||||
* @throws InvalidVersionStringException if the version string is invalid
|
* @throws InvalidVersionStringException if the version string is invalid
|
|
@ -17,11 +17,11 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.implementation.versioning;
|
package de.staropensource.engine.base.implementation.versioning;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.VersioningSystem;
|
import de.staropensource.engine.base.implementable.VersioningSystem;
|
||||||
import de.staropensource.sosengine.base.exception.versioning.IncompatibleVersioningSystemException;
|
import de.staropensource.engine.base.exception.versioning.IncompatibleVersioningSystemException;
|
||||||
import de.staropensource.sosengine.base.exception.versioning.InvalidVersionStringException;
|
import de.staropensource.engine.base.exception.versioning.InvalidVersionStringException;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Range;
|
import org.jetbrains.annotations.Range;
|
||||||
|
@ -53,7 +53,8 @@ public final class OneNumberVersioningSystem implements VersioningSystem {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses a one number-based version string.
|
* Tries to parse the specified version string
|
||||||
|
* and if successful, return a new instance.
|
||||||
*
|
*
|
||||||
* @param versionString version string to parse
|
* @param versionString version string to parse
|
||||||
* @throws InvalidVersionStringException if the version string is invalid
|
* @throws InvalidVersionStringException if the version string is invalid
|
|
@ -17,12 +17,12 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.implementation.versioning;
|
package de.staropensource.engine.base.implementation.versioning;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.VersioningSystem;
|
import de.staropensource.engine.base.implementable.VersioningSystem;
|
||||||
import de.staropensource.sosengine.base.exception.versioning.IncompatibleVersioningSystemException;
|
import de.staropensource.engine.base.exception.versioning.IncompatibleVersioningSystemException;
|
||||||
import de.staropensource.sosengine.base.exception.versioning.InvalidVersionStringException;
|
import de.staropensource.engine.base.exception.versioning.InvalidVersionStringException;
|
||||||
import de.staropensource.sosengine.base.utility.Miscellaneous;
|
import de.staropensource.engine.base.utility.Miscellaneous;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
@ -109,7 +109,8 @@ public final class SemanticVersioningSystem implements VersioningSystem {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses a semantic versioning string.
|
* Tries to parse the specified version string
|
||||||
|
* and if successful, return a new instance.
|
||||||
*
|
*
|
||||||
* @param versionString version string to parse
|
* @param versionString version string to parse
|
||||||
* @throws InvalidVersionStringException if the version string is invalid
|
* @throws InvalidVersionStringException if the version string is invalid
|
|
@ -17,12 +17,12 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.implementation.versioning;
|
package de.staropensource.engine.base.implementation.versioning;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.VersioningSystem;
|
import de.staropensource.engine.base.implementable.VersioningSystem;
|
||||||
import de.staropensource.sosengine.base.exception.versioning.IncompatibleVersioningSystemException;
|
import de.staropensource.engine.base.exception.versioning.IncompatibleVersioningSystemException;
|
||||||
import de.staropensource.sosengine.base.exception.versioning.InvalidVersionStringException;
|
import de.staropensource.engine.base.exception.versioning.InvalidVersionStringException;
|
||||||
import de.staropensource.sosengine.base.type.VersionType;
|
import de.staropensource.engine.base.type.VersionType;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
@ -110,7 +110,8 @@ public final class StarOpenSourceVersioningSystem implements VersioningSystem {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses a StarOpenSource versioning string.
|
* Tries to parse the specified version string
|
||||||
|
* and if successful, return a new instance.
|
||||||
*
|
*
|
||||||
* @param versionString version string to parse
|
* @param versionString version string to parse
|
||||||
* @throws InvalidVersionStringException if the version string is invalid
|
* @throws InvalidVersionStringException if the version string is invalid
|
|
@ -17,12 +17,12 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.implementation.versioning;
|
package de.staropensource.engine.base.implementation.versioning;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.VersioningSystem;
|
import de.staropensource.engine.base.implementable.VersioningSystem;
|
||||||
import de.staropensource.sosengine.base.exception.versioning.IncompatibleVersioningSystemException;
|
import de.staropensource.engine.base.exception.versioning.IncompatibleVersioningSystemException;
|
||||||
import de.staropensource.sosengine.base.exception.versioning.InvalidVersionStringException;
|
import de.staropensource.engine.base.exception.versioning.InvalidVersionStringException;
|
||||||
import de.staropensource.sosengine.base.utility.Miscellaneous;
|
import de.staropensource.engine.base.utility.Miscellaneous;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Range;
|
import org.jetbrains.annotations.Range;
|
||||||
|
@ -78,7 +78,8 @@ public final class ThreeNumberVersioningSystem implements VersioningSystem {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses a three number-based version string.
|
* Tries to parse the specified version string
|
||||||
|
* and if successful, return a new instance.
|
||||||
*
|
*
|
||||||
* @param versionString version string to parse
|
* @param versionString version string to parse
|
||||||
* @throws InvalidVersionStringException if the version string is invalid
|
* @throws InvalidVersionStringException if the version string is invalid
|
|
@ -17,12 +17,12 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.implementation.versioning;
|
package de.staropensource.engine.base.implementation.versioning;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.VersioningSystem;
|
import de.staropensource.engine.base.implementable.VersioningSystem;
|
||||||
import de.staropensource.sosengine.base.exception.versioning.IncompatibleVersioningSystemException;
|
import de.staropensource.engine.base.exception.versioning.IncompatibleVersioningSystemException;
|
||||||
import de.staropensource.sosengine.base.exception.versioning.InvalidVersionStringException;
|
import de.staropensource.engine.base.exception.versioning.InvalidVersionStringException;
|
||||||
import de.staropensource.sosengine.base.utility.Miscellaneous;
|
import de.staropensource.engine.base.utility.Miscellaneous;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Range;
|
import org.jetbrains.annotations.Range;
|
||||||
|
@ -66,7 +66,8 @@ public final class TwoNumberVersioningSystem implements VersioningSystem {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses a two number-based version string.
|
* Tries to parse the specified version string
|
||||||
|
* and if successful, return a new instance.
|
||||||
*
|
*
|
||||||
* @param versionString version string to parse
|
* @param versionString version string to parse
|
||||||
* @throws InvalidVersionStringException if the version string is invalid
|
* @throws InvalidVersionStringException if the version string is invalid
|
|
@ -23,4 +23,4 @@
|
||||||
*
|
*
|
||||||
* @since v1-alpha1
|
* @since v1-alpha1
|
||||||
*/
|
*/
|
||||||
package de.staropensource.sosengine.base.implementation.versioning;
|
package de.staropensource.engine.base.implementation.versioning;
|
|
@ -17,11 +17,11 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation;
|
package de.staropensource.engine.base.internal.implementation;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.EventListenerCode;
|
import de.staropensource.engine.base.implementable.EventListenerCode;
|
||||||
import de.staropensource.sosengine.base.reflection.Reflect;
|
import de.staropensource.engine.base.reflection.Reflect;
|
||||||
import de.staropensource.sosengine.base.reflection.ReflectionMethod;
|
import de.staropensource.engine.base.reflection.ReflectionMethod;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ public final class EventListenerMethod extends EventListenerCode {
|
||||||
private final @NotNull ReflectionMethod method;
|
private final @NotNull ReflectionMethod method;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this class.
|
||||||
*
|
*
|
||||||
* @param method method to execute
|
* @param method method to execute
|
||||||
* @since v1-alpha5
|
* @since v1-alpha5
|
||||||
|
@ -53,7 +53,7 @@ public final class EventListenerMethod extends EventListenerCode {
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@Override
|
@Override
|
||||||
public void run(Object[] arguments) throws Exception {
|
public void run(@Nullable Object @NotNull [] arguments) throws Exception {
|
||||||
method.invoke(arguments);
|
method.invoke(arguments);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,4 +22,4 @@
|
||||||
*
|
*
|
||||||
* @since v1-alpha5
|
* @since v1-alpha5
|
||||||
*/
|
*/
|
||||||
package de.staropensource.sosengine.base.internal.implementation;
|
package de.staropensource.engine.base.internal.implementation;
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.Math;
|
import de.staropensource.engine.base.utility.Math;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
@ -34,7 +34,7 @@ import java.util.Calendar;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class DateDay implements Placeholder {
|
public final class DateDay implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.Math;
|
import de.staropensource.engine.base.utility.Math;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
@ -34,7 +34,7 @@ import java.util.Calendar;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class DateMonth implements Placeholder {
|
public final class DateMonth implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.Math;
|
import de.staropensource.engine.base.utility.Math;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
@ -34,7 +34,7 @@ import java.util.Calendar;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class DateYear implements Placeholder {
|
public final class DateYear implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.information.EngineInformation;
|
import de.staropensource.engine.base.utility.information.EngineInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class EngineDependencyJansi implements Placeholder {
|
public final class EngineDependencyJansi implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.information.EngineInformation;
|
import de.staropensource.engine.base.utility.information.EngineInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class EngineDependencyLwjgl implements Placeholder {
|
public final class EngineDependencyLwjgl implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.information.EngineInformation;
|
import de.staropensource.engine.base.utility.information.EngineInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class EngineDependencyReflections implements Placeholder {
|
public final class EngineDependencyReflections implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.information.EngineInformation;
|
import de.staropensource.engine.base.utility.information.EngineInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class EngineDependencySlf4j implements Placeholder {
|
public final class EngineDependencySlf4j implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.information.EngineInformation;
|
import de.staropensource.engine.base.utility.information.EngineInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class EngineGitBranch implements Placeholder {
|
public final class EngineGitBranch implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.information.EngineInformation;
|
import de.staropensource.engine.base.utility.information.EngineInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class EngineGitCommitHeader implements Placeholder {
|
public final class EngineGitCommitHeader implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.information.EngineInformation;
|
import de.staropensource.engine.base.utility.information.EngineInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class EngineGitCommitIdLong implements Placeholder {
|
public final class EngineGitCommitIdLong implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.information.EngineInformation;
|
import de.staropensource.engine.base.utility.information.EngineInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class EngineGitCommitIdShort implements Placeholder {
|
public final class EngineGitCommitIdShort implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.information.EngineInformation;
|
import de.staropensource.engine.base.utility.information.EngineInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class EngineGitCommitTimeDay implements Placeholder {
|
public final class EngineGitCommitTimeDay implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.information.EngineInformation;
|
import de.staropensource.engine.base.utility.information.EngineInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class EngineGitCommitTimeHour implements Placeholder {
|
public final class EngineGitCommitTimeHour implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.information.EngineInformation;
|
import de.staropensource.engine.base.utility.information.EngineInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class EngineGitCommitTimeMinute implements Placeholder {
|
public final class EngineGitCommitTimeMinute implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.information.EngineInformation;
|
import de.staropensource.engine.base.utility.information.EngineInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class EngineGitCommitTimeMonth implements Placeholder {
|
public final class EngineGitCommitTimeMonth implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.information.EngineInformation;
|
import de.staropensource.engine.base.utility.information.EngineInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class EngineGitCommitTimeSecond implements Placeholder {
|
public final class EngineGitCommitTimeSecond implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.information.EngineInformation;
|
import de.staropensource.engine.base.utility.information.EngineInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class EngineGitCommitTimeYear implements Placeholder {
|
public final class EngineGitCommitTimeYear implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.information.EngineInformation;
|
import de.staropensource.engine.base.utility.information.EngineInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class EngineGitCommits implements Placeholder {
|
public final class EngineGitCommits implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.information.EngineInformation;
|
import de.staropensource.engine.base.utility.information.EngineInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class EngineGitCommitterEmail implements Placeholder {
|
public final class EngineGitCommitterEmail implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.information.EngineInformation;
|
import de.staropensource.engine.base.utility.information.EngineInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class EngineGitCommitterName implements Placeholder {
|
public final class EngineGitCommitterName implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.information.EngineInformation;
|
import de.staropensource.engine.base.utility.information.EngineInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class EngineGitDirty implements Placeholder {
|
public final class EngineGitDirty implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,9 +17,9 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -31,7 +31,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class EngineVersion implements Placeholder {
|
public final class EngineVersion implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,40 +17,30 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder.crashhandler;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
|
import de.staropensource.engine.base.utility.information.EngineInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implements the {@code crash_message} placeholder.
|
* Implements the {@code engine_version_codename} placeholder.
|
||||||
*
|
*
|
||||||
* @see Placeholder
|
* @see Placeholder
|
||||||
* @since v1-alpha0
|
* @since v1-alpha8
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class CrashMessage implements Placeholder {
|
public final class EngineVersionCodename implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* The message to use.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha8
|
||||||
*/
|
*/
|
||||||
@NotNull
|
public EngineVersionCodename() {}
|
||||||
private final String message;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs this class.
|
|
||||||
*
|
|
||||||
* @param message message to use
|
|
||||||
* @since v1-alpha0
|
|
||||||
*/
|
|
||||||
public CrashMessage(@NotNull String message) {
|
|
||||||
this.message = message;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@Override
|
@Override
|
||||||
public @NotNull String replace(@NotNull String text) {
|
public @NotNull String replace(@NotNull String text) {
|
||||||
return text.replace("%crash_message%", message);
|
return text.replace("%engine_version_codename%", EngineInformation.getVersioningCodename());
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.information.EngineInformation;
|
import de.staropensource.engine.base.utility.information.EngineInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class EngineVersionFork implements Placeholder {
|
public final class EngineVersionFork implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.information.EngineInformation;
|
import de.staropensource.engine.base.utility.information.EngineInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class EngineVersionType implements Placeholder {
|
public final class EngineVersionType implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.information.EngineInformation;
|
import de.staropensource.engine.base.utility.information.EngineInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class EngineVersionTyperelease implements Placeholder {
|
public final class EngineVersionTyperelease implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.information.EngineInformation;
|
import de.staropensource.engine.base.utility.information.EngineInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class EngineVersionVersion implements Placeholder {
|
public final class EngineVersionVersion implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.information.JvmInformation;
|
import de.staropensource.engine.base.utility.information.JvmInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class JvmArguments implements Placeholder {
|
public final class JvmArguments implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.information.JvmInformation;
|
import de.staropensource.engine.base.utility.information.JvmInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class JvmImplementationName implements Placeholder {
|
public final class JvmImplementationName implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.information.JvmInformation;
|
import de.staropensource.engine.base.utility.information.JvmInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class JvmImplementationVendor implements Placeholder {
|
public final class JvmImplementationVendor implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.staropensource.sosengine.base.internal.implementation.placeholder;
|
package de.staropensource.engine.base.internal.implementation.placeholder;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.implementable.Placeholder;
|
import de.staropensource.engine.base.implementable.Placeholder;
|
||||||
import de.staropensource.sosengine.base.utility.information.JvmInformation;
|
import de.staropensource.engine.base.utility.information.JvmInformation;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@SuppressWarnings({ "unused" })
|
@SuppressWarnings({ "unused" })
|
||||||
public final class JvmImplementationVersion implements Placeholder {
|
public final class JvmImplementationVersion implements Placeholder {
|
||||||
/**
|
/**
|
||||||
* Constructs this class.
|
* Creates and initializes an instance of this event.
|
||||||
*
|
*
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue