Class: Java::Class
- Inherits:
-
Annotatable
- Object
- Annotatable
- Java::Class
- Defined in:
- lib/java_dissassembler/class.rb
Constant Summary collapse
- ACC_PUBLIC =
Declared public; may be accessed from outside its package.
0x0001- ACC_FINAL =
Declared final; no subclasses allowed.
0x0010- ACC_SUPER =
Treat superclass methods specially when invoked by the invokespecial instruction.
0x0020- ACC_INTERFACE =
Is an interface, not a class.
0x0200- ACC_ABSTRACT =
Declared abstract; must not be instantiated.
0x0400- ACC_SYNTHETIC =
Declared synthetic; not present in the source code.
0x1000- ACC_ANNOTATION =
Declared as an annotation type.
0x2000- ACC_ENUM =
Declared as an enum type.
0x4000
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#flags ⇒ Object
readonly
Returns the value of attribute flags.
-
#interfaces ⇒ Object
readonly
Returns the value of attribute interfaces.
-
#methods ⇒ Object
readonly
Returns the value of attribute methods.
-
#super_klass ⇒ Object
readonly
Returns the value of attribute super_klass.
-
#this_klass ⇒ Object
readonly
Returns the value of attribute this_klass.
Attributes inherited from Annotatable
Instance Method Summary collapse
-
#initialize(major, minor, flags, this_klass, super_klass, interfaces, fields, methods, annotations) ⇒ Class
constructor
A new instance of Class.
- #is_abstract? ⇒ Boolean
- #is_annotation? ⇒ Boolean
- #is_enum? ⇒ Boolean
- #is_final? ⇒ Boolean
- #is_interface? ⇒ Boolean
- #is_public? ⇒ Boolean
- #is_super? ⇒ Boolean
- #is_synthetic? ⇒ Boolean
- #java_version ⇒ Object
Methods inherited from Annotatable
#get_annotation, #has_annotation?
Constructor Details
#initialize(major, minor, flags, this_klass, super_klass, interfaces, fields, methods, annotations) ⇒ Class
Returns a new instance of Class.
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/java_dissassembler/class.rb', line 14 def initialize(major, minor, flags, this_klass, super_klass, interfaces, fields, methods, annotations) super(annotations) @major = major @minor = minor @flags = flags @this_klass = this_klass @super_klass = super_klass @interfaces = interfaces @fields = fields @methods = methods end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
3 4 5 |
# File 'lib/java_dissassembler/class.rb', line 3 def fields @fields end |
#flags ⇒ Object (readonly)
Returns the value of attribute flags.
3 4 5 |
# File 'lib/java_dissassembler/class.rb', line 3 def flags @flags end |
#interfaces ⇒ Object (readonly)
Returns the value of attribute interfaces.
3 4 5 |
# File 'lib/java_dissassembler/class.rb', line 3 def interfaces @interfaces end |
#methods ⇒ Object (readonly)
Returns the value of attribute methods.
3 4 5 |
# File 'lib/java_dissassembler/class.rb', line 3 def methods @methods end |
#super_klass ⇒ Object (readonly)
Returns the value of attribute super_klass.
3 4 5 |
# File 'lib/java_dissassembler/class.rb', line 3 def super_klass @super_klass end |
#this_klass ⇒ Object (readonly)
Returns the value of attribute this_klass.
3 4 5 |
# File 'lib/java_dissassembler/class.rb', line 3 def this_klass @this_klass end |
Instance Method Details
#is_abstract? ⇒ Boolean
42 43 44 |
# File 'lib/java_dissassembler/class.rb', line 42 def is_abstract? (@flags & ACC_ABSTRACT) != 0 end |
#is_annotation? ⇒ Boolean
50 51 52 |
# File 'lib/java_dissassembler/class.rb', line 50 def is_annotation? (@flags & ACC_ANNOTATION) != 0 end |
#is_enum? ⇒ Boolean
54 55 56 |
# File 'lib/java_dissassembler/class.rb', line 54 def is_enum? (@flags & ACC_ENUM) != 0 end |
#is_final? ⇒ Boolean
30 31 32 |
# File 'lib/java_dissassembler/class.rb', line 30 def is_final? (@flags & ACC_FINAL) != 0 end |
#is_interface? ⇒ Boolean
38 39 40 |
# File 'lib/java_dissassembler/class.rb', line 38 def is_interface? (@flags & ACC_INTERFACE) != 0 end |
#is_public? ⇒ Boolean
26 27 28 |
# File 'lib/java_dissassembler/class.rb', line 26 def is_public? (@flags & ACC_PUBLIC) != 0 end |
#is_super? ⇒ Boolean
34 35 36 |
# File 'lib/java_dissassembler/class.rb', line 34 def is_super? (@flags & ACC_SUPER) != 0 end |
#is_synthetic? ⇒ Boolean
46 47 48 |
# File 'lib/java_dissassembler/class.rb', line 46 def is_synthetic? (@flags & ACC_SYNTHETIC) != 0 end |
#java_version ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/java_dissassembler/class.rb', line 58 def java_version case @major when 46 then "1.2" when 47 then "1.3" when 48 then "1.4" when 49 then "5" when 50 then "6" when 51 then "7" when 52 then "8" when 53 then "9" end end |