Class: Java::JavaClass

Inherits:
Object
  • Object
show all
Defined in:
lib/javaobs.rb

Overview

The Java meta class with all the information needed for serialization of the Ruby class to the stream. This class is attached to the Ruby class.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, uid, flags) ⇒ JavaClass

Returns a new instance of JavaClass.



80
81
82
83
84
85
86
87
88
# File 'lib/javaobs.rb', line 80

def initialize(name, uid, flags)
  @name = @javaName = name
  ind = name.rindex('.')
  @name = name.slice(ind + 1..name.length) if ind
  @flags = flags
  @uid = uid
  @fields = []
  @arrayType = name[1] if name[0] == ?[
end

Instance Attribute Details

#arrayTypeObject (readonly)

Returns the value of attribute arrayType.



78
79
80
# File 'lib/javaobs.rb', line 78

def arrayType
  @arrayType
end

#fieldsObject (readonly)

Returns the value of attribute fields.



78
79
80
# File 'lib/javaobs.rb', line 78

def fields
  @fields
end

#flagsObject (readonly)

Returns the value of attribute flags.



78
79
80
# File 'lib/javaobs.rb', line 78

def flags
  @flags
end

#javaNameObject (readonly)

Returns the value of attribute javaName.



78
79
80
# File 'lib/javaobs.rb', line 78

def javaName
  @javaName
end

#nameObject (readonly)

Returns the value of attribute name.



78
79
80
# File 'lib/javaobs.rb', line 78

def name
  @name
end

#rubyClassObject

Returns the value of attribute rubyClass.



77
78
79
# File 'lib/javaobs.rb', line 77

def rubyClass
  @rubyClass
end

#superClassObject

Returns the value of attribute superClass.



77
78
79
# File 'lib/javaobs.rb', line 77

def superClass
  @superClass
end

#uidObject (readonly)

Returns the value of attribute uid.



78
79
80
# File 'lib/javaobs.rb', line 78

def uid
  @uid
end

Instance Method Details

#addField(field) ⇒ Object

Add a field to the class.



91
92
93
# File 'lib/javaobs.rb', line 91

def addField(field)
  @fields << field
end

#to_sObject



95
96
97
# File 'lib/javaobs.rb', line 95

def to_s
  @name
end