commandbox.system.util.jline

Class CommandCompletor

lucee.Component
    extended by commandbox.system.util.jline.CommandCompletor

Copyright Since 2014 CommandBox by Ortus Solutions, Corp www.coldbox.org | www.ortussolutions.com I handle tab completion in the shell

Class Attributes:
  • singleton
  •  
  • synchronized : false
  •  
  • accessors : false
  •  
  • persistent : false
  •  
  • author : Brad Wood, Luis Majano, Denny Valliant
  •  
    Property Summary
    type property default serializable required
    any commandService


    • access = public
    • returntype = any
    • inject = CommandService
    true false
    any fileSystemUtil


    • access = public
    • returntype = any
    • inject = FileSystem
    true false
    any logger


    • access = public
    • returntype = any
    • inject = logbox:logger:{this}
    true false
    any shell


    • access = public
    • returntype = any
    • inject = Shell
    true false
    Constructor Summary
    init()
          Constructor.
    Method Summary
    private any add([any candidates], [any name], [any group=''], [any description=''], [boolean complete='false'])
         JLine3 needs an array of Java objects, so convert our array of strings to that.
    private any addAllIfMatch([any candidates], [array additions], [any paramSoFar], [any paramName], [any namedParams])
         Convience method since calling addAll() directly errors if each value isn't a string.
    private any addCandidateIfMatch(any match, any startsWith, any candidates, [any paramName], [any namedParams])
         add a value completion candidate if it matches what was typed so far.
    numeric complete([any reader], [any parsedLine], [any candidates])
         populate completion candidates and return cursor position.
    private any paramValueCompletion([struct commandInfo], [String paramName], [String paramType], [String paramSoFar], any candidates, [boolean namedParams], [struct passedNamedParameters='[runtime expression]'])
         populate completion candidates for parameter values.
    private any pathCompletion([String startsWith], any candidates, [any showFiles='true'], [any paramName], [any namedParams])
         Populate parameter value completion candidates.
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init()

    Constructor


    Property Detail

    commandService

    property any commandService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - CommandService
    serializable - true

    fileSystemUtil

    property any fileSystemUtil

    Attributes:
    access - public
    required - false
    returntype - any
    inject - FileSystem
    serializable - true

    logger

    property any logger

    Attributes:
    access - public
    required - false
    returntype - any
    inject - logbox:logger:{this}
    serializable - true

    shell

    property any shell

    Attributes:
    access - public
    required - false
    returntype - any
    inject - Shell
    serializable - true

    Method Detail

    add

    private any add([any candidates], [any name], [any group=''], [any description=''], [boolean complete='false'])

    JLine3 needs an array of Java objects, so convert our array of strings to that

    Parameters:
    candidates
    name
    group
    description
    complete

    addAllIfMatch

    private any addAllIfMatch([any candidates], [array additions], [any paramSoFar], [any paramName], [any namedParams])

    Convience method since calling addAll() directly errors if each value isn't a string

    Parameters:
    candidates - Java TreeSet object
    additions - array of values to add
    paramSoFar
    paramName
    namedParams

    addCandidateIfMatch

    private any addCandidateIfMatch(any match, any startsWith, any candidates, [any paramName], [any namedParams])

    add a value completion candidate if it matches what was typed so far

    Parameters:
    match - text to compare as match or struct containing "name", "group", "description"
    startsWith - text typed so far
    candidates - tree to populate with completion candidates
    paramName
    namedParams

    complete

    public numeric complete([any reader], [any parsedLine], [any candidates])

    populate completion candidates and return cursor position

    Parameters:
    reader
    parsedLine - a dynamic proxy wrapping an instance of `ArgumentList.cfc`
    candidates - tree to populate with completion candidates

    paramValueCompletion

    private any paramValueCompletion([struct commandInfo], [String paramName], [String paramType], [String paramSoFar], any candidates, [boolean namedParams], [struct passedNamedParameters='[runtime expression]'])

    populate completion candidates for parameter values

    Parameters:
    commandInfo - struct representing the command being completed for
    paramName - param name
    paramType - type of parameter (boolean, etc.)
    paramSoFar - text typed so far
    candidates - tree to populate with completion candidates
    namedParams
    passedNamedParameters

    pathCompletion

    private any pathCompletion([String startsWith], any candidates, [any showFiles='true'], [any paramName], [any namedParams])

    Populate parameter value completion candidates

    Parameters:
    startsWith - text typed so far
    candidates - tree to populate with completion candidates
    showFiles
    paramName
    namedParams