Class ModuleLibrary
- java.lang.Object
-
- com.inductiveautomation.ignition.common.script.ModuleLibrary
-
public class ModuleLibrary extends java.lang.Object
Class for project resource Python script libraries
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ModuleLibrary.ScriptHintScope
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CODE_DATA_KEY
static ModuleLibrary.ScriptHintScope
DEFAULT_HINT_SCOPE
static java.lang.String
HINT_SCOPE_KEY
static java.lang.String
LEGACY_PROJECT_MODULE
static java.lang.String
LEGACY_SHARED_MODULE
static java.lang.String
MODULE_ID
static ResourceType
RESOURCE_TYPE
static int
SCOPE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
deserializeScript(ProjectResource r)
static ModuleLibrary.ScriptHintScope
getScope(ProjectResource resource)
static void
install(Project project, ScriptManager manager)
static void
install(java.util.List<ProjectResource> scripts, ScriptManager manager)
static java.util.function.Consumer<ProjectResourceBuilder>
serializeScript(java.lang.String script, ModuleLibrary.ScriptHintScope scope)
static boolean
validateFullPath(org.python.core.PyStringMap modules, StringPath fullPath)
Validates a StringPath of potential package names (ending with a module name) to ensure all elements are legal names.static boolean
validatePackageName(org.python.core.PyStringMap modules, ResourcePath destination, java.lang.String newValue)
Checks whether a given name is legal to be inserted at the target location.
-
-
-
Field Detail
-
MODULE_ID
public static final java.lang.String MODULE_ID
- See Also:
- Constant Field Values
-
RESOURCE_TYPE
public static final ResourceType RESOURCE_TYPE
-
SCOPE
public static final int SCOPE
- See Also:
- Constant Field Values
-
CODE_DATA_KEY
public static final java.lang.String CODE_DATA_KEY
- See Also:
- Constant Field Values
-
LEGACY_SHARED_MODULE
public static final java.lang.String LEGACY_SHARED_MODULE
- See Also:
- Constant Field Values
-
LEGACY_PROJECT_MODULE
public static final java.lang.String LEGACY_PROJECT_MODULE
- See Also:
- Constant Field Values
-
HINT_SCOPE_KEY
public static final java.lang.String HINT_SCOPE_KEY
- See Also:
- Constant Field Values
-
DEFAULT_HINT_SCOPE
public static final ModuleLibrary.ScriptHintScope DEFAULT_HINT_SCOPE
-
-
Method Detail
-
install
public static void install(Project project, ScriptManager manager)
-
install
public static void install(java.util.List<ProjectResource> scripts, ScriptManager manager)
-
deserializeScript
public static java.lang.String deserializeScript(ProjectResource r)
-
serializeScript
public static java.util.function.Consumer<ProjectResourceBuilder> serializeScript(java.lang.String script, ModuleLibrary.ScriptHintScope scope)
-
getScope
public static ModuleLibrary.ScriptHintScope getScope(ProjectResource resource)
-
validatePackageName
public static boolean validatePackageName(@Nonnull org.python.core.PyStringMap modules, @Nonnull ResourcePath destination, @Nonnull java.lang.String newValue)
Checks whether a given name is legal to be inserted at the target location.- Parameters:
modules
- The modules installed in the relevant context' ScriptManager; seeScriptManager.getModules()
destination
- The path where this resource will be inserted. Used to check for sibling conflicts.newValue
- The actual name up for consideration.- Returns:
- Whether the given name (at the given location) is legal to be inserted.
-
validateFullPath
public static boolean validateFullPath(org.python.core.PyStringMap modules, StringPath fullPath)
Validates a StringPath of potential package names (ending with a module name) to ensure all elements are legal names.- Parameters:
modules
- The modules installed in the relevant context' ScriptManager;ScriptManager.getModules()
fullPath
- The StringPath to consider.- Returns:
- true only if the full path sequence is valid.
-
-