Class ExtensionCodeEditor.FunctionHeaderBuilder
- java.lang.Object
-
- com.inductiveautomation.ignition.designer.scripteditor.component.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 Summary
Constructors Constructor Description FunctionHeaderBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExtensionCodeEditor.FunctionHeaderBuilder
addSelf()
Call this if you need a "self" argumentExtensionCodeEditor.FunctionHeaderBuilder
arg(java.lang.String argName, java.lang.String argDescription)
Adds an argument.ExtensionCodeEditor.FunctionHeaderBuilder
argFromSchema(java.lang.String argName, JsonSchema schema)
Adds an argument.java.lang.String
build()
Builds the header and docstring with a default width of 80java.lang.String
build(int width)
Builds the header and docstring.ExtensionCodeEditor.FunctionHeaderBuilder
defaultImpl(java.lang.String defaultImpl)
Call this to provide a default implementation for the functionExtensionCodeEditor.FunctionHeaderBuilder
desc(java.lang.String desc)
Gives the function a descriptionExtensionCodeEditor.FunctionHeaderBuilder
name(java.lang.String name)
Sets the function name
-
-
-
Method Detail
-
name
public ExtensionCodeEditor.FunctionHeaderBuilder name(java.lang.String name)
Sets the function name
-
desc
public ExtensionCodeEditor.FunctionHeaderBuilder desc(java.lang.String desc)
Gives the function a description
-
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.
-
defaultImpl
public ExtensionCodeEditor.FunctionHeaderBuilder defaultImpl(java.lang.String defaultImpl)
Call this to provide a default implementation for the function
-
addSelf
public ExtensionCodeEditor.FunctionHeaderBuilder addSelf()
Call this if you need a "self" argument
-
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
-
-