Package org.jvnet.hk2.generator.internal
Class Utilities
java.lang.Object
org.jvnet.hk2.generator.internal.Utilities
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
private static class
private static class
private class
private static class
private static class
private static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private static final String
private static final String
private final Map
<String, GenerateMethodAnnotationData> private static final String
private static final String
private static final String
private static final List
<Utilities.KnownClassData> private static final String
private static final String
private static final String
private static final String
private static final String
private final boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addSubInterface
(List<File> searchHeres, String dotDelimitedInterface, LinkedHashSet<String> retVal) void
close()
createDescriptorIfService
(InputStream is, List<File> searchHeres) findAllServicesFromDirectory
(File directory, List<File> parent) private InputStream
findClass
(List<File> searchHeres, String dotDelimitedName, boolean searchClassPath, String calledFrom) Will look for a file on a last-ditch sort of effort using the searchHere thing (jar or directory) and then also in the classpathgetAssociatedContracts
(List<File> searchHeres, String dotDelimitedName) Gets the contracts associated with the name passed inprivate void
getAssociatedSuperclassContracts
(List<File> searchHeres, String dotDelimitedName, Set<String> addToMe) getFilesFromSearchPath
(String searchPath) (package private) static String
getFirstParameterType
(String desc) (package private) static String
getListActualType
(String signature) getMetadataKey
(String scopeOrQualifier, String methodName) private String
getSuperclass
(List<File> searchHeres, String dotDelimitedName) Returns true if the given class is a contractprivate boolean
isClassAContract
(List<File> searchHeres, String dotDelimitedName) Returns true if the given class is a contractisClassAGenerator
(List<File> searchHeres, String dotDelimitedName) Returns true if it can be determined that this class is a generatorboolean
isClassAQualifier
(List<File> searchHeres, String dotDelimitedName) Returns true if it can be determined that this class is a qualifierboolean
isClassAScope
(List<File> searchHeres, String dotDelimitedName) Returns true if it can be determined that this class is a scopeprivate void
nullCaches
(String dotDelimitedName)
-
Field Details
-
DOT_CLASS
- See Also:
-
CONTRACT_WITH_SLASHES
-
SCOPE_WITH_SLASHES
-
QUALIFIER_WITH_SLASHES
-
METHOD_GENERATOR_WITH_SLASHES
- See Also:
-
GENERATOR_NAME_FIELD_WITH_SLASHES
- See Also:
-
METADATA_DESC
- See Also:
-
ISA_CONTRACT
-
ISA_SCOPE
-
ISA_QUALIFIER
-
FOUND_SUPERCLASS
-
FOUND_INTERFACES
-
FOUND_GENERATORS
-
METADATA
-
verbose
private final boolean verbose -
searchPath
-
openedJarFiles
-
CONFIGURED_CONTRACT
- See Also:
-
KNOWN_DATA
-
GENERATOR_IMPL_NAME
- See Also:
-
GENERATOR_SCOPE_NAME
- See Also:
-
LIST_WITH_PTYPE
- See Also:
-
-
Constructor Details
-
Utilities
-
Utilities
Utilities(boolean verbose, String searchPath)
-
-
Method Details
-
getFilesFromSearchPath
-
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 wellsearchHere
-- Returns:
- an IOStream if the file could be located
- Throws:
IOException
-
nullCaches
-
isClassAContract
Returns true if the given class is a contract- Parameters:
dotDelimitedName
- The fully qualified class name to look forsearchHere
- The file or jar to look in- Returns:
- true if this can determine that this is a contract
-
getSuperclass
Returns true if the given class is a contract- Parameters:
dotDelimitedName
- The fully qualified class name to look forsearchHere
- 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
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
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
-
getAssociatedContracts
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
-
getListActualType
-
getFirstParameterType
-
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()
-