A method provides an annotated language extension for the class of an object, the extension identifying an internal state that may be exposed via simple accessor methods. The extension could apply to an entire
object type, or to a specific state within the object. Annotations that can be added to the extension include @Accessable, @Gettable and @Settable. In one embodiment, a method selectively accesses one or more object states. The method includes generating an annotated extension identifying each
internal object state to be exposed for access, adding a usage
annotation to the extension that defines an accessor method associated with each identified state, and operating a
virtual machine to call the accessor method associated with a particular identified state. The particular state may then be accessed, as defined by the called accessor method.