<!-- <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> todescribeyourgeneralAPIs. Ifpossiblepleaseprovide simplediagrams. </hint> </question>
-->
<answer id="arch-overall">
<api group="java" name="GeneralQueriesAPI"type="export" category="official">
The General Queries API provides generic <q>queries</q>, or sources of
concrete information, useful throughout the build system and perhaps
elsewhere. Each query is split into an API component intended for clients to
find the answer to a particular question without knowledge of the underlying
structure or origin of the answer; and an SPI interface (using lookup)
permitting answers to be provided from any source. These queries currently
pertain to VCS and compilation status and user visibility of files.
</api>
</answer>
<!-- <questionid="arch-quality"when="init"> Howthe<ahref="http://www.netbeans.org/community/guidelines/q-evangelism.html">quality</a> ofyourcodewillbetestedand howfutureregressionsaregoingtobeprevented? <hint> Whatkindoftesting youwanttouse?What/howmuchareaoffunctionality shouldbecoveredbythetests? </hint> </question>
-->
<answer id="arch-quality">
<p>
All functionality specified in Javadoc should be covered by unit tests. Since
query implementations are found in lookup, it is straightforward to register
test implementations and confirm that the API produces the correct answer.
</p>
</answer>
<!-- <questionid="arch-usecases"when="init"> Describethemain<ahref="http://openide.netbeans.org/tutorial/api-design.html#usecase"> usecases</a>ofthenewAPI.Whowilluseitat whatcircumstancesandwhatwillbethetypicalcodetowrite tousethemodule. </question>
-->
<answer id="arch-usecases">
<p>
Particular use cases are enumerated in the Javadoc for each query API. Usage
consists of simple static method calls. Potentially a wide variety of modules
could use these queries; implementations are typically registered by project type providers, though also by Java library and platform implementations.
</p>
</answer>
<!-- <questionid="arch-what"when="init"> Whatisthisprojectgoodfor? <hint> Pleaseprovidehereafewlinesdescribingtheproject, whatproblemitshouldsolve,providelinkstodocumentation, specifications,etc. </hint> </question>
-->
<answer id="arch-what">
<p>
General kinds of queries between modules.
Queries are one way of solving the
intermodule communication problem when it is necessary for some modules to
obtain basic information about the system (e.g. whether a particular file is
intended for version control) without needing direct dependencies on the
module providing the answer (e.g. the project type which controls the file).
Details are covered in the Javadoc.
</p>
</answer>
<!-- <questionid="compat-i18n"when="impl"> Isyourmodulecorrectlyinternationalized? <hint> Correctinternationalizationmeansthatitobeysinstructions at<ahref="http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/i18n-branding.html"> NetBeansI18Npages</a>. </hint> </question>
-->
<answer id="compat-i18n">
<p>
There are no I18N issues in this module.
</p>
</answer>
<!-- <questionid="compat-standards"when="init"> Doesthemoduleimplementordefineanystandards?Isthe implementationexactordoesitdeviatesomehow? </question>
-->
<answer id="compat-standards">
<p>
There are no known relevant standards.
</p>
</answer>
<!-- <questionid="compat-version"when="impl"> Canyourmodulecoexistwithearlierandfuture versionsofitself?Canyoucorrectlyreadalloldsettings?Willfuture versionsbeabletoreadyourcurrentsettings?Canyouread orpolitelyignoresettingsstoredbyafutureversion? <hint> Veryhelpfulforreadingsettingsistostoreversionnumber there,sofutureversionscandecidewhetherhowtoread/convert thesettingsandolderversionscanignorethenewones. </hint> </question>
-->
<answer id="compat-version">
<p>
The module uses NbPreferences to store the default project encoding. When there is no
default project encoding stored it falls back to UTF-8.
</p>
</answer>
<!-- <questionid="exec-threading"when="impl"> Whatthreadingmodels,ifany,doesyourmoduleadhereto? <hint> 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>
Most general queries should be treated similarly to API and SPI calls in the
Filesystems API. <code>FileBuiltQuery</code> is intended to be thread-safe for
callers.
</p>
</answer>
<!-- <questionid="lookup-lookup"when="init"> Doesyourmoduleuse<code>org.openide.util.Lookup</code> oranysimilartechnologytofindanycomponentstocommunicatewith?Whichones? <hint> Pleasedescribetheinterfacesyouaresearchingfor,where aredefined,whetheryouaresearchingforjustoneormoreofthem, iftheorderisimportant,etc.Alsoclassifythestabilityofsuch APIcontract. </hint> </question>
-->
<answer id="lookup-lookup">
<p>
Yes, query implementations are found via global lookup. Order is significant
in case two queries supply different answers; generally the first one wins.
</p>
</answer>
<!-- <questionid="perf-limit"when="init"> Arethereanyhard-codedorpracticallimitsinthenumberorsizeof elementsyourcodecanhandle? </question>
-->
<answer id="perf-limit">
<p>
Performance of queries scales linearly in number of query implementations, but
typical implementations are singletons which delegate to other implementations
in constant time.
</p>
</answer>
<!-- <questionid="perf-mem"when="final"> Howmuchmemorydoesyourcomponentconsume?Estimate witharelationtothenumberofwindows,etc. </question>
-->
<answer id="perf-mem">
<p>
Trivial, except in case of <code>FileBuiltQuery.Status</code> which is
proportional to number of files.
</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>
Number of query implementations (typically only a few) and their own
performance.
</p>
</answer>
<!-- <questionid="perf-spi"when="init"> Howtheperformanceofthepluggedincodewillbeenforced? <hint> Ifyouallowforeigncodetobepluggedintoyourownmodule,how doyouenforce,thatitwillbehavecorrectlyandfastandwillnot negativelyinfluencetheperformanceofyourownmodule? </hint> </question>
-->
<answer id="perf-spi">
<p>
Query implementations are intended to be fast.
</p>
</answer>
<!-- <questionid="resources-file"when="final"> Doesyourmoduleuse<code>java.io.File</code>directly? <hint> NetBeansprovidealogicalwrapperoverplainfilescalled <code>org.openide.filesystems.FileObject</code>that providesuniformaccesstosuchresourcesandisthepreferred waythatshouldbeused.Butofcoursetherecanbesituationswhen thisisnotsuitable. </hint> </question>
-->
<answer id="resources-file">
<p>
<code>CollocationQuery</code> and <code>SharabilityQuery</code> use
<code>File</code> directly as they only make sense for disk files and need to
work with paths of nonexistent files.
</p>
</answer>
<!-- <questionid="resources-preferences"when="final"> DoesyourmoduleusespreferencesviaPreferencesAPI?DoesyourmoduleuseNbPreferencesor orregularJDKPreferences?Doesitread,writeorboth? Doesitsharepreferenceswithothermodules?Ifso,thenwhy? <hint> Youmayuse <apitype="export"group="preferences" name="preferencenodename"category="private"> descriptionofindividualkeys,whereitisused,whatit influences,whetherthemodulereads/writeit,etc. </api> DuetoXMLIDrestrictions,ratherthan/org/netbeans/modules/foogivethe"name"asorg.netbeans.modules.foo. NotethatifyouuseNbPreferencesthisnamewillthenbethesameasthecodenamebaseofthemodule. </hint> </question>
-->
<answer id="resources-preferences">
<p>
The module internally uses <code>NbPreferences</code> to store the default value of encoding of a new project.
Clients should not access this preferences directly using preferences API but they should use
the <code>FileEncodingQuery</code> methods.
</p>
<api group="preferences" name="org.netbeans.api.queries"type="export" category="private" >
<table>
<caption>preferences</caption>
<tbody>
<tr>
<th>key</th>
<th>description</th>
<th>read</th>
<th>write</th>
</tr>
<tr>
<td>default-encoding</td>
<td>Default encoding which should be used for new project</td>
<td>x</td>
<td>x</td>
</tr>
</tbody>
</table>
</api>
</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.