Exception: JavaClass::ClassFile::ClassFormatError
- Defined in:
- lib/javaclass/classfile/class_format_error.rb
Overview
An error in the class file format. This indicates a broken class file or not supported feature.
- Author
-
Peter Kofler
Instance Attribute Summary collapse
-
#classname ⇒ Object
readonly
Returns the value of attribute classname.
-
#classpath ⇒ Object
readonly
Returns the value of attribute classpath.
Instance Method Summary collapse
-
#add_classname(classname, classpath = nil) ⇒ Object
Record the offending classname and optional classpath name.
-
#initialize(*args) ⇒ ClassFormatError
constructor
A new instance of ClassFormatError.
- #message ⇒ Object
Constructor Details
#initialize(*args) ⇒ ClassFormatError
Returns a new instance of ClassFormatError.
11 12 13 14 15 |
# File 'lib/javaclass/classfile/class_format_error.rb', line 11 def initialize(*args) super @classname = nil @classpath = nil end |
Instance Attribute Details
#classname ⇒ Object (readonly)
Returns the value of attribute classname.
8 9 10 |
# File 'lib/javaclass/classfile/class_format_error.rb', line 8 def classname @classname end |
#classpath ⇒ Object (readonly)
Returns the value of attribute classpath.
9 10 11 |
# File 'lib/javaclass/classfile/class_format_error.rb', line 9 def classpath @classpath end |
Instance Method Details
#add_classname(classname, classpath = nil) ⇒ Object
Record the offending classname and optional classpath name.
18 19 20 21 22 |
# File 'lib/javaclass/classfile/class_format_error.rb', line 18 def add_classname(classname, classpath=nil) raise ArgumentError, "classname already set to #{@classname}" if @classname @classname = classname @classpath = classpath end |
#message ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/javaclass/classfile/class_format_error.rb', line 24 def if @classname && @classpath super + "\nin class #{@classname} on classpath #{@classpath}" elsif @classname super + "\nin class #{@classname}" else super end end |