Class: Squash::Java::Class

Inherits:
Type
  • Object
show all
Defined in:
lib/squash/java/namespace.rb

Overview

Represents a Java class or inner class.

Instance Attribute Summary collapse

Attributes inherited from Type

#name

Instance Method Summary collapse

Methods inherited from Type

#inspect

Constructor Details

#initialize(parent, name) ⇒ Class

Returns a new instance of Class.



433
434
435
436
437
438
439
440
# File 'lib/squash/java/namespace.rb', line 433

def initialize(parent, name)
  @parent       = parent
  @java_methods = Set.new
  @classes      = Array.new
  @name         = name

  @parent.classes << self
end

Instance Attribute Details

#classesArray<Squash::Java::Class> (readonly)

Returns The inner classes of this class.

Returns:



425
426
427
# File 'lib/squash/java/namespace.rb', line 425

def classes
  @classes
end

#java_methodsArray<Squash::Java::Method> (readonly)

Returns The instance methods of this class.

Returns:



422
423
424
# File 'lib/squash/java/namespace.rb', line 422

def java_methods
  @java_methods
end

#obfuscationString?

Returns The obfuscated name of this class.

Returns:

  • (String, nil)

    The obfuscated name of this class.



419
420
421
# File 'lib/squash/java/namespace.rb', line 419

def obfuscation
  @obfuscation
end

#parentSquash::Java::Class, Squash::Java::Package (readonly)

Returns The parent package (or parent class for inner classes).

Returns:



416
417
418
# File 'lib/squash/java/namespace.rb', line 416

def parent
  @parent
end

#pathString

Returns The path to the .java file defining this class, relative to the project root.

Returns:

  • (String)

    The path to the .java file defining this class, relative to the project root.

See Also:



430
431
432
# File 'lib/squash/java/namespace.rb', line 430

def path
  @path
end

Instance Method Details

#full_nameString

Returns The name of this class (with package and parent class names).

Returns:

  • (String)

    The name of this class (with package and parent class names).



445
446
447
# File 'lib/squash/java/namespace.rb', line 445

def full_name
  "#{parent.full_name}.#{name}"
end

#subpathObject



450
# File 'lib/squash/java/namespace.rb', line 450

def subpath() parent.kind_of?(Squash::Java::Package) ? "#{parent.subpath}/#{name}.java" : parent.subpath end