Class ValidatorFactory<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>


  • public class ValidatorFactory<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>
    extends java.lang.Object
    A factory for creating Validator instances from string representation. The string representation consists of a class name (which must implement Validator) and optional constructor arguments.
    • Constructor Detail

      • ValidatorFactory

        public ValidatorFactory​(@NotNull
                                @NotNull ValidatorPreferences validatorPreferences,
                                @NotNull
                                @NotNull GameObjectMatchers gameObjectMatchers,
                                @NotNull
                                @NotNull ProjectSettings projectSettings,
                                @NotNull
                                @NotNull MapWriter<G,​A,​R> mapWriter,
                                @NotNull
                                @NotNull MapManager<G,​A,​R> mapManager)
        Creates a new instance.
        Parameters:
        validatorPreferences - the validator preferences to pass to the newly created validator instances
        gameObjectMatchers - the game object matchers for looking up game object matcher instances from string representation
        projectSettings - the project settings to pass to the newly created validator instances
        mapWriter - the map writer to pass to the newly created validator instances
        mapManager - the map writer to pass to the newly created validator instances
    • Method Detail

      • newValidator

        @NotNull
        public @NotNull Validator<G,​A,​R> newValidator​(@NotNull
                                                                  @NotNull java.lang.CharSequence spec)
                                                           throws NoSuchValidatorException
        Creates a new Validator instance from string representation.
        Parameters:
        spec - the string representation
        Returns:
        the validator instance
        Throws:
        NoSuchValidatorException - if the validator cannot be created