<!-- <questionid="arch-overall"when="init"> Describetheoverallarchitecture. <hint> WhatwillbeAPIfor <ahref="http://openide.netbeans.org/tutorial/api-design.html#design.apiandspi"> clientsandwhatsupportAPI</a>? Whatpartswillbepluggable? Howwillplug-insberegistered?Pleaseuse<code><apitype="export"/></code> todescribeyourgeneralAPIsandspecifytheir <ahref="http://openide.netbeans.org/tutorial/api-design.html#category-private"> stabilitycategories</a>. Ifpossiblepleaseprovidesimplediagrams. </hint> </question>
-->
<answer id="arch-overall">
<p>
This module provides the <api group="java" name="GenericJavaEEMetadataModelAPI"type="export" category="devel"url="@TOP@index.html"/>,
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.
</p>
</answer>
<!-- <questionid="arch-quality"when="init"> Howwillthe<ahref="http://www.netbeans.org/community/guidelines/q-evangelism.html">quality</a> ofyourcodebetestedand howarefutureregressionsgoingtobeprevented? <hint> Whatkindoftestingdo youwanttouse?Howmuchfunctionality,inwhichareas, shouldbecoveredbythetests?Howyoufindoutthatyour projectwassuccessful? </hint> </question>
-->
<answer id="arch-quality">
<p>
All functionality mentioned in the Javadoc should be covered by unit tests.
</p>
</answer>
<!-- <questionid="arch-time"when="init"> Whatarethetimeestimatesofthework? <hint> Pleaseexpressyourestimatesofhowlongthedesign,implementation, stabilizationarelikelytolast.Howmanypeoplewillbeneededto implementthisandwhatistheexpectedmilestonebywhichtheworkshouldbe ready? </hint> </question>
-->
<answer id="arch-time">
<p>
The work should be ready for the 6.0 release.
</p>
</answer>
<!-- <questionid="arch-usecases"when="init"> <hint> Contentofthisanswerwillbedisplayedaspartofpageat http://www.netbeans.org/download/dev/javadoc/usecases.html Youcanusetags<usecasename="name>regularhtmldescription</usecase> andifyouwanttouseanURLyoucanprefixifwith@TOP@tobegin attherootofyourjavadoc </hint> Describethemain<ahref="http://openide.netbeans.org/tutorial/api-design.html#usecase"> usecases</a>ofthenewAPI.Whowilluseitunder whatcircumstances?Whatkindofcodewouldtypicallyneedtobewritten tousethemodule? </question>
-->
<answer id="arch-usecases">
<usecase id="metadata-access" name="Accessing metadata models">
<p>
A module wishing to access Java EE metadata obtains a metadata model, which is encapsulated
by the <a href="@TOP@org/netbeans/modules/j2ee/metadata/model/api/MetadataModel.html">MetadataModel</a>
class. The client then implements a model action, represented by the
<a href="@TOP@org/netbeans/modules/j2ee/metadata/model/api/MetadataModelAction.html">MetadataModelAction</a> class,
and executes this action in the model context by calling the model's
<a href="@TOP@org/netbeans/modules/j2ee/metadata/model/api/MetadataModel.html#runReadAction(org.netbeans.modules.j2ee.metadata.model.api.MetadataModelAction)">runReadAction()</a>
method:
</p>
<pre>
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;
}
}
</pre>
<p>
The way to obtain the model itself, as well as the kinds of metadata encapsulated by <code>MetadataModel</code> is metadata and metadata provider-specific and is not addressed by this API.
</p>
</usecase>
<usecase id="providing-metadata" name="Providing metadata models">
<p>
A metadata provider first defines a root class describing the metadata, e.g., <code>SomeMetadata</code>. Then the provider
implements the <a href="@TOP@org/netbeans/modules/j2ee/metadata/model/spi/MetadataModelImplementation.html">MetadataModelImplementation</a> interface and
creates a <code>MetadataModel</code> using <a href="@TOP@org/netbeans/modules/j2ee/metadata/model/spi/MetadataModelFactory.html">MetadataModelFactory</a>.
Then the provider defines a way to return the model to its clients:
</p>
<pre>
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> {
// ...
}
</pre>
</usecase>
<usecase id="providing-multiple-metadata" name="Providing multiple metadata models">
<p>
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:
</p>
<pre> public MetadataModel<T> getMetadataModel(Class<T> clazz) {
// ...
}
</pre>
<p>
The types of <code>Class</code> which may be passed to the method is a part of the contract between
the provider and its clients.
</p>
</usecase>
</answer>
<!-- <questionid="arch-what"when="init"> Whatisthisprojectgoodfor? <hint> Pleaseprovidehereafewlinesdescribingtheproject, whatproblemitshouldsolve,providelinkstodocumentation, specifications,etc. </hint> </question>
-->
<answer id="arch-what">
<p>
The project provides a generic framework for accessing Java EE metadata models.
</p>
</answer>
<!-- <questionid="arch-where"when="impl"> Whereonecanfindsourcesforyourmodule? <hint> PleaseprovidelinktotheCVSwebclientat http://www.netbeans.org/download/source_browse.html orjustusetagdefaultanswergenerate='here' </hint> </question>
-->
<answer id="arch-where">
<p>
The sources for the module are in the Apache NetBeans Git in the
<a href="https://github.com/apache/netbeans/tree/master/java/j2ee.metadata">java/j2ee.metadata</a>
directory.
</p>
</answer>
<!-- <questionid="compat-deprecation"when="init"> Howtheintroductionofyourprojectinfluencesfunctionality providedbypreviousversionoftheproduct? <hint> Ifyouareplanningtodeprecate/remove/changeanyexistingAPIs, listthemhereaccompaniedwiththereasonexplainingwhyyou aredoingso. </hint> </question>
-->
<answer id="compat-deprecation">
<p>
This API does not deprecate any existing public APIs.
</p>
</answer>
<!-- <questionid="deploy-packages"when="init"> Arepackagesofyourmodulemadeinaccessiblebynotdeclaringthem public? <hint> BydefaultNetBeansbuildharnesstreatsallpackagesareprivate. Ifyouexportsomeofthem-eitheraspublicorfriendpackages, youshouldhaveareason.Ifthereasonisdescribedelsewhere inthisdocument,youcanignorethisquestion. </hint> </question>
-->
<answer id="deploy-packages">
<p>
Only official API and SPI packages are exported.
</p>
</answer>
<!-- <questionid="exec-threading"when="init"> Whatthreadingmodels,ifany,doesyourmoduleadhereto?Howthe projectbehaveswithrespecttothreading? <hint> IsyourAPIthreadsafe?Canitbeaccessedfromanythreadsor justfromsomededicatedones?AnyspecialrelationtoAWTand itsEventDispatchthread?Also ifyourmodulecallsforeignAPIswhichhaveaspecificthreadingmodel, indicatehowyoucomplywiththerequirementsformultithreadedaccess (synchronization,mutexes,etc.)applicabletothoseAPIs. IfyourmoduledefinesanyAPIs,orhascomplexinternalstructures thatmightbeusedfrommultiplethreads,declarehowyouprotect dataagainstconcurrentaccess,raceconditions,deadlocks,etc., andwhethersuchrulesareenforcedbyruntimewarnings,errors,assertions,etc. Examples:aclassmightbenon-thread-safe(likeJavaCollections);might befullythread-safe(internallocking);mightrequireaccessthroughamutex (andmayormaynotautomaticallyacquirethatmutexonbehalfofaclientmethod); mightbeabletorunonlyintheeventqueue;etc. Alsodescribewhenanyeventsarefired:synchronously,asynchronously,etc. Ideas:<ahref="http://core.netbeans.org/proposals/threading/index.html#recommendations">ThreadingRecommendations</a>(inprogress) </hint> </question>
-->
<answer id="exec-threading">
<p>
The API defines the contracts to be supported by the implementations, but does not enforce
them in any way. The API is thread-safe if implementations support the contracts correctly.
</p>
</answer>
<!-- <questionid="perf-mem"when="final"> Howmuchmemorydoesyourcomponentconsume?Estimate witharelationtothenumberofwindows,etc. </question>
-->
<answer id="perf-mem">
<p>
The module only contains an API delegating to a SPI, so the memory consumption is very low.
</p>
</answer>
<!-- <questionid="perf-progress"when="final"> Doesyourmoduleexecuteanylong-runningtasks? <hint>Longrunningtasksshouldneverblock AWTthreadasitbadlyhurtstheUI <ahref="http://performance.netbeans.org/responsiveness/issues.html"> responsiveness</a>. Taskslikeconnectingover network,computinghugeamountofdata,compilation bedoneasynchronously(forexample using<code>RequestProcessor</code>),definitivelyitshould notblockAWTthread. </hint> </question>
-->
<answer id="perf-progress">
<p>
No, but implementations might. The API clients are encouraged
not to call long-running methods in the AWT thread.
</p>
</answer>
<!-- <questionid="perf-scale"when="init"> Whichexternalcriteriainfluencetheperformanceofyour program(sizeoffileineditor,numberoffilesinmenu, insourcedirectory,etc.)andhowwellyourcodescales? <hint> Pleaseincludesomeestimates,thereareothermoredetailed questionstoanswerinlaterphasesofimplementation. </hint> </question>
-->
<answer id="perf-scale">
<p>
The API performance is constant, but the performance of the implementations
might scale linearly in the number of files in a project.
</p>
</answer>
<!-- <questionid="perf-spi"when="init"> Howtheperformanceofthepluggedincodewillbeenforced? <hint> Ifyouallowforeigncodetobepluggedintoyourownmodule,how doyouenforcethatitwillbehavecorrectlyandquicklyandwillnot negativelyinfluencetheperformanceofyourownmodule? </hint> </question>
-->
<answer id="perf-spi">
<p>
Implementations are expected to operate quickly. Clients are advised that some
operations might run for a long time.
</p>
</answer>
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.