Class: JavaClass::ClassScanner::ImportedTypes
- Defined in:
- lib/javaclass/classscanner/imported_types.rb
Overview
Add analysis for imported types to ClassFile::JavaClassHeader.
- Author
-
Peter Kofler
Instance Method Summary collapse
-
#imported_3rd_party_types ⇒ Object
Determine the imported types of this class which are not from the JDK.
-
#imported_types ⇒ Object
Determine the imported types of this class and return their names.
-
#initialize(header) ⇒ ImportedTypes
constructor
Decorate JavaClassHeader header to add imported types lazy scanner.
Constructor Details
#initialize(header) ⇒ ImportedTypes
Decorate JavaClassHeader header to add imported types lazy scanner.
11 12 13 14 |
# File 'lib/javaclass/classscanner/imported_types.rb', line 11 def initialize(header) super(header) @imported_types = nil end |
Instance Method Details
#imported_3rd_party_types ⇒ Object
Determine the imported types of this class which are not from the JDK. This are all imported_types - all jdk types.
22 23 24 |
# File 'lib/javaclass/classscanner/imported_types.rb', line 22 def imported_3rd_party_types imported_types.reject { |name| name.in_jdk? } end |
#imported_types ⇒ Object
Determine the imported types of this class and return their names. This does not contain the name if this class itself.
17 18 19 |
# File 'lib/javaclass/classscanner/imported_types.rb', line 17 def imported_types @imported_types ||= references.used_classes.collect { |c| c.class_name.to_classname }.sort end |