|
org.netbeans.modules.j2ee.metadata/0 1.3 | |||||||||
PREV NEXT | FRAMES NO FRAMES |
See:
Description
Java EE Metadata | |
---|---|
org.netbeans.modules.j2ee.metadata | |
org.netbeans.modules.j2ee.metadata.model.api | |
org.netbeans.modules.j2ee.metadata.model.spi |
This module provides the GenericJavaEEMetadataModelAPI, which is a generic framework for models of Java EE metadata expressed as either XML deployment descriptors or Java annotations. The framework itself doesn't provide access to any specific metadata. Instead, it allows metadata providers to plug in SPI implementations returning whichever kind of metadata they want to provide.
MetadataModel.isReady()
and MetadataModel.runReadActionWhenReady()
Added methods to check if a model is ready (metadata in the model correspond exactly to their source) and to run a read action when a model becomes ready.
First initial release of the GenericJavaEEMetadataModelAPI.
A module wishing to access Java EE metadata obtains a metadata model, which is encapsulated by the MetadataModel class. The client then implements a model action, represented by the MetadataModelAction class, and executes this action in the model context by calling the model's runReadAction() method:
MetadataModel<SomeMetadata> model = // ... String result = model.runReadAction(new MetadataModelAction<SomeMetadata, String>() { public String run(SomeMetadata metadata) { // ... do something with metadata, e.g. // compute a String value return value; } }
The way to obtain the model itself, as well as the kinds of metadata encapsulated by MetadataModel
is
metadata and metadata provider-specific and is not addressed by this API.
A metadata provider first defines a root class describing the metadata, e.g., SomeMetadata
. Then the provider
implements the MetadataModelImplementation interface and
creates a MetadataModel
using MetadataModelFactory.
Then the provider defines a way to return the model to its clients:
private SomeMetadataModelImplementation modelImpl = new SomeMetadataModelImplementation(); private MetadataModel<SomeMetadata> model = MetadataModelFactory.createMetadataModel(modelImpl); /** * Call this to retrieve the model of some metadata. */ public MetadataModel<SomeMetadata> getSomeMetadataModel() { return model; } // ... private class SomeMetadataModelImplementation implements MetadataModelImplementation<SomeMetadata> { // ... }
A metadata provider might need to provide several kinds of metadata models at once. Furthermore, since there can be many models available or for backward compatibility reasons it might be impractical to provide a method for each of the models. In this case the provider may define a method like:
public MetadataModel<T> getMetadataModel(Class<T> clazz) { // ... }
The types of Class
which may be passed to the method is a part of the contract between
the provider and its clients.
|
The sources for the module are in the NetBeans CVS in the
j2ee/metadata
directory on the merged_model
branch.
The default answer to this question is:
The sources for the module are in NetBeans CVS in j2ee/metadata directory.
XXX no answer for deploy-dependencies
Read more about the implementation in the answers to architecture questions.
|
org.netbeans.modules.j2ee.metadata/0 1.3 | |||||||||
PREV NEXT | FRAMES NO FRAMES |