Class PropertiesFileDocProvider
java.lang.Object
com.inductiveautomation.ignition.common.script.hints.PropertiesFileDocProvider
- All Implemented Interfaces:
ScriptFunctionDocProvider
Default ScriptFunctionDocProvider implementation that relies on various annotations on methods and fields to look up
script documentation in properties files.
Properties files are required to follow a rigid format, following this pattern:
Note:
Each row should begin with the 'bundle prefix'; see JythonElement.docBundlePrefix() and
getBundlePrefix.
common-param.$paramName=This is a fallback parameter name that can be used in multiple methods. $someFunction.desc=This is a description of $someFunction. $someFunction.param.$someParam=This is a description $someParam. $someFunction.param.$someParam.type=A type override for $someParam. \ The supplied type will be passed toTypeDescriptor.lookupOrNull(String). $someFunction.param.$someParam.default=This is the default value for $someParam. \ If specified, the parameter is optional by default. $someFunction.param.$someParam.optional=A b boolean string literal to indicate optionality of $someParam, as \ evaluated byBoolean.parseBoolean(String)$someFunction.param.$someParam.deprecated=This is a deprecation message for $someParam. $someFunction.param.$someParam.replacement=This is a suggested replacement for $someParam. $someFunction.deprecated=This is a deprecation message for $someFunction. $someFunction.replacement=This is a replacement suggestion for $someFunction. $someFunction.returns=This is a description of the return value. $someFunction.returns.type=This is a type override for the return value. \ The supplied type name will be accepted verbatim and not evaluated for correctness or looked up at all. $someFunction.throws.$SomeException=This is a description of why $SomeException would be thrown.
- See Also:
-
Field Summary
FieldsFields inherited from interface com.inductiveautomation.ignition.common.script.hints.ScriptFunctionDocProvider
NO_DOC_PROVIDER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringprotected com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor.ParameterbuildParameter(Method method, String parameterName, Class<?> declaredType, Boolean declaredOptional) getAnnotations(Method method) By default, no Java annotations are exposed to scripting.protected StringgetBundlePrefix(AnnotatedElement element) protected com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor.DeprecationgetDeprecation(String bundlePrefix, String name) protected StringgetExceptionDescription(Method method, String exceptionName) protected List<com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor.Method.ThrowsDetail>getExceptions(Method method) Returns the list of exceptions that the method explicitly throws, plus the list fromJythonThrows, minus the list fromJythonThrows.ignored().protected Stringcom.inductiveautomation.ignition.common.script.typing.CompletionDescriptor.AttributegetFieldDescriptor(String path, Field field) protected com.inductiveautomation.ignition.common.script.typing.TypeDescriptorgetFieldType(Field field) protected Stringprotected Stringcom.inductiveautomation.ignition.common.script.typing.CompletionDescriptor.MethodgetMethodDescriptor(String path, Method method) protected List<com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor.Parameter>getParameters(Method method) protected StringgetReturnDocs(Method method) protected com.inductiveautomation.ignition.common.script.typing.TypeDescriptorgetReturnType(Method method) protected List<com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor.Parameter>parametersFromKeywordArgs(Method method) protected List<com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor.Parameter>parametersFromScriptArgs(Method method) protected booleanshouldBeIgnored(String path, Field field)
-
Field Details
-
IGNORED_EXCEPTIONS
-
-
Constructor Details
-
PropertiesFileDocProvider
public PropertiesFileDocProvider()
-
-
Method Details
-
getMethodDescriptor
@Nullable public com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor.Method getMethodDescriptor(String path, Method method) - Specified by:
getMethodDescriptorin interfaceScriptFunctionDocProvider- Parameters:
path- The path this function is being added at, as given to theScriptManager.method- TheMethodbeing added as a scripting function.- Returns:
- A descriptor for the method.
- See Also:
-
CompletionDescriptor.MethodTypeDescriptor
-
getMethodDescription
-
getParameters
-
parametersFromKeywordArgs
-
parametersFromScriptArgs
-
buildParameter
-
getReturnType
protected com.inductiveautomation.ignition.common.script.typing.TypeDescriptor getReturnType(Method method) -
getReturnDocs
-
getAnnotations
By default, no Java annotations are exposed to scripting. If you want to expose annotations, override this method. -
getExceptions
protected List<com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor.Method.ThrowsDetail> getExceptions(Method method) Returns the list of exceptions that the method explicitly throws, plus the list fromJythonThrows, minus the list fromJythonThrows.ignored(). -
getIgnoredExceptions
-
getExceptionDescription
-
getFieldDescriptor
public com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor.Attribute getFieldDescriptor(String path, Field field) - Specified by:
getFieldDescriptorin interfaceScriptFunctionDocProvider- Parameters:
path- The path this field is being added at, as given to theScriptManager.field- TheFieldbeing added as a scripting field.- Returns:
- A descriptor for the field.
- See Also:
-
CompletionDescriptor.AttributeTypeDescriptor
-
shouldBeIgnored
-
getFieldDescription
-
getFieldValue
-
getFieldType
@Nonnull protected com.inductiveautomation.ignition.common.script.typing.TypeDescriptor getFieldType(Field field) -
getBundlePrefix
-
b10n
-
getDeprecation
-