Class: Java::Field

Inherits:
Annotatable show all
Defined in:
lib/java_dissassembler/field.rb

Constant Summary collapse

ACC_PUBLIC =

Declared public; may be accessed from outside its package.

0x0001
ACC_PRIVATE =

Declared private; usable only within the defining class.

0x0002
ACC_PROTECTED =

Declared protected; may be accessed within subclasses.

0x0004
ACC_STATIC =

Declared static.

0x0008
ACC_FINAL =

Declared final; never directly assigned to after object construction (JLS §17.5).

0x0010
ACC_VOLATILE =

Declared volatile; cannot be cached.

0x0040
ACC_TRANSIENT =

Declared transient; not written or read by a persistent object manager.

0x0080
ACC_SYNTHETIC =

Declared synthetic; not present in the source code.

0x1000
ACC_ENUM =

Declared as an element of an enum.

0x4000

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Annotatable

#get_annotation, #has_annotation?

Constructor Details

#initialize(flags, name, vm_type, annotations) ⇒ Field

Returns a new instance of Field.



15
16
17
18
19
20
# File 'lib/java_dissassembler/field.rb', line 15

def initialize(flags, name, vm_type, annotations)
  super(annotations)
  @flags = flags
  @name = name
  @vm_type = vm_type
end

Instance Attribute Details

#annotationsObject (readonly)

Returns the value of attribute annotations.



3
4
5
# File 'lib/java_dissassembler/field.rb', line 3

def annotations
  @annotations
end

#flagsObject (readonly)

Returns the value of attribute flags.



3
4
5
# File 'lib/java_dissassembler/field.rb', line 3

def flags
  @flags
end

#java_typeObject (readonly)

Returns the value of attribute java_type.



3
4
5
# File 'lib/java_dissassembler/field.rb', line 3

def java_type
  @java_type
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/java_dissassembler/field.rb', line 3

def name
  @name
end

#vm_typeObject (readonly)

Returns the value of attribute vm_type.



3
4
5
# File 'lib/java_dissassembler/field.rb', line 3

def vm_type
  @vm_type
end

Instance Method Details

#is_enum?Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/java_dissassembler/field.rb', line 54

def is_enum?
  (@flags & ACC_ENUM) != 0
end

#is_final?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/java_dissassembler/field.rb', line 38

def is_final?
  (@flags & ACC_FINAL) != 0
end

#is_private?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/java_dissassembler/field.rb', line 26

def is_private?
  (@flags & ACC_PRIVATE) != 0
end

#is_protected?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/java_dissassembler/field.rb', line 30

def is_protected?
  (@flags & ACC_PROTECTED) != 0
end

#is_public?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/java_dissassembler/field.rb', line 22

def is_public?
  (@flags & ACC_PUBLIC) != 0
end

#is_static?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/java_dissassembler/field.rb', line 34

def is_static?
  (@flags & ACC_STATIC) != 0
end

#is_synthetic?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/java_dissassembler/field.rb', line 50

def is_synthetic?
  (@flags & ACC_SYNTHETIC) != 0
end

#is_transient?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/java_dissassembler/field.rb', line 46

def is_transient?
  (@flags & ACC_TRANSIENT) != 0
end

#is_volatile?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/java_dissassembler/field.rb', line 42

def is_volatile?
  (@flags & ACC_VOLATILE) != 0
end