Class ExtensionCodeEditor.FunctionHeaderBuilder

  • Enclosing class:
    ExtensionCodeEditor

    public static class ExtensionCodeEditor.FunctionHeaderBuilder
    extends java.lang.Object
    Helper class to build nicely formatted extension-function style def lines and docstring comments
    • Constructor Detail

      • FunctionHeaderBuilder

        public FunctionHeaderBuilder()
    • Method Detail

      • arg

        public ExtensionCodeEditor.FunctionHeaderBuilder arg​(java.lang.String argName,
                                                             java.lang.String argDescription)
        Adds an argument. Arguments will be listed in the order added, with the exception of 'self' if included, which will always be first.
      • argFromSchema

        public ExtensionCodeEditor.FunctionHeaderBuilder argFromSchema​(java.lang.String argName,
                                                                       JsonSchema schema)
        Adds an argument. Arguments will be listed in the order added, with the exception of 'self' if included, which will always be first. Extracts (recursively) information about the argument from the schema provided.
      • build

        public java.lang.String build()
        Builds the header and docstring with a default width of 80
      • build

        public java.lang.String build​(int width)
        Builds the header and docstring.
        Parameters:
        width - The width of the output