public final class Util extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DO_YOU_WANT_TO_CONTINUE_CONTEXT_COMMIT
Context for
handleDoYouWantToContinue(java.lang.String) that represents committing local
unsynchronized changes. |
static String |
DO_YOU_WANT_TO_CONTINUE_CONTEXT_COMMIT_REFERENCE_CHANGE_AFTER_ABORT
Context for
handleDoYouWantToContinue(java.lang.String) that represents the fact
that during the creation of a static Version or the switch to a dynamic Version
one or more references were changed but not committed and the user requested to
abort. |
static String |
DO_YOU_WANT_TO_CONTINUE_CONTEXT_CREATE_DYNAMIC_VERSION
Context for
handleDoYouWantToContinue(java.lang.String) that represents creating a
new dynamic Version. |
static String |
DO_YOU_WANT_TO_CONTINUE_CONTEXT_CREATE_STATIC_VERSION
Context for
handleDoYouWantToContinue(java.lang.String) that represents creating a
new static Version. |
static String |
DO_YOU_WANT_TO_CONTINUE_CONTEXT_DELETE_WORKSPACE_DIRECTORY
Context for
handleDoYouWantToContinue(java.lang.String) that represents deleting
a workspace directory (not containing any unsynchronized local changes). |
static String |
DO_YOU_WANT_TO_CONTINUE_CONTEXT_DELETE_WORKSPACE_DIRECTORY_WITH_UNSYNC_LOCAL_CHANGES
Context for
handleDoYouWantToContinue(java.lang.String) that represents deleting
a workspace directory containing un synchronized changes. |
static String |
DO_YOU_WANT_TO_CONTINUE_CONTEXT_MAY_LOOSE_COMMITS
Context for
handleDoYouWantToContinue(java.lang.String) that represents the fact
that following the selection of a new dynamic Version during a merge
(MergeReferenceGraph) diverging commits in the destination are not
present in the new selected dynamic Version and may be lost. |
static String |
DO_YOU_WANT_TO_CONTINUE_CONTEXT_MERGE
Context for
handleDoYouWantToContinue(java.lang.String) that represents merging a
Version into another. |
static String |
DO_YOU_WANT_TO_CONTINUE_CONTEXT_NON_STATIC_VERSIONS_REFERENCE_PATH
Context for
handleDoYouWantToContinue(java.lang.String) that represents the fact
that during the switch to a hotfix dynamic Version, the
ReferencePath contains non-static Versions. |
static String |
DO_YOU_WANT_TO_CONTINUE_CONTEXT_REFERENCE_CHANGE_AFTER_SWITCHING
Context for
handleDoYouWantToContinue(java.lang.String) that represents reference
change after switching to a dynamic Version. |
static String |
DO_YOU_WANT_TO_CONTINUE_CONTEXT_SWITCH_WITH_UNSYNC_LOCAL_CHANGES
Context for
handleDoYouWantToContinue(java.lang.String) that represents the fact
that local changes exist in a workspace directory and switching to a new
Version is not possible. |
static String |
DO_YOU_WANT_TO_CONTINUE_CONTEXT_UNSYNC_REMOTE_CHANGES_WHILE_COMMIT
Context for
handleDoYouWantToContinue(java.lang.String) that represents having
unsynchronized remote changes while committing. |
static String |
DO_YOU_WANT_TO_CONTINUE_CONTEXT_UPDATE_REFERENCE
Context for
handleDoYouWantToContinue(java.lang.String) that represents updating a
reference. |
static String |
DO_YOU_WANT_TO_CONTINUE_CONTEXT_USE_CURRENT_HOTFIX_VERSION
Context for
handleDoYouWantToContinue(java.lang.String) that represents the fact
that during the switch to a hotfix dynamic Version, the
ReferencePath contains non-static Versions. |
static String |
MSG_PATTERN_DO_YOU_WANT_TO_CONTINUE
See description in ResourceBundle.
|
static String |
MSG_PATTERN_KEY_ALWAYS_NEVER_ASK_RESPONSE_CHOICES
See description in ResourceBundle.
|
static String |
MSG_PATTERN_KEY_ALWAYS_NEVER_YES_NO_ASK_RESPONSE_CHOICES
See description in ResourceBundle.
|
static String |
MSG_PATTERN_KEY_ALWAYS_RESPONSE
See description in ResourceBundle.
|
static String |
MSG_PATTERN_KEY_ASK_RESPONSE
See description in ResourceBundle.
|
static String |
MSG_PATTERN_KEY_INCORRECT_VERSION_TYPE
See description in ResourceBundle.
|
static String |
MSG_PATTERN_KEY_INVALID_RESPONSE_TRY_AGAIN
See description in ResourceBundle.
|
static String |
MSG_PATTERN_KEY_JOB_ABORTED_BY_USER
See description in ResourceBundle.
|
static String |
MSG_PATTERN_KEY_JOB_COMPLETED
See description in ResourceBundle.
|
static String |
MSG_PATTERN_KEY_NEVER_RESPONSE
See description in ResourceBundle.
|
static String |
MSG_PATTERN_KEY_NO_ABORT_RESPONSE
See description in ResourceBundle.
|
static String |
MSG_PATTERN_KEY_NO_ASK_RESPONSE
See description in ResourceBundle.
|
static String |
MSG_PATTERN_KEY_NO_RESPONSE
See description in ResourceBundle.
|
static String |
MSG_PATTERN_KEY_PREVIOUS_CHANGE_COMMITTED_SCM
See description in ResourceBundle.
|
static String |
MSG_PATTERN_KEY_PREVIOUS_CHANGE_SCM
See description in ResourceBundle.
|
static String |
MSG_PATTERN_KEY_STARTING_JOB
See description in ResourceBundle.
|
static String |
MSG_PATTERN_KEY_TRY_AGAIN
See description in ResourceBundle.
|
static String |
MSG_PATTERN_KEY_VERSION_DOES_NOT_EXIST
See description in ResourceBundle.
|
static String |
MSG_PATTERN_KEY_VERSION_FORMAT_HELP
See description in ResourceBundle.
|
static String |
MSG_PATTERN_KEY_VERSION_FORMAT_HELP_VERSION_MUST_EXIST
See description in ResourceBundle.
|
static String |
MSG_PATTERN_KEY_WORKSPACE_DIRECTORY_NOT_SYNC
See description in ResourceBundle.
|
static String |
MSG_PATTERN_KEY_YES_ALWAYS_NO_ABORT_RESPONSE_CHOICES
See description in ResourceBundle.
|
static String |
MSG_PATTERN_KEY_YES_ALWAYS_NO_RESPONSE_CHOICES
See description in ResourceBundle.
|
static String |
MSG_PATTERN_KEY_YES_ALWAYS_RESPONSE
See description in ResourceBundle.
|
static String |
MSG_PATTERN_KEY_YES_ASK_RESPONSE
See description in ResourceBundle.
|
static String |
MSG_PATTERN_KEY_YES_NO_RESPONSE_CHOICES
See description in ResourceBundle.
|
static String |
MSG_PATTERN_KEY_YES_RESPONSE
See description in ResourceBundle.
|
static String |
RUNTIME_PROPERTY_IND_ABORT
Runtime property indicating to abort.
|
static String |
RUNTIME_PROPERTY_IND_NO_CONFIRM
Runtime property specifying whether confirmation is required.
|
| Constructor and Description |
|---|
Util() |
| Modifier and Type | Method and Description |
|---|---|
static void |
applyDragomSystemProperties()
Applies system properties from the META-INF/dragom.properties classpath
resource.
|
static String |
convertPascalCaseToLowercaseWithDashes(String stringPascalCase)
Converts a PascalCase (or camelCase) string to lowercase with dashes.
|
static String |
getCommitMessageWithoutAttr(String commitMessage)
Helper method to remove commit attributes from a commit message.
|
static Class<? extends org.azyva.dragom.model.plugin.NodePlugin> |
getDefaultClassNodePlugin(String pluginClass)
Returns the default NodePlugin interface for a plugin implementation class.
|
static String |
getDefaultPluginId(Class<? extends org.azyva.dragom.model.plugin.NodePlugin> classNodePlugin,
String pluginClass)
Returns the default plugin ID for NodePlugin interface supported by a
plugin implementation class.
|
static AlwaysNeverAskUserResponse |
getInfoAlwaysNeverAskUserResponse(org.azyva.dragom.execcontext.plugin.UserInteractionCallbackPlugin userInteractionCallbackPlugin,
String prompt,
AlwaysNeverAskUserResponse alwaysNeverAskUserResponseDefaultValue)
Facilitates letting the user input a AlwaysNeverAskUserResponse.
|
static AlwaysNeverAskUserResponse |
getInfoAlwaysNeverAskUserResponseAndHandleAsk(org.azyva.dragom.execcontext.plugin.RuntimePropertiesPlugin runtimePropertiesPlugin,
String runtimeProperty,
org.azyva.dragom.execcontext.plugin.UserInteractionCallbackPlugin userInteractionCallbackPlugin,
String prompt)
This is an extension to the method getInfoAlwaysNeverAskUserResponse that
handles storing the user response in a runtime property.
|
static AlwaysNeverYesNoAskUserResponse |
getInfoAlwaysNeverYesNoAskUserResponse(org.azyva.dragom.execcontext.plugin.UserInteractionCallbackPlugin userInteractionCallbackPlugin,
String prompt,
AlwaysNeverYesNoAskUserResponse alwaysNeverYesNoAskUserResponseDefaultValue)
Facilitates letting the user input a AlwaysNeverYesNoAskUserResponse.
|
static AlwaysNeverYesNoAskUserResponse |
getInfoAlwaysNeverYesNoAskUserResponseAndHandleAsk(org.azyva.dragom.execcontext.plugin.RuntimePropertiesPlugin runtimePropertiesPlugin,
String runtimeProperty,
org.azyva.dragom.execcontext.plugin.UserInteractionCallbackPlugin userInteractionCallbackPlugin,
String prompt)
This is an extension to the method getInfoAlwaysNeverYesNoAskUserResponse that
handles storing the user response in a runtime property.
|
static org.azyva.dragom.model.Version |
getInfoVersion(org.azyva.dragom.model.VersionType versionType,
org.azyva.dragom.model.plugin.ScmPlugin scmPlugin,
org.azyva.dragom.execcontext.plugin.UserInteractionCallbackPlugin userInteractionCallbackPlugin,
String prompt,
org.azyva.dragom.model.Version versionDefaultValue)
Facilitates letting the user input a Version.
|
static YesAlwaysNoUserResponse |
getInfoYesAlwaysNoAbortUserResponse(org.azyva.dragom.execcontext.plugin.UserInteractionCallbackPlugin userInteractionCallbackPlugin,
String prompt,
YesAlwaysNoUserResponse yesAlwaysNoUserResponseDefaultValue)
Facilitates letting the user input a YesAlwaysNoUserResponse with support for
"no" and "abort" responses.
|
static YesAlwaysNoUserResponse |
getInfoYesAlwaysNoUserResponse(org.azyva.dragom.execcontext.plugin.UserInteractionCallbackPlugin userInteractionCallbackPlugin,
String prompt,
YesAlwaysNoUserResponse yesAlwaysNoUserResponseDefaultValue)
Facilitates letting the user input a YesAlwaysNoUserResponse.
|
static YesAlwaysNoUserResponse |
getInfoYesNoUserResponse(org.azyva.dragom.execcontext.plugin.UserInteractionCallbackPlugin userInteractionCallbackPlugin,
String prompt,
YesAlwaysNoUserResponse yesAlwaysNoUserResponseDefaultValue)
This method is very similar to getInfoYesAlwaysNoUserResponse except that it
does not support the "Always" response.
|
static Map<String,String> |
getJsonAttr(String message,
Map<String,String> mapAttr)
Helper method to retrieve attributes from a message.
|
static String |
getLocalizedMsgPattern(String msgPatternKey) |
static org.azyva.dragom.model.plugin.NodePluginFactory |
getNodePluginFactory(String stringClassNodePlugin)
Gets an instance of NodePluginFactory for a plugin implementation class.
|
static boolean |
handleDoYouWantToContinue(String context)
Helper method that handles generically the typical question
"Do you want to continue?".
|
static boolean |
handleDoYouWantToContinueWithIndividualNo(String context)
Helper method that handles generically the typical question
"Do you want to continue?".
|
static String |
inferGroupIdSegmentFromNodePath(org.azyva.dragom.model.NodePath nodePath)
Infers a groupId segment from a module node path.
|
static boolean |
isAbort() |
static boolean |
isDigits(String string)
Verifies if a String contains only ASCII digits.
|
static boolean |
isDirectoryEmpty(Path path) |
static boolean |
isNotNullAndTrue(Boolean aBoolean)
Facilitates interpreting Boolean objects.
|
static boolean |
isNotNullAndTrue(String stringBoolean)
Facilitates interpreting Boolean objects.
|
static boolean |
isPosix() |
static boolean |
isWindows() |
static void |
setAbort()
Sets the IND_ABORT runtime property explicitly.
|
static String |
spaces(int length)
Returns a string of length spaces.
|
public static final String RUNTIME_PROPERTY_IND_NO_CONFIRM
If used as a prefix with ".<context>" as a suffix, it specifies whether
confirmation is required for that particular context.
public static final String RUNTIME_PROPERTY_IND_ABORT
Being a runtime property it can be set at different levels before tool execution, but this would not be useful as it would indicate to abort the tool immediately. If is expected to be set only within the code.
public static final String DO_YOU_WANT_TO_CONTINUE_CONTEXT_UPDATE_REFERENCE
handleDoYouWantToContinue(java.lang.String) that represents updating a
reference.public static final String DO_YOU_WANT_TO_CONTINUE_CONTEXT_CREATE_STATIC_VERSION
handleDoYouWantToContinue(java.lang.String) that represents creating a
new static Version.public static final String DO_YOU_WANT_TO_CONTINUE_CONTEXT_CREATE_DYNAMIC_VERSION
handleDoYouWantToContinue(java.lang.String) that represents creating a
new dynamic Version.public static final String DO_YOU_WANT_TO_CONTINUE_CONTEXT_MERGE
handleDoYouWantToContinue(java.lang.String) that represents merging a
Version into another.public static final String DO_YOU_WANT_TO_CONTINUE_CONTEXT_REFERENCE_CHANGE_AFTER_SWITCHING
handleDoYouWantToContinue(java.lang.String) that represents reference
change after switching to a dynamic Version.public static final String DO_YOU_WANT_TO_CONTINUE_CONTEXT_COMMIT
handleDoYouWantToContinue(java.lang.String) that represents committing local
unsynchronized changes.public static final String DO_YOU_WANT_TO_CONTINUE_CONTEXT_UNSYNC_REMOTE_CHANGES_WHILE_COMMIT
handleDoYouWantToContinue(java.lang.String) that represents having
unsynchronized remote changes while committing.public static final String DO_YOU_WANT_TO_CONTINUE_CONTEXT_DELETE_WORKSPACE_DIRECTORY_WITH_UNSYNC_LOCAL_CHANGES
handleDoYouWantToContinue(java.lang.String) that represents deleting
a workspace directory containing un synchronized changes.public static final String DO_YOU_WANT_TO_CONTINUE_CONTEXT_DELETE_WORKSPACE_DIRECTORY
handleDoYouWantToContinue(java.lang.String) that represents deleting
a workspace directory (not containing any unsynchronized local changes).public static final String DO_YOU_WANT_TO_CONTINUE_CONTEXT_MAY_LOOSE_COMMITS
handleDoYouWantToContinue(java.lang.String) that represents the fact
that following the selection of a new dynamic Version during a merge
(MergeReferenceGraph) diverging commits in the destination are not
present in the new selected dynamic Version and may be lost.public static final String DO_YOU_WANT_TO_CONTINUE_CONTEXT_SWITCH_WITH_UNSYNC_LOCAL_CHANGES
handleDoYouWantToContinue(java.lang.String) that represents the fact
that local changes exist in a workspace directory and switching to a new
Version is not possible. Continuing here means to continue with the
other ModuleVersion.public static final String DO_YOU_WANT_TO_CONTINUE_CONTEXT_NON_STATIC_VERSIONS_REFERENCE_PATH
handleDoYouWantToContinue(java.lang.String) that represents the fact
that during the switch to a hotfix dynamic Version, the
ReferencePath contains non-static Versions. which may be OK if they
were created in the context of the hotfix.public static final String DO_YOU_WANT_TO_CONTINUE_CONTEXT_USE_CURRENT_HOTFIX_VERSION
handleDoYouWantToContinue(java.lang.String) that represents the fact
that during the switch to a hotfix dynamic Version, the
ReferencePath contains non-static Versions. which may be OK if they
were created in the context of the hotfix.public static final String DO_YOU_WANT_TO_CONTINUE_CONTEXT_COMMIT_REFERENCE_CHANGE_AFTER_ABORT
handleDoYouWantToContinue(java.lang.String) that represents the fact
that during the creation of a static Version or the switch to a dynamic Version
one or more references were changed but not committed and the user requested to
abort. Should the commit be performed in that case?public static final String MSG_PATTERN_KEY_ALWAYS_NEVER_ASK_RESPONSE_CHOICES
public static final String MSG_PATTERN_KEY_ALWAYS_RESPONSE
public static final String MSG_PATTERN_KEY_NEVER_RESPONSE
public static final String MSG_PATTERN_KEY_ASK_RESPONSE
public static final String MSG_PATTERN_KEY_ALWAYS_NEVER_YES_NO_ASK_RESPONSE_CHOICES
public static final String MSG_PATTERN_KEY_YES_ASK_RESPONSE
public static final String MSG_PATTERN_KEY_NO_ASK_RESPONSE
public static final String MSG_PATTERN_KEY_YES_ALWAYS_NO_RESPONSE_CHOICES
public static final String MSG_PATTERN_KEY_YES_RESPONSE
public static final String MSG_PATTERN_KEY_YES_ALWAYS_RESPONSE
public static final String MSG_PATTERN_KEY_NO_RESPONSE
public static final String MSG_PATTERN_KEY_YES_ALWAYS_NO_ABORT_RESPONSE_CHOICES
public static final String MSG_PATTERN_KEY_NO_ABORT_RESPONSE
public static final String MSG_PATTERN_KEY_YES_NO_RESPONSE_CHOICES
public static final String MSG_PATTERN_KEY_INVALID_RESPONSE_TRY_AGAIN
public static final String MSG_PATTERN_KEY_VERSION_FORMAT_HELP
public static final String MSG_PATTERN_KEY_VERSION_FORMAT_HELP_VERSION_MUST_EXIST
public static final String MSG_PATTERN_KEY_INCORRECT_VERSION_TYPE
public static final String MSG_PATTERN_KEY_VERSION_DOES_NOT_EXIST
public static final String MSG_PATTERN_KEY_TRY_AGAIN
public static final String MSG_PATTERN_DO_YOU_WANT_TO_CONTINUE
public static final String MSG_PATTERN_KEY_STARTING_JOB
public static final String MSG_PATTERN_KEY_JOB_COMPLETED
public static final String MSG_PATTERN_KEY_JOB_ABORTED_BY_USER
public static final String MSG_PATTERN_KEY_WORKSPACE_DIRECTORY_NOT_SYNC
public static final String MSG_PATTERN_KEY_PREVIOUS_CHANGE_COMMITTED_SCM
public static final String MSG_PATTERN_KEY_PREVIOUS_CHANGE_SCM
public static String inferGroupIdSegmentFromNodePath(org.azyva.dragom.model.NodePath nodePath)
We talk about the groupId segment since a complete groupId will generally be some prefix plus a "." to which the value returned is appended.
If the NodePath is not partial (see NodePath.isPartial), meaning
that it refers to a Module and not a ClassificationNode, the
parent NodePath is used (that of the parent ClassificationNode of the Module).
nodePath - NodePath.public static String convertPascalCaseToLowercaseWithDashes(String stringPascalCase)
stringPascalCase - See description.public static boolean isDirectoryEmpty(Path path)
public static void applyDragomSystemProperties()
This method can be called from many places where it is expected that Dragom properties be available as system properties. This class ensures that loading the system properties is done only once.
System properties take precedence over Dragom properties.
public static Map<String,String> getJsonAttr(String message, Map<String,String> mapAttr)
These attributes are stored in a JSONObject at the beginning of the message. The message must therefore start with "{" and continue to a matching closing "}". For now, embedded JSONObject or "}" are not supported.
If the message does not start with "{", an empty Map is returned (not null).
This is intended to be used for storing arbitrary attributes within commit and other messages in SCM's.
message - Message.mapAttr - Map that will be filled in and returned. If null, a new Map is
created, in which case it should not be modified by the caller (it may be
immutable, especially if empty).public static String getCommitMessageWithoutAttr(String commitMessage)
commitMessage - Commit message.public static boolean isNotNullAndTrue(Boolean aBoolean)
aBoolean - Boolean.public static boolean isNotNullAndTrue(String stringBoolean)
stringBoolean - null, "true" or "false".public static String getLocalizedMsgPattern(String msgPatternKey)
msgPatternKey - Message pattern key within the ResourceBundle.public static AlwaysNeverAskUserResponse getInfoAlwaysNeverAskUserResponse(org.azyva.dragom.execcontext.plugin.UserInteractionCallbackPlugin userInteractionCallbackPlugin, String prompt, AlwaysNeverAskUserResponse alwaysNeverAskUserResponseDefaultValue)
userInteractionCallbackPlugin - UserInteractionCallbackPlugin.prompt - See corresponding parameter in
UserInteractionCallbackPlugin.getInfo.alwaysNeverAskUserResponseDefaultValue - Default user response. It is
translated to the defaultValue parameter in
UserInteractionCallbackPlugin.getInfo.public static AlwaysNeverAskUserResponse getInfoAlwaysNeverAskUserResponseAndHandleAsk(org.azyva.dragom.execcontext.plugin.RuntimePropertiesPlugin runtimePropertiesPlugin, String runtimeProperty, org.azyva.dragom.execcontext.plugin.UserInteractionCallbackPlugin userInteractionCallbackPlugin, String prompt)
First it gets the value of the runtime property runtimeProperty. If it is AlwaysNeverAskUserResponse.ASK (or null) it delegates to the getInfoAlwaysNeverAskUserResponse method. If the user does not respond AlwaysNeverAskUserResponse.ASK, the response is written back to the runtime property (ASK is the default value for the property).
This is at the limit of being generic. It is very specific to one way of handling AlwaysNeverAskUserResponse user input together with a runtime property. But this idiom occurs in many places in Dragom and it was deemed worth factoring it out.
runtimePropertiesPlugin - RuntimePropertiesPlugin.runtimeProperty - Runtime property.userInteractionCallbackPlugin - See corresponding parameter in
getInfoAlwaysNeverAskUserResponse.prompt - See corresponding parameter in getInfoAlwaysNeverAskUserResponse.public static AlwaysNeverYesNoAskUserResponse getInfoAlwaysNeverYesNoAskUserResponse(org.azyva.dragom.execcontext.plugin.UserInteractionCallbackPlugin userInteractionCallbackPlugin, String prompt, AlwaysNeverYesNoAskUserResponse alwaysNeverYesNoAskUserResponseDefaultValue)
userInteractionCallbackPlugin - UserInteractionCallbackPlugin.prompt - See corresponding parameter in
UserInteractionCallbackPlugin.getInfo.alwaysNeverYesNoAskUserResponseDefaultValue - Default user response. It is
translated to the defaultValue parameter in
UserInteractionCallbackPlugin.getInfo.public static AlwaysNeverYesNoAskUserResponse getInfoAlwaysNeverYesNoAskUserResponseAndHandleAsk(org.azyva.dragom.execcontext.plugin.RuntimePropertiesPlugin runtimePropertiesPlugin, String runtimeProperty, org.azyva.dragom.execcontext.plugin.UserInteractionCallbackPlugin userInteractionCallbackPlugin, String prompt)
First it gets the value of the runtime property runtimeProperty. If it is AlwaysNeverYesNoAskUserResponse.YES_ASK (or null) or AlwaysNeverYesNoAskUserResponse.NO_ASK it delegates to the getInfoAlwaysNeverYesNoAskUserResponse method with YES_ASK and NO_ASK respectively as the default value. The response is written back to the runtime property, unless it is AlwaysNeverYesNoAskUserResponse.YES_ASK and it was null to start with (YES_ASK is the default value for the property).
This is at the limit of being generic. It is very specific to one way of handling AlwaysNeverYesNoAskUserResponse user input together with a runtime property. But this idiom occurs in many places in Dragom and it was deemed worth factoring it out.
runtimePropertiesPlugin - RuntimePropertiesPlugin.runtimeProperty - Runtime property.userInteractionCallbackPlugin - See corresponding parameter in
getInfoAlwaysNeverYesNoAskUserResponse.prompt - See corresponding parameter in
getInfoAlwaysNeverYesNoAskUserResponse.public static YesAlwaysNoUserResponse getInfoYesAlwaysNoUserResponse(org.azyva.dragom.execcontext.plugin.UserInteractionCallbackPlugin userInteractionCallbackPlugin, String prompt, YesAlwaysNoUserResponse yesAlwaysNoUserResponseDefaultValue)
userInteractionCallbackPlugin - UserInteractionCallbackPlugin.prompt - See corresponding parameter in
UserInteractionCallbackPlugin.getInfo.yesAlwaysNoUserResponseDefaultValue - Default user response. It is
translated to the defaultValue parameter in
UserInteractionCallbackPlugin.getInfo.public static YesAlwaysNoUserResponse getInfoYesAlwaysNoAbortUserResponse(org.azyva.dragom.execcontext.plugin.UserInteractionCallbackPlugin userInteractionCallbackPlugin, String prompt, YesAlwaysNoUserResponse yesAlwaysNoUserResponseDefaultValue)
userInteractionCallbackPlugin - UserInteractionCallbackPlugin.prompt - See corresponding parameter in
UserInteractionCallbackPlugin.getInfo.yesAlwaysNoUserResponseDefaultValue - Default user response. It is
translated to the defaultValue parameter in
UserInteractionCallbackPlugin.getInfo.public static YesAlwaysNoUserResponse getInfoYesNoUserResponse(org.azyva.dragom.execcontext.plugin.UserInteractionCallbackPlugin userInteractionCallbackPlugin, String prompt, YesAlwaysNoUserResponse yesAlwaysNoUserResponseDefaultValue)
userInteractionCallbackPlugin - UserInteractionCallbackPlugin.prompt - See corresponding parameter in
UserInteractionCallbackPlugin.getInfo.yesAlwaysNoUserResponseDefaultValue - Default user response. It is
translated to the defaultValue parameter in
UserInteractionCallbackPlugin.getInfo.public static org.azyva.dragom.model.Version getInfoVersion(org.azyva.dragom.model.VersionType versionType,
org.azyva.dragom.model.plugin.ScmPlugin scmPlugin,
org.azyva.dragom.execcontext.plugin.UserInteractionCallbackPlugin userInteractionCallbackPlugin,
String prompt,
org.azyva.dragom.model.Version versionDefaultValue)
versionType - VersionType.scmPlugin - ScmPlugin.userInteractionCallbackPlugin - UserInteractionCallbackPlugin.prompt - See corresponding parameter in
UserInteractionCallbackPlugin.getInfo.versionDefaultValue - Default user response. It is translated to the
defaultValue parameter in UserInteractionCallbackPlugin.getInfo.public static org.azyva.dragom.model.plugin.NodePluginFactory getNodePluginFactory(String stringClassNodePlugin)
It is assumed the NodePlugin implementation class implements NodePluginFactory. The caller must have verified if the NodePlugin implementation class uses the constructor pattern and if so, not call this method.
This method factors out the algorithm that verifies if the class has a getInstance static method, if so calls it to obtain the NodePluginFactory and otherwise simply instantiates the class.
This s used by getDefaultClassNodePlugin(java.lang.String) and
getDefaultPluginId(java.lang.Class<? extends org.azyva.dragom.model.plugin.NodePlugin>, java.lang.String), as well as SimpleNode.getNodePlugin(java.lang.Class<NodePluginInterface>, java.lang.String).
stringClassNodePlugin - NodePlugin implementation class. Must implement
NodePluginFactory.public static Class<? extends org.azyva.dragom.model.plugin.NodePlugin> getDefaultClassNodePlugin(String pluginClass)
This method implements the strategy described in the description of
PluginDefConfig.
pluginClass - Name of the plugin implementation class.public static String getDefaultPluginId(Class<? extends org.azyva.dragom.model.plugin.NodePlugin> classNodePlugin, String pluginClass)
This method implements the strategy described in the description of
PluginDefConfig.
classNodePlugin - Class of the NodePlugin.pluginClass - Name of the plugin implementation class.public static boolean isWindows()
public static boolean handleDoYouWantToContinue(String context)
The context of the action having just been performed and for which we ask the
user if he wants to continue is taken into consideration. If the IND_NO_CONFIRM
runtime property is true, true is returned regardless of the context. Otherwise
the context-specific IND_NO_CONFIRM.<context> is used.
If the user responds to always continue, it is understood to be for the specified context.
If the user responds to not continue, false is returned and the IND_ABORT
runtime property is set to true. See isAbort().
context - Context.public static boolean handleDoYouWantToContinueWithIndividualNo(String context)
Its behavior is similar to that of handleDoYouWantToContinue(java.lang.String) except
that it handle the "no" response to mean "no for this iteration" (and simply
return false), and provides a separate "abort" response to mean "no and abort"
(and return false and set the IND_ABORT runtime property to true).
context - Context.public static boolean isAbort()
handleDoYouWantToContinue(java.lang.String) or setAbort().public static void setAbort()
public static boolean isDigits(String string)
string - String.public static String spaces(int length)
Internally manages a single StringBuilder from which substring of the requested lengths can be obtained.
A ReadWriteLock is used to protect the non-thread-safe StringBuilder. The code used is inpired from the sample shown in ReentrantReadWriteLock.
length - Number of spaces.public static boolean isPosix()
Copyright © 2015–2016 AZYVA INC.. All rights reserved.