Module | JavaClass::PackageLogic |
In: |
lib/javaclass/java_name.rb
|
Is this package or class in the JDK? Return the first JDK package this is inside or nil.
# File lib/javaclass/java_name.rb, line 28 def in_jdk? if @package && @package != '' package_dot = @package + JavaLanguage::SEPARATOR JavaLanguage::JDK_PACKAGES_REGEX.find { |package| package_dot =~ package } else # default package is never in JDK false end end
Return true if this class is in same or in a subpackage of the given Java packages or if this package is same or a subpackage (with .).
# File lib/javaclass/java_name.rb, line 18 def same_or_subpackage_of?(packages) packages.find {|pkg| @package == pkg } != nil || subpackage_of?(packages) end