uTools-Manuals/docs/java/javax/annotation/processing/ProcessingEnvironment.html

231 lines
11 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="header">
<div class="subTitle">
compact3
</div>
<div class="subTitle">
javax.annotation.processing
</div>
<h2 class="title" title="Interface ProcessingEnvironment">Interface ProcessingEnvironment</h2>
</div><div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr/> <br/> <pre>public interface <span class="typeNameLabel">ProcessingEnvironment</span></pre>
<div class="block">
<span>注释处理工具框架将由<a href="../../../javax/annotation/processing/Processor.html#init-javax.annotation.processing.ProcessingEnvironment-">provide an annotation processor with an object implementing this interface</a>处理器使用,可以使用框架提供的工具来编写新文件,报告错误信息和查找其他工具。</span>
<p> <span>第三方可能希望提供周围设施对象的增值包装从这个接口,例如<code>Filer</code>扩展,允许多处理器协调写出一个源文件。</span> <span>为了实现这一点在上下文中运行的处理器其中通过API它们的副作用可能是彼此可见该工具基础设施必须提供相应的设施对象<code>.equals</code> <code>Filer</code> S中的<code>.equals</code> ,等等。</span> <span>另外,必须能够配置工具调用,使得从正在运行的批注处理器的角度来看,至少所选择的辅助类子集被视为由同一类加载器加载。</span> <span>(由于设备对象管理共享状态,包装类的实现必须知道相同的基础设施对象是否已被包装。)</span> </p>
</div>
<dl>
<dt>
<span class="simpleTagLabel">从以下版本开始:</span>
</dt>
<dd>
1.6
</dd>
</dl> </li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- --> </a> <h3>方法摘要</h3>
<table border="0" cellpadding="3" cellspacing="0" class="memberSummary" summary="Method Summary table, listing methods, and an explanation">
<caption>
<span class="activeTableTab" id="t0"><span>所有方法</span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t2"><span><a href="javascript:show(2);">接口方法</a></span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t3"><span><a href="javascript:show(4);">抽象方法</a></span><span class="tabEnd"> </span></span>
</caption>
<tbody>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor" id="i0">
<td class="colFirst"><code><a href="../../../javax/lang/model/util/Elements.html" title="interface in javax.lang.model.util">Elements</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/annotation/processing/ProcessingEnvironment.html#getElementUtils--">getElementUtils</a></span>()</code>
<div class="block">
返回一些用于操作元素的实用方法的实现
</div> </td>
</tr>
<tr class="rowColor" id="i1">
<td class="colFirst"><code><a href="../../../javax/annotation/processing/Filer.html" title="interface in javax.annotation.processing">Filer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/annotation/processing/ProcessingEnvironment.html#getFiler--">getFiler</a></span>()</code>
<div class="block">
返回用于创建新的源,类或辅助文件的文件管理器。
</div> </td>
</tr>
<tr class="altColor" id="i2">
<td class="colFirst"><code><a href="../../../java/util/Locale.html" title="class in java.util">Locale</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/annotation/processing/ProcessingEnvironment.html#getLocale--">getLocale</a></span>()</code>
<div class="block">
如果没有语言环境有效,则返回当前语言环境或
<code>null</code>
</div> </td>
</tr>
<tr class="rowColor" id="i3">
<td class="colFirst"><code><a href="../../../javax/annotation/processing/Messager.html" title="interface in javax.annotation.processing">Messager</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/annotation/processing/ProcessingEnvironment.html#getMessager--">getMessager</a></span>()</code>
<div class="block">
返回用于报告错误,警告和其他通知的信使。
</div> </td>
</tr>
<tr class="altColor" id="i4">
<td class="colFirst"><code><a href="../../../java/util/Map.html" title="interface in java.util">Map</a>&lt;<a href="../../../java/lang/String.html" title="class in java.lang">String</a>,<a href="../../../java/lang/String.html" title="class in java.lang">String</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/annotation/processing/ProcessingEnvironment.html#getOptions--">getOptions</a></span>()</code>
<div class="block">
返回传递给注解处理工具的处理器特定选项。
</div> </td>
</tr>
<tr class="rowColor" id="i5">
<td class="colFirst"><code><a href="../../../javax/lang/model/SourceVersion.html" title="enum in javax.lang.model">SourceVersion</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/annotation/processing/ProcessingEnvironment.html#getSourceVersion--">getSourceVersion</a></span>()</code>
<div class="block">
返回任何生成的
<a href="../../../javax/annotation/processing/Filer.html#createSourceFile-java.lang.CharSequence-javax.lang.model.element.Element...-">source</a>
<a href="../../../javax/annotation/processing/Filer.html#createClassFile-java.lang.CharSequence-javax.lang.model.element.Element...-">class</a>文件应符合的源版本。
</div> </td>
</tr>
<tr class="altColor" id="i6">
<td class="colFirst"><code><a href="../../../javax/lang/model/util/Types.html" title="interface in javax.lang.model.util">Types</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/annotation/processing/ProcessingEnvironment.html#getTypeUtils--">getTypeUtils</a></span>()</code>
<div class="block">
返回一些用于对类型进行操作的实用方法的实现。
</div> </td>
</tr>
</tbody>
</table> </li>
</ul> </li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- --> </a> <h3>方法详细信息</h3> <a name="getOptions--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getOptions</h4> <pre><a href="../../../java/util/Map.html" title="interface in java.util">Map</a>&lt;<a href="../../../java/lang/String.html" title="class in java.lang">String</a>,<a href="../../../java/lang/String.html" title="class in java.lang">String</a>&gt; getOptions()</pre>
<div class="block">
<span>返回传递给注解处理工具的处理器特定选项。</span>
<span>选项以选项名称的形式返回到选项值。</span>
<span>对于没有值的选项,地图中的相应值为<code>null</code></span>
<p> <span>有关如何传递处理器特定选项的详细信息,请参阅特定工具基础架构的文档。</span> <span>例如,命令行实现可以通过将处理器特定的选项前缀到已知的字符串(如<code>"-A"</code> ;</span> <span>其他工具实现可以遵循不同的约定或提供替代机制。</span> <span>给定的实现还可以提供实现特定的方法来查找传递给工具的选项以及处理器特定的选项。</span> </p>
</div>
<dl>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
处理器特定的选项传递给工具
</dd>
</dl> </li>
</ul> <a name="getMessager--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getMessager</h4> <pre><a href="../../../javax/annotation/processing/Messager.html" title="interface in javax.annotation.processing">Messager</a> getMessager()</pre>
<div class="block">
返回用于报告错误,警告和其他通知的信使。
</div>
<dl>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
消息员
</dd>
</dl> </li>
</ul> <a name="getFiler--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getFiler</h4> <pre><a href="../../../javax/annotation/processing/Filer.html" title="interface in javax.annotation.processing">Filer</a> getFiler()</pre>
<div class="block">
返回用于创建新的源,类或辅助文件的文件管理器。
</div>
<dl>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
文件管理员
</dd>
</dl> </li>
</ul> <a name="getElementUtils--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getElementUtils</h4> <pre><a href="../../../javax/lang/model/util/Elements.html" title="interface in javax.lang.model.util">Elements</a> getElementUtils()</pre>
<div class="block">
返回一些用于操作元素的实用方法的实现
</div>
<dl>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
元素实用程序
</dd>
</dl> </li>
</ul> <a name="getTypeUtils--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getTypeUtils</h4> <pre><a href="../../../javax/lang/model/util/Types.html" title="interface in javax.lang.model.util">Types</a> getTypeUtils()</pre>
<div class="block">
返回一些用于对类型进行操作的实用方法的实现。
</div>
<dl>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
键入实用程序
</dd>
</dl> </li>
</ul> <a name="getSourceVersion--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getSourceVersion</h4> <pre><a href="../../../javax/lang/model/SourceVersion.html" title="enum in javax.lang.model">SourceVersion</a> getSourceVersion()</pre>
<div class="block">
返回任何生成的
<a href="../../../javax/annotation/processing/Filer.html#createSourceFile-java.lang.CharSequence-javax.lang.model.element.Element...-">source</a>
<a href="../../../javax/annotation/processing/Filer.html#createClassFile-java.lang.CharSequence-javax.lang.model.element.Element...-">class</a>文件应符合的源版本。
</div>
<dl>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
生成的源和类文件应符合的源版本
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../../javax/annotation/processing/Processor.html#getSupportedSourceVersion--"><code>Processor.getSupportedSourceVersion()</code></a>
</dd>
</dl> </li>
</ul> <a name="getLocale--">
<!-- --> </a>
<ul class="blockListLast">
<li class="blockList"> <h4>getLocale</h4> <pre><a href="../../../java/util/Locale.html" title="class in java.util">Locale</a> getLocale()</pre>
<div class="block">
<span>如果没有语言环境有效,则返回当前语言环境或<code>null</code></span>
<span>该区域可用于提供本地化<a href="../../../javax/annotation/processing/Messager.html" title="javax.annotation.processing中的接口">messages</a></span>
</div>
<dl>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
当前的区域设置或
<code>null</code>如果没有区域设置生效
</dd>
</dl> </li>
</ul> </li>
</ul> </li>
</ul>
</div>
</div>