|
The ClassFile API is designed as a fast, low memory-cost way to access classfile information. It is useful for tools and modules that directly read classfiles, such as the clazz and javacore modules.
Question (arch-overall): Describe the overall architecture. Answer:
classfile
-
The ClassFile library is an API to read Java classfiles, as described by
The Java Virtual Machine Specification. Given a file or stream reference to a Java
classfile, the API provides read-only access to all of its class attributes, including
type information, methods and fields, generics support (if any), etc.
NOTE: this library is not really a NetBeans module, in that it doesn't have any NetBeans references.
It therefore has nothing pluggable, no NetBeans Lookups, and is not extensible.
The normal usecase is for a client wanting to inspect a classfile. A ClassFile
instance is created with either a String
path, File
or
InputStream
instance. All attributes of the classfile are available as properties,
such as getSourceFileName
or getMethods
.
N/A; already implemented.
Question (arch-quality): How will the quality of your code be tested and how are future regressions going to be prevented? Answer:The ClassFile API is heavily used by the clazz and javacore modules, so that any new bugs are normally reflected in those modules' test suites. There currently (as of the 4.0 freeze date) are no outstanding bugs.
Question (arch-where): Where one can find sources for your module? Answer:
The sources for the module are in the Apache Git repositories or in the GitHub repositories.
The classfile module has no dependencies on any NetBeans module or API.
The default answer to this question is:
These modules are required in project.xml:
The classfile module has no dependencies on any other project.
Question (dep-platform): On which platforms does your module run? Does it run in the same way on each? Answer:The classfile module is platform-independent.
Question (dep-jre): Which version of JRE do you need (1.2, 1.3, 1.4, etc.)? Answer:The classfile module now depends on the 1.4 JRE, since it uses assert statements. Although this library can read 1.5 classfiles, it does not use any API from that JRE.
Question (dep-jrejdk): Do you require the JDK or is the JRE enough? Answer:The JDK is not required; the JRE is enough.
Just the module jar is deployed.
Question (deploy-nbm): Can you deploy an NBM via the Update Center? Answer:Yes.
Question (deploy-shared): Do you need to be installed in the shared location only, or in the user directory only, or can your module be installed anywhere? Answer:Installation location does not matter.
Question (deploy-packages): Are packages of your module made inaccessible by not declaring them public? Answer:No.
Question (deploy-dependencies): What do other modules need to do to declare a dependency on this one, in addition to or instead of the normal module dependency declaration (e.g. tokens to require)? Answer:Nothing.
The Module names have been internationalized. The only hard-coded strings in the library are either Java language keywords, JVM attribute names, toString fragments, and exception descriptions. All of these are marked with "//NOI18N" comments.
Question (compat-standards): Does the module implement or define any standards? Is the implementation exact or does it deviate somehow? Answer:The module depends upon the The Java Virtual Machine Specification. It does not implement or define any standards, however.
Question (compat-version): Can your module coexist with earlier and future versions of itself? Can you correctly read all old settings? Will future versions be able to read your current settings? Can you read or politely ignore settings stored by a future version? Answer:N/A; the classfile module has no settings or other persistent data.
Question (compat-deprecation): How the introduction of your project influences functionality provided by previous version of the product? Answer:No impact on other API.
java.io.File
directly?
Answer:
Yes, because the classfile module has no NetBeans API dependencies.
Question (resources-layer): Does your module provide own layer? Does it create any files or folders in it? What it is trying to communicate by that and with which components? Answer:No.
Question (resources-read): Does your module read any resources from layers? For what purpose? Answer:No.
Question (resources-mask): Does your module mask/hide/override any resources provided by other modules in their layers? Answer:No.
Question (resources-preferences): Does your module uses preferences via Preferences API? Does your module use NbPreferences or or regular JDK Preferences ? Does it read, write or both ? Does it share preferences with other modules ? If so, then why ? Answer:No.
org.openide.util.Lookup
or any similar technology to find any components to communicate with? Which ones?
Answer:
The classfile module does not use Lookup.
Question (lookup-register): Do you register anything into lookup for other code to find? Answer:N/A
Question (lookup-remove): Do you remove entries of other modules from lookup? Answer:N/A
System.getProperty
) property?
On a similar note, is there something interesting that you
pass to java.util.logging.Logger
? Or do you observe
what others log?
Answer:
No.
Question (exec-component): Is execution of your code influenced by any (string) property of any of your components? Answer:No.
Question (exec-ant-tasks): Do you define or register any ant tasks that other can use? Answer:No.
Question (exec-classloader): Does your code create its own class loader(s)? Answer:No.
Question (exec-reflection): Does your code use Java Reflection to execute other code? Answer:No.
Question (exec-privateaccess): Are you aware of any other parts of the system calling some of your methods by reflection? Answer:No.
Question (exec-process): Do you execute an external process from your module? How do you ensure that the result is the same on different platforms? Do you parse output? Do you depend on result code? Answer:No.
Question (exec-introspection): Does your module use any kind of runtime type information (instanceof
,
work with java.lang.Class
, etc.)?
Answer:
No.
Question (exec-threading): What threading models, if any, does your module adhere to? How the project behaves with respect to threading? Answer:The ClassFile API creates invariant objects, which should be safe in any threading model.
Question (security-policy): Does your functionality require modifications to the standard policy file? Answer:No policy file modifications needed. All permissions granted.
Question (security-grant): Does your code grant additional rights to some other code? Answer:No.
It reads Java classfiles.
Question (format-dnd): Which protocols (if any) does your code understand during Drag & Drop? Answer:N/A; the classfile module has no user interface.
Question (format-clipboard): Which data flavors (if any) does your code read from or insert to the clipboard (by access to clipboard on means calling methods onjava.awt.datatransfer.Transferable
?
Answer:
N/A; the classfile module has no user interface.
No.
Question (perf-exit): Does your module run any code on exit? Answer:No.
Question (perf-scale): Which external criteria influence the performance of your program (size of file in editor, number of files in menu, in source directory, etc.) and how well your code scales? Answer:None, other than general filesystem and processor performance.
Question (perf-limit): Are there any hard-coded or practical limits in the number or size of elements your code can handle? Answer:No, other than the limits defined for classfiles in The Java Virtual Machine Specification.
Question (perf-mem): How much memory does your component consume? Estimate with a relation to the number of windows, etc. Answer:
It depends on the size and complexity of the classfile being represented. ClassFile
representations can be roughly 7-10 times the size of the associated classfile, but
much smaller (2-4x) if the includeCode
constructor parameter is false.
No.
Question (perf-progress): Does your module execute any long-running tasks? Answer:No.
Question (perf-huge_dialogs): Does your module contain any dialogs or wizards with a large number of GUI controls such as combo boxes, lists, trees, or text areas? Answer:No.
Question (perf-menus): Does your module use dynamically updated context menus, or context-sensitive actions with complicated and slow enablement logic? Answer:No.
Question (perf-spi): How the performance of the plugged in code will be enforced? Answer:N/A