~skiqqy/libCosmic

3cf03b7b505345a754b0dc44261b2a7660f54fd3 — Stephen Cochrane 9 months ago 277815a
Added marker class for module confs
M pom.xml => pom.xml +2 -2
@@ 4,8 4,8 @@
                      http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>xyz.skiqqy.cosmic.lib</groupId>
    <artifactId>libCosmic</artifactId>
    <groupId>xyz.skiqqy.cosmic</groupId>
    <artifactId>lib</artifactId>
    <version>1.0.0</version>

    <repositories>

M src/main/java/xyz/skiqqy/cosmic/lib/module/Module.java => src/main/java/xyz/skiqqy/cosmic/lib/module/Module.java +2 -4
@@ 7,8 7,6 @@ import java.lang.annotation.Target;

import org.springframework.web.bind.annotation.RestController;

import xyz.skiqqy.comfy.core.Conf;

/* A "Module" is bean which takes a config used to build a restful web service
* for some abstract java application.
*


@@ 20,7 18,7 @@ import xyz.skiqqy.comfy.core.Conf;
* The contract a class accepts when using this annotation is the following.
*
* 1. There can only be a single constructor, with 2 argument's:
*   - A xyz.skiqqy.comfy.core.Conf (or a subclass there off), specifically it
*   - ModuleConf (or a subclass there off), specifically it
*   takes the type given to the annotation.
*   - A string, which is to be prepended to any paths (i.e the root url)
*


@@ 42,5 40,5 @@ import xyz.skiqqy.comfy.core.Conf;
@Retention(RetentionPolicy.RUNTIME)
@RestController
public @interface Module {
    Class<? extends Conf> value();
    Class<? extends ModuleConf> value();
}

A src/main/java/xyz/skiqqy/cosmic/lib/module/ModuleConf.java => src/main/java/xyz/skiqqy/cosmic/lib/module/ModuleConf.java +6 -0
@@ 0,0 1,6 @@
package xyz.skiqqy.cosmic.lib.module;

import xyz.skiqqy.comfy.core.Conf;

// Marker class, helpful for searching for modules
public abstract class ModuleConf extends Conf {}