Class Utilities

java.lang.Object
org.jvnet.hk2.generator.internal.Utilities

public class Utilities extends Object
  • Field Details

  • Constructor Details

    • Utilities

      Utilities(boolean verbose, List<File> searchPath)
    • Utilities

      Utilities(boolean verbose, String searchPath)
  • Method Details

    • getFilesFromSearchPath

      private static List<File> getFilesFromSearchPath(String searchPath)
    • findClass

      private InputStream findClass(List<File> searchHeres, String dotDelimitedName, boolean searchClassPath, String calledFrom) throws IOException
      Will look for a file on a last-ditch sort of effort using the searchHere thing (jar or directory) and then also in the classpath
      Parameters:
      dotDelimitedName -
      searchClassPath - true if the classpath should be searched as well
      searchHere -
      Returns:
      an IOStream if the file could be located
      Throws:
      IOException
    • nullCaches

      private void nullCaches(String dotDelimitedName)
    • isClassAContract

      private boolean isClassAContract(List<File> searchHeres, String dotDelimitedName)
      Returns true if the given class is a contract
      Parameters:
      dotDelimitedName - The fully qualified class name to look for
      searchHere - The file or jar to look in
      Returns:
      true if this can determine that this is a contract
    • getSuperclass

      private String getSuperclass(List<File> searchHeres, String dotDelimitedName)
      Returns true if the given class is a contract
      Parameters:
      dotDelimitedName - The fully qualified class name to look for
      searchHere - The file or jar to look in
      Returns:
      The dot-delimited superclass name or null if this is terminal (is an interface or extends java.lang.Object)
    • isClassAScope

      public boolean isClassAScope(List<File> searchHeres, String dotDelimitedName)
      Returns true if it can be determined that this class is a scope
      Parameters:
      dotDelimitedName -
      searchHere -
      Returns:
      true if this class is a scope
    • isClassAQualifier

      public boolean isClassAQualifier(List<File> searchHeres, String dotDelimitedName)
      Returns true if it can be determined that this class is a qualifier
      Parameters:
      dotDelimitedName -
      searchHere -
      Returns:
      true if this class is a qualifier
    • isClassAGenerator

      public GenerateMethodAnnotationData isClassAGenerator(List<File> searchHeres, String dotDelimitedName)
      Returns true if it can be determined that this class is a generator
      Parameters:
      dotDelimitedName -
      searchHere -
      Returns:
      true if this class is a qualifier
    • getAssociatedSuperclassContracts

      private void getAssociatedSuperclassContracts(List<File> searchHeres, String dotDelimitedName, Set<String> addToMe)
    • getAssociatedContracts

      public Set<String> getAssociatedContracts(List<File> searchHeres, String dotDelimitedName)
      Gets the contracts associated with the name passed in
      Parameters:
      dotDelimitedName -
      searchHere -
      Returns:
      The set of contracts associated with this dotDelimited name (ordered iterator)
    • addSubInterface

      private void addSubInterface(List<File> searchHeres, String dotDelimitedInterface, LinkedHashSet<String> retVal)
    • getMetadataKey

      public String getMetadataKey(String scopeOrQualifier, String methodName)
    • getListActualType

      static String getListActualType(String signature)
    • getFirstParameterType

      static String getFirstParameterType(String desc)
    • createDescriptorIfService

      public List<DescriptorImpl> createDescriptorIfService(InputStream is, List<File> searchHeres) throws IOException
      Throws:
      IOException
    • findAllServicesFromDirectory

      public List<DescriptorImpl> findAllServicesFromDirectory(File directory, List<File> parent) throws IOException
      Throws:
      IOException
    • close

      public void close()