Package ghidra.app.cmd.label
Class CreateNamespacesCmd
- java.lang.Object
-
- ghidra.app.cmd.label.CreateNamespacesCmd
-
- All Implemented Interfaces:
Command
public class CreateNamespacesCmd extends java.lang.Object implements Command
This class attempts to create a namespace for each token in the provided string. Thus, when providing a namespace string, do not include the name of anything other than namespaces, such as the name of a symbol.To view the assumptions for creating namespaces from a path string, see the
NamespaceUtils
class.- Since:
- Tracker Id 619
- See Also:
NamespaceUtils
-
-
Constructor Summary
Constructors Constructor Description CreateNamespacesCmd(java.lang.String namespacesString, Namespace parentNamespace, SourceType source)
Takes a namespace string that will be parsed and the results of which will be used for creating the namespaces if they do not exist.CreateNamespacesCmd(java.lang.String namespacesString, SourceType source)
Takes a namespace string that will be parsed and the results of which will be used for creating the namespaces if they do not exist.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
applyTo(DomainObject obj)
Applies the command to the given domain object.java.lang.String
getName()
Returns the name of this command.Namespace
getNamespace()
Returns the newly created namespace or null if one was not created.java.lang.String
getStatusMsg()
Returns the status message indicating the status of the command.
-
-
-
Constructor Detail
-
CreateNamespacesCmd
public CreateNamespacesCmd(java.lang.String namespacesString, SourceType source)
Takes a namespace string that will be parsed and the results of which will be used for creating the namespaces if they do not exist.Calling this constructor is equivalent to calling:
Command command = new CreateNamespacesCmd( namespaceString, null );
- Parameters:
namespacesString
- The string to be parsed.source
- the source of the namespace- See Also:
- example format, assumptions
-
CreateNamespacesCmd
public CreateNamespacesCmd(java.lang.String namespacesString, Namespace parentNamespace, SourceType source)
Takes a namespace string that will be parsed and the results of which will be used for creating the namespaces if they do not exist.- Parameters:
namespacesString
- The string to be parsed.parentNamespace
- The namespace to be used as the starting parent of the namespaces that will be created.source
- the source of the namespace- Throws:
java.lang.NullPointerException
- ifnamespaceString
isnull
.- See Also:
- example format, assumptions
-
-
Method Detail
-
applyTo
public boolean applyTo(DomainObject obj)
Description copied from interface:Command
Applies the command to the given domain object.- Specified by:
applyTo
in interfaceCommand
- Parameters:
obj
- domain object that this command is to be applied.- Returns:
- true if the command applied successfully
- See Also:
Command.applyTo(ghidra.framework.model.DomainObject)
-
getNamespace
public Namespace getNamespace()
Returns the newly created namespace or null if one was not created.- Returns:
- the newly created namespace or null if one was not created.
-
getStatusMsg
public java.lang.String getStatusMsg()
Description copied from interface:Command
Returns the status message indicating the status of the command.- Specified by:
getStatusMsg
in interfaceCommand
- Returns:
- reason for failure, or null if the status of the command was successful
-
-