Class: JavaClass::InnerClassAccessFlag
- Inherits:
-
AccessFlag
- Object
- AccessFlag
- JavaClass::InnerClassAccessFlag
- Defined in:
- lib/javaclass/accessflag.rb
Overview
インナークラスのアクセスフラグ
Constant Summary collapse
- ACC_PUBLIC =
Marked or implicitly public in source.
0x0001- ACC_PRIVATE =
Marked private in source.
0x0002- ACC_PROTECTED =
Marked protected in source.
0x0004- ACC_STATIC =
Marked or implicitly static in source.
0x0008- ACC_FINAL =
Marked final in source.
0x0010- ACC_INTERFACE =
Was an interface in source.
0x0200- ACC_ABSTRACT =
Marked or implicitly abstract in source.
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 Method Summary collapse
-
#accessor ⇒ Object
アクセサを文字列で取得する。.
-
#source_modifiers ⇒ Object
ソースコードに登場するモディファイアを配列で取得する。.
- #to_s ⇒ Object
-
#type ⇒ Object
クラスの種別(class or interface or enum ..) を文字列で取得する。.
Methods inherited from AccessFlag
#initialize, #off, #on, #on?, #to_bytes
Methods included from Base
#==, #===, #dump, #eql?, #hash, #to_byte
Constructor Details
This class inherits a constructor from JavaClass::AccessFlag
Instance Method Details
#accessor ⇒ Object
アクセサを文字列で取得する。
戻り値::アクセサを示す文字列
254 255 256 257 258 259 |
# File 'lib/javaclass/accessflag.rb', line 254 def accessor return "public" if on? ACC_PUBLIC return "protected" if on? ACC_PROTECTED return "private" if on? ACC_PRIVATE return "" end |
#source_modifiers ⇒ Object
ソースコードに登場するモディファイアを配列で取得する。
戻り値::ソースコードに登場するモディファイアの配列
241 242 243 244 245 246 247 |
# File 'lib/javaclass/accessflag.rb', line 241 def source_modifiers modifiers = [] modifiers << "static" if on? ACC_STATIC modifiers << "final" if on? ACC_FINAL modifiers << "abstract" if on? ACC_ABSTRACT return modifiers end |
#to_s ⇒ Object
273 274 275 276 |
# File 'lib/javaclass/accessflag.rb', line 273 def to_s list = accessor.length > 0 ? [accessor] : [] (list + source_modifiers << type).join(" ") end |
#type ⇒ Object
クラスの種別(class or interface or enum ..) を文字列で取得する。
戻り値::クラスの種別
266 267 268 269 270 271 |
# File 'lib/javaclass/accessflag.rb', line 266 def type return "@interface" if on?(ACC_INTERFACE) && on?(ACC_ANNOTATION) return "interface" if on? ACC_INTERFACE return "enum" if on? ACC_ENUM return "class" end |