Class JavaValidationRenderer

  • All Implemented Interfaces:
    io.spine.protodata.config.Configured, io.spine.protodata.config.ConfiguredQuerying, io.spine.protodata.Querying

    public final class JavaValidationRenderer
    extends io.spine.protodata.codegen.java.JavaRenderer
    A Renderer for the validation code in Java.

    Inserts code into the Validate insertion point.

    The generated code assumes there is a variable called result. Its type is the type of the validated message. The variable holds the value of the message to validate.

    The generated code is a number of code lines. It does not contain declarations (classes, methods, etc.).

    If the validation rules are broken, throws a ValidationException.

    • Field Summary

      • Fields inherited from class io.spine.protodata.renderer.Renderer

        protoDataContext
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void render​(io.spine.protodata.renderer.SourceFileSet sources)  
      • Methods inherited from class io.spine.protodata.codegen.java.JavaRenderer

        classNameOf, javaFileOf
      • Methods inherited from class io.spine.protodata.renderer.Renderer

        configAs, configIsPresent, getProtoDataContext$compiler, renderSources$compiler, select, setProtoDataContext$compiler
    • Constructor Detail

      • JavaValidationRenderer

        public JavaValidationRenderer()
    • Method Detail

      • render

        protected void render​(io.spine.protodata.renderer.SourceFileSet sources)
        Specified by:
        render in class io.spine.protodata.renderer.Renderer