Class SourceParamChoicesProvider

java.lang.Object
org.fife.rsta.ac.java.SourceParamChoicesProvider
All Implemented Interfaces:
org.fife.ui.autocomplete.ParameterChoicesProvider

class SourceParamChoicesProvider extends Object implements org.fife.ui.autocomplete.ParameterChoicesProvider
A parameter choices provider for Java methods.

NOTE: This class is not thread-safe, but it's assumed that it is only ever called on the EDT, so it should be a non-issue.

Version:
1.0
  • Field Details

  • Constructor Details

    • SourceParamChoicesProvider

      SourceParamChoicesProvider()
  • Method Details

    • addPublicAndProtectedFieldsAndGetters

      private void addPublicAndProtectedFieldsAndGetters(Type type, JarManager jm, Package pkg, List<org.fife.ui.autocomplete.Completion> list)
      Adds all accessible fields and getters of a specific type, from an extended class or implemented interface.
      Parameters:
      type - The type being examined.
      jm - The jar manager.
      pkg - The parent package.
      list - The list of completions to add to.
    • getLocalVarsFieldsAndGetters

      public List<org.fife.ui.autocomplete.Completion> getLocalVarsFieldsAndGetters(NormalClassDeclaration ncd, String type, int offs)
      Gets all local variables, fields, and simple getters defined in a class, that are of a specific type, and are accessible from a given offset.
      Parameters:
      ncd - The class.
      type - The type that the variables, fields, and (return value of) getters must be.
      offs - The offset of the caret.
      Returns:
      The list of stuff, or an empty list if none are found.
    • getParameterChoices

      public List<org.fife.ui.autocomplete.Completion> getParameterChoices(JTextComponent tc, org.fife.ui.autocomplete.ParameterizedCompletion.Parameter param)
      Specified by:
      getParameterChoices in interface org.fife.ui.autocomplete.ParameterChoicesProvider
    • isPrimitiveNumericType

      private boolean isPrimitiveNumericType(Type type)
    • isSimpleGetter

      private boolean isSimpleGetter(Method method)
      Returns whether a method is a no-argument getter method.
      Parameters:
      method - The method.
      Returns:
      Whether it is a no-argument getter.
    • isTypeCompatible

      private boolean isTypeCompatible(Type type, String typeName)
      Returns whether a Type and a type name are type compatible. This method currently is a sham!
      Parameters:
      type - The type to check.
      typeName - The name of a type to check.
      Returns:
      Whether the two are compatible.