public abstract class Completion extends Object
An example of the usage of this class is as follows:
Having a YANG model snippet like the following:
container application { leaf file-name { type string; tailf:cli-completion-actionpoint "file-complete" { tailf:cli-completion-id "path"; } } }The corresponding completion action is as follows:
@ActionCallback(callPoint = "file-complete", callType = ActionCBType.COMPLETION) public Completion completion(DpActionTrans actx, char cliStyle, String token, char completionChar, ConfObject[] kp, String cmdPath, String cmdParamId, ConfQname simpleType, String extra) throws DpCallbackException { .... // User processing of the completion .... CompletionReply reply = Completion.newReply(); reply.addCompletion("completion-entry1", null); ... reply.addCompletion("completion-entryN", null); reply.setCompletionInfo("my-info"); reply.setCompletionDesc("my-description"); return reply; }
Constructor and Description |
---|
Completion() |
Modifier and Type | Method and Description |
---|---|
static CompletionDefaultReply |
newDefaultReply()
The
CompletionDefaultReply instance is the possible response
for a tailf:cli-completion-actionpoint or a
tailf:cli-custom-range-actionpoint directive. |
static CompletionRangeEnumReply |
newRangeEnumReply(int keySize)
The
CompletionRangeEnumReply instance is the expected response
for a tailf:cli-custom-range-enumerator actionpoint. |
static CompletionReply |
newReply()
The
CompletionReply instance is the possible response for a
tailf:cli-completion-actionpoint or a
tailf:cli-custom-range-actionpoint directive. |
public static CompletionRangeEnumReply newRangeEnumReply(int keySize)
CompletionRangeEnumReply
instance is the expected response
for a tailf:cli-custom-range-enumerator actionpoint.
The instantiated reply needs to be assembled using its class
helper methods before it can be sent as a response.
Its use is in YANG model lists where a range completion is of interest.
The number of keys in the list needs to be supplied in this call.keySize
- number of keys in the listpublic static CompletionDefaultReply newDefaultReply()
CompletionDefaultReply
instance is the possible response
for a tailf:cli-completion-actionpoint or a
tailf:cli-custom-range-actionpoint directive.
Its use is to signal that the default completion mechanism should be
used instead of any assembling of this invocation.
As such, no further processing of this instance is needed, instead this
instance can be directly passed as a response to the invocation.public static CompletionReply newReply()
CompletionReply
instance is the possible response for a
tailf:cli-completion-actionpoint or a
tailf:cli-custom-range-actionpoint directive.
The instantiated reply needs to be assembled using its class
helper methods before it can be sent as a response.