| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc --> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>Context.Builder (Apache Juneau 9.0.0)</title> |
| <link rel="stylesheet" type="text/css" href="../../../javadoc.css" title="Style"> |
| <script type="text/javascript" src="../../../script.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="Context.Builder (Apache Juneau 9.0.0)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":6,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],8:["t4","Concrete Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../index-all.html">Index</a></li> |
| <li><a href="../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../org/apache/juneau/Context.html" title="class in org.apache.juneau"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../org/apache/juneau/ContextRuntimeException.html" title="class in org.apache.juneau"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../index.html?org/apache/juneau/Context.Builder.html" target="_top">Frames</a></li> |
| <li><a href="Context.Builder.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">org.apache.juneau</div> |
| <h2 title="Class Context.Builder" class="title">Class Context.Builder</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.apache.juneau.Context.Builder</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>Direct Known Subclasses:</dt> |
| <dd><a href="../../../org/apache/juneau/BeanContext.Builder.html" title="class in org.apache.juneau">BeanContext.Builder</a>, <a href="../../../org/apache/juneau/BeanContextable.Builder.html" title="class in org.apache.juneau">BeanContextable.Builder</a>, <a href="../../../org/apache/juneau/config/Config.Builder.html" title="class in org.apache.juneau.config">Config.Builder</a>, <a href="../../../org/apache/juneau/config/store/ConfigStore.Builder.html" title="class in org.apache.juneau.config.store">ConfigStore.Builder</a>, <a href="../../../org/apache/juneau/rest/RestContext.Builder.html" title="class in org.apache.juneau.rest">RestContext.Builder</a>, <a href="../../../org/apache/juneau/rest/RestOpContext.Builder.html" title="class in org.apache.juneau.rest">RestOpContext.Builder</a></dd> |
| </dl> |
| <dl> |
| <dt>Enclosing class:</dt> |
| <dd><a href="../../../org/apache/juneau/Context.html" title="class in org.apache.juneau">Context</a></dd> |
| </dl> |
| <hr> |
| <br> |
| <pre>public abstract static class <a href="../../../src-html/org/apache/juneau/Context.html#line.134">Context.Builder</a> |
| extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre> |
| <div class="block">Builder class.</div> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier</th> |
| <th class="colLast" scope="col">Constructor and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected </code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/juneau/Context.Builder.html#Builder--">Builder</a></span>()</code> |
| <div class="block">Constructor.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected </code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/juneau/Context.Builder.html#Builder-org.apache.juneau.Context.Builder-">Builder</a></span>(<a href="../../../org/apache/juneau/Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a> copyFrom)</code> |
| <div class="block">Copy constructor.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected </code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/juneau/Context.Builder.html#Builder-org.apache.juneau.Context-">Builder</a></span>(<a href="../../../org/apache/juneau/Context.html" title="class in org.apache.juneau">Context</a> copyFrom)</code> |
| <div class="block">Copy constructor.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Method and Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code><a href="../../../org/apache/juneau/Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/juneau/Context.Builder.html#annotations-java.lang.annotation.Annotation...-">annotations</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation">Annotation</a>... values)</code> |
| <div class="block">Defines annotations to apply to specific classes and methods.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code><a href="../../../org/apache/juneau/Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/juneau/Context.Builder.html#apply-org.apache.juneau.AnnotationWorkList-">apply</a></span>(<a href="../../../org/apache/juneau/AnnotationWorkList.html" title="class in org.apache.juneau">AnnotationWorkList</a> work)</code> |
| <div class="block">Applies a set of applied to this builder.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code><T extends <a href="../../../org/apache/juneau/Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a>><br><a href="../../../org/apache/juneau/Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/juneau/Context.Builder.html#apply-java.lang.Class-java.util.function.Consumer-">apply</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><T> subtype, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/Consumer.html?is-external=true" title="class or interface in java.util.function">Consumer</a><T> consumer)</code> |
| <div class="block">Apply a consumer to this builder.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code><a href="../../../org/apache/juneau/Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/juneau/Context.Builder.html#applyAnnotations-java.lang.Class...-">applyAnnotations</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?>... fromClasses)</code> |
| <div class="block">Applies any of the various <ja>@XConfig</ja> annotations on the specified class to this context.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code><a href="../../../org/apache/juneau/Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/juneau/Context.Builder.html#applyAnnotations-java.lang.reflect.Method...-">applyAnnotations</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a>... fromMethods)</code> |
| <div class="block">Applies any of the various <ja>@XConfig</ja> annotations on the specified method to this context.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code><a href="../../../org/apache/juneau/Context.html" title="class in org.apache.juneau">Context</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/juneau/Context.Builder.html#build--">build</a></span>()</code> |
| <div class="block">Build the object.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code><T extends <a href="../../../org/apache/juneau/Context.html" title="class in org.apache.juneau">Context</a>><br>T</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/juneau/Context.Builder.html#build-java.lang.Class-">build</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><T> c)</code> |
| <div class="block">Convenience method for calling <a href="../../../org/apache/juneau/Context.Builder.html#build--"><code>build()</code></a> while avoiding a cast.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code><a href="../../../org/apache/juneau/Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/juneau/Context.Builder.html#cache-org.apache.juneau.internal.Cache-">cache</a></span>(<a href="../../../org/apache/juneau/internal/Cache.html" title="class in org.apache.juneau.internal">Cache</a><<a href="../../../org/apache/juneau/utils/HashKey.html" title="class in org.apache.juneau.utils">HashKey</a>,? extends <a href="../../../org/apache/juneau/Context.html" title="class in org.apache.juneau">Context</a>> value)</code> |
| <div class="block">Specifies a cache to use for hashkey-based caching.</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/juneau/Context.Builder.html#canApply-org.apache.juneau.AnnotationWorkList-">canApply</a></span>(<a href="../../../org/apache/juneau/AnnotationWorkList.html" title="class in org.apache.juneau">AnnotationWorkList</a> work)</code> |
| <div class="block">Returns <jk>true</jk> if any of the annotations/appliers can be applied to this builder.</div> |
| </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code>abstract <a href="../../../org/apache/juneau/Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/juneau/Context.Builder.html#copy--">copy</a></span>()</code> |
| <div class="block">Copy creator.</div> |
| </td> |
| </tr> |
| <tr id="i10" class="altColor"> |
| <td class="colFirst"><code><a href="../../../org/apache/juneau/Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/juneau/Context.Builder.html#debug--">debug</a></span>()</code> |
| <div class="block"><i><l>Context</l> configuration property: </i> Debug mode.</div> |
| </td> |
| </tr> |
| <tr id="i11" class="rowColor"> |
| <td class="colFirst"><code><a href="../../../org/apache/juneau/Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/juneau/Context.Builder.html#debug-boolean-">debug</a></span>(boolean value)</code> |
| <div class="block">Same as <a href="../../../org/apache/juneau/Context.Builder.html#debug--"><code>debug()</code></a> but allows you to explicitly specify the value.</div> |
| </td> |
| </tr> |
| <tr id="i12" class="altColor"> |
| <td class="colFirst"><code>protected <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html?is-external=true" title="class or interface in java.util">Optional</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/juneau/Context.Builder.html#env-java.lang.String-">env</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name)</code> |
| <div class="block">Looks up a system property or environment variable.</div> |
| </td> |
| </tr> |
| <tr id="i13" class="rowColor"> |
| <td class="colFirst"><code>protected <T> T</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/juneau/Context.Builder.html#env-java.lang.String-T-">env</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, |
| T def)</code> |
| <div class="block">Looks up a system property or environment variable.</div> |
| </td> |
| </tr> |
| <tr id="i14" class="altColor"> |
| <td class="colFirst"><code><a href="../../../org/apache/juneau/AnnotationWorkList.html" title="class in org.apache.juneau">AnnotationWorkList</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/juneau/Context.Builder.html#getApplied--">getApplied</a></span>()</code> |
| <div class="block">Returns all the annotations that have been applied to this builder.</div> |
| </td> |
| </tr> |
| <tr id="i15" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html?is-external=true" title="class or interface in java.util">Optional</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?>></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/juneau/Context.Builder.html#getType--">getType</a></span>()</code> |
| <div class="block">Returns the context class that this builder should create.</div> |
| </td> |
| </tr> |
| <tr id="i16" class="altColor"> |
| <td class="colFirst"><code><a href="../../../org/apache/juneau/utils/HashKey.html" title="class in org.apache.juneau.utils">HashKey</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/juneau/Context.Builder.html#hashKey--">hashKey</a></span>()</code> |
| <div class="block">Returns the hashkey of this builder.</div> |
| </td> |
| </tr> |
| <tr id="i17" class="rowColor"> |
| <td class="colFirst"><code><a href="../../../org/apache/juneau/Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/juneau/Context.Builder.html#impl-org.apache.juneau.Context-">impl</a></span>(<a href="../../../org/apache/juneau/Context.html" title="class in org.apache.juneau">Context</a> value)</code> |
| <div class="block">Specifies a pre-instantiated bean for the <a href="../../../org/apache/juneau/Context.Builder.html#build--"><code>build()</code></a> method to return.</div> |
| </td> |
| </tr> |
| <tr id="i18" class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/juneau/Context.Builder.html#isDebug--">isDebug</a></span>()</code> |
| <div class="block">Returns <jk>true</jk> if debug is enabled.</div> |
| </td> |
| </tr> |
| <tr id="i19" class="rowColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/juneau/Context.Builder.html#registerBuilders-java.lang.Object...-">registerBuilders</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>... builders)</code> |
| <div class="block">Registers the specified secondary builders with this context builder.</div> |
| </td> |
| </tr> |
| <tr id="i20" class="altColor"> |
| <td class="colFirst"><code><a href="../../../org/apache/juneau/Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/juneau/Context.Builder.html#type-java.lang.Class-">type</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><? extends <a href="../../../org/apache/juneau/Context.html" title="class in org.apache.juneau">Context</a>> value)</code> |
| <div class="block">Associates a context class with this builder.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a name="Builder--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>Builder</h4> |
| <pre>protected <a href="../../../src-html/org/apache/juneau/Context.Builder.html#line.152">Builder</a>()</pre> |
| <div class="block">Constructor. |
| Default settings.</div> |
| </li> |
| </ul> |
| <a name="Builder-org.apache.juneau.Context-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>Builder</h4> |
| <pre>protected <a href="../../../src-html/org/apache/juneau/Context.Builder.html#line.168">Builder</a>(<a href="../../../org/apache/juneau/Context.html" title="class in org.apache.juneau">Context</a> copyFrom)</pre> |
| <div class="block">Copy constructor.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>copyFrom</code> - The bean to copy from.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="Builder-org.apache.juneau.Context.Builder-"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>Builder</h4> |
| <pre>protected <a href="../../../src-html/org/apache/juneau/Context.Builder.html#line.180">Builder</a>(<a href="../../../org/apache/juneau/Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a> copyFrom)</pre> |
| <div class="block">Copy constructor.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>copyFrom</code> - The builder to copy from.</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="copy--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>copy</h4> |
| <pre>public abstract <a href="../../../org/apache/juneau/Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a> <a href="../../../src-html/org/apache/juneau/Context.Builder.html#line.216">copy</a>()</pre> |
| <div class="block">Copy creator.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>A new mutable copy of this builder.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="build--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>build</h4> |
| <pre>public <a href="../../../org/apache/juneau/Context.html" title="class in org.apache.juneau">Context</a> <a href="../../../src-html/org/apache/juneau/Context.Builder.html#line.223">build</a>()</pre> |
| <div class="block">Build the object.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The built object.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="hashKey--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>hashKey</h4> |
| <pre>public <a href="../../../org/apache/juneau/utils/HashKey.html" title="class in org.apache.juneau.utils">HashKey</a> <a href="../../../src-html/org/apache/juneau/Context.Builder.html#line.237">hashKey</a>()</pre> |
| <div class="block">Returns the hashkey of this builder. |
| |
| <p> |
| Used to return previously instantiated context beans that have matching hashkeys. |
| The <a href="../../../org/apache/juneau/utils/HashKey.html" title="class in org.apache.juneau.utils"><code>HashKey</code></a> object is suitable for use as a hashmap key of a map of context beans. |
| A context bean is considered equivalent if the <a href="../../../org/apache/juneau/utils/HashKey.html#equals-java.lang.Object-"><code>HashKey.equals(Object)</code></a> method is the same.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The hashkey of this builder.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="cache-org.apache.juneau.internal.Cache-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>cache</h4> |
| <pre>public <a href="../../../org/apache/juneau/Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a> <a href="../../../src-html/org/apache/juneau/Context.Builder.html#line.248">cache</a>(<a href="../../../org/apache/juneau/internal/Cache.html" title="class in org.apache.juneau.internal">Cache</a><<a href="../../../org/apache/juneau/utils/HashKey.html" title="class in org.apache.juneau.utils">HashKey</a>,? extends <a href="../../../org/apache/juneau/Context.html" title="class in org.apache.juneau">Context</a>> value)</pre> |
| <div class="block">Specifies a cache to use for hashkey-based caching.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>value</code> - The cache.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>This object.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="build-java.lang.Class-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>build</h4> |
| <pre>public final <T extends <a href="../../../org/apache/juneau/Context.html" title="class in org.apache.juneau">Context</a>> T <a href="../../../src-html/org/apache/juneau/Context.Builder.html#line.261">build</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><T> c)</pre> |
| <div class="block">Convenience method for calling <a href="../../../org/apache/juneau/Context.Builder.html#build--"><code>build()</code></a> while avoiding a cast.</div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>T</code> - The type to cast the built object to.</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>c</code> - The type to cast the built object to.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The built context bean.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="apply-java.lang.Class-java.util.function.Consumer-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>apply</h4> |
| <pre>public <T extends <a href="../../../org/apache/juneau/Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a>> <a href="../../../org/apache/juneau/Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a> <a href="../../../src-html/org/apache/juneau/Context.Builder.html#line.275">apply</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><T> subtype, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/Consumer.html?is-external=true" title="class or interface in java.util.function">Consumer</a><T> consumer)</pre> |
| <div class="block">Apply a consumer to this builder.</div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>T</code> - The builder subtype that this consumer can be applied to.</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>subtype</code> - The builder subtype that this consumer can be applied to.</dd> |
| <dd><code>consumer</code> - The consumer.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>This object.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="type-java.lang.Class-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>type</h4> |
| <pre>public <a href="../../../org/apache/juneau/Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a> <a href="../../../src-html/org/apache/juneau/Context.Builder.html#line.294">type</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><? extends <a href="../../../org/apache/juneau/Context.html" title="class in org.apache.juneau">Context</a>> value)</pre> |
| <div class="block">Associates a context class with this builder. |
| |
| <p> |
| This is the type of object that this builder creates when the <a href="../../../org/apache/juneau/Context.Builder.html#build--"><code>build()</code></a> method is called. |
| |
| <p> |
| By default, it's the outer class of where the builder class is defined.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>value</code> - The context class that this builder should create.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>This object.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getType--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getType</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html?is-external=true" title="class or interface in java.util">Optional</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?>> <a href="../../../src-html/org/apache/juneau/Context.Builder.html#line.304">getType</a>()</pre> |
| <div class="block">Returns the context class that this builder should create.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The context class if it was specified.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="impl-org.apache.juneau.Context-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>impl</h4> |
| <pre>public <a href="../../../org/apache/juneau/Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a> <a href="../../../src-html/org/apache/juneau/Context.Builder.html#line.315">impl</a>(<a href="../../../org/apache/juneau/Context.html" title="class in org.apache.juneau">Context</a> value)</pre> |
| <div class="block">Specifies a pre-instantiated bean for the <a href="../../../org/apache/juneau/Context.Builder.html#build--"><code>build()</code></a> method to return.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>value</code> - The value for this setting.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>This object.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="canApply-org.apache.juneau.AnnotationWorkList-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>canApply</h4> |
| <pre>public boolean <a href="../../../src-html/org/apache/juneau/Context.Builder.html#line.326">canApply</a>(<a href="../../../org/apache/juneau/AnnotationWorkList.html" title="class in org.apache.juneau">AnnotationWorkList</a> work)</pre> |
| <div class="block">Returns <jk>true</jk> if any of the annotations/appliers can be applied to this builder.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>work</code> - The work to check.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><jk>true</jk> if any of the annotations/appliers can be applied to this builder.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="apply-org.apache.juneau.AnnotationWorkList-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>apply</h4> |
| <pre>public <a href="../../../org/apache/juneau/Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a> <a href="../../../src-html/org/apache/juneau/Context.Builder.html#line.361">apply</a>(<a href="../../../org/apache/juneau/AnnotationWorkList.html" title="class in org.apache.juneau">AnnotationWorkList</a> work)</pre> |
| <div class="block">Applies a set of applied to this builder. |
| |
| <p> |
| An <a href="../../../org/apache/juneau/AnnotationWork.html" title="class in org.apache.juneau"><code>AnnotationWork</code></a> consists of a single pair of <a href="../../../org/apache/juneau/reflect/AnnotationInfo.html" title="class in org.apache.juneau.reflect"><code>AnnotationInfo</code></a> that represents an annotation instance, |
| and <a href="../../../org/apache/juneau/AnnotationApplier.html" title="class in org.apache.juneau"><code>AnnotationApplier</code></a> which represents the code used to apply the values in that annotation to a specific builder. |
| |
| <h5 class='section'>Example:</h5> |
| <p class='bjava'> |
| <jc>// A class annotated with a config annotation.</jc> |
| <ja>@BeanConfig</ja>(sortProperties=<js>"$S{sortProperties,false}"</js>) |
| <jk>public class</jk> MyClass {...} |
| |
| <jc>// Find all annotations that themselves are annotated with @ContextPropertiesApply.</jc> |
| AnnotationList <jv>annotations</jv> = ClassInfo.<jsm>of</jsm>(MyClass.<jk>class</jk>).getAnnotationList(<jsf>CONTEXT_APPLY_FILTER</jsf>); |
| VarResolverSession <jv>vrs</jv> = VarResolver.<jsf>DEFAULT</jsf>.createSession(); |
| AnnotationWorkList <jv>work</jv> = AnnotationWorkList.of(<jv>vrs</jv>, <jv>annotations</jv>); |
| |
| <jc>// Apply any settings found on the annotations.</jc> |
| WriterSerializer <jv>serializer</jv> = JsonSerializer |
| .<jsm>create</jsm>() |
| .apply(<jv>work</jv>) |
| .build(); |
| </p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>work</code> - The list of annotations and appliers to apply to this builder.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>This object.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getApplied--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getApplied</h4> |
| <pre>public <a href="../../../org/apache/juneau/AnnotationWorkList.html" title="class in org.apache.juneau">AnnotationWorkList</a> <a href="../../../src-html/org/apache/juneau/Context.Builder.html#line.372">getApplied</a>()</pre> |
| <div class="block">Returns all the annotations that have been applied to this builder.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>All the annotations that have been applied to this builder.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="registerBuilders-java.lang.Object...-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>registerBuilders</h4> |
| <pre>protected void <a href="../../../src-html/org/apache/juneau/Context.Builder.html#line.384">registerBuilders</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>... builders)</pre> |
| <div class="block">Registers the specified secondary builders with this context builder. |
| |
| <p> |
| When <a href="../../../org/apache/juneau/Context.Builder.html#apply-org.apache.juneau.AnnotationWorkList-"><code>apply(AnnotationWorkList)</code></a> is called, it gets called on all registered builders.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>builders</code> - The builders to add to the list of builders.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="applyAnnotations-java.lang.Class...-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>applyAnnotations</h4> |
| <pre>public <a href="../../../org/apache/juneau/Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a> <a href="../../../src-html/org/apache/juneau/Context.Builder.html#line.449">applyAnnotations</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a><?>... fromClasses)</pre> |
| <div class="block">Applies any of the various <ja>@XConfig</ja> annotations on the specified class to this context. |
| |
| <p> |
| Any annotations found that themselves are annotated with <a href="../../../org/apache/juneau/annotation/ContextApply.html" title="annotation in org.apache.juneau.annotation"><code>ContextApply</code></a> will be resolved and |
| applied as properties to this builder. These annotations include: |
| <ul class='javatreec'> |
| <li class ='ja'><a href="../../../org/apache/juneau/annotation/BeanConfig.html" title="annotation in org.apache.juneau.annotation"><code>BeanConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/csv/annotation/CsvConfig.html" title="annotation in org.apache.juneau.csv.annotation"><code>CsvConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/html/annotation/HtmlConfig.html" title="annotation in org.apache.juneau.html.annotation"><code>HtmlConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/html/annotation/HtmlDocConfig.html" title="annotation in org.apache.juneau.html.annotation"><code>HtmlDocConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/json/annotation/JsonConfig.html" title="annotation in org.apache.juneau.json.annotation"><code>JsonConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/jsonschema/annotation/JsonSchemaConfig.html" title="annotation in org.apache.juneau.jsonschema.annotation"><code>JsonSchemaConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/msgpack/annotation/MsgPackConfig.html" title="annotation in org.apache.juneau.msgpack.annotation"><code>MsgPackConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/oapi/annotation/OpenApiConfig.html" title="annotation in org.apache.juneau.oapi.annotation"><code>OpenApiConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/parser/annotation/ParserConfig.html" title="annotation in org.apache.juneau.parser.annotation"><code>ParserConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/plaintext/annotation/PlainTextConfig.html" title="annotation in org.apache.juneau.plaintext.annotation"><code>PlainTextConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/serializer/annotation/SerializerConfig.html" title="annotation in org.apache.juneau.serializer.annotation"><code>SerializerConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/soap/annotation/SoapXmlConfig.html" title="annotation in org.apache.juneau.soap.annotation"><code>SoapXmlConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/uon/annotation/UonConfig.html" title="annotation in org.apache.juneau.uon.annotation"><code>UonConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/urlencoding/annotation/UrlEncodingConfig.html" title="annotation in org.apache.juneau.urlencoding.annotation"><code>UrlEncodingConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/xml/annotation/XmlConfig.html" title="annotation in org.apache.juneau.xml.annotation"><code>XmlConfig</code></a> |
| <li class ='ja'><c>RdfConfig</c> |
| </ul> |
| |
| <p> |
| Annotations on classes are appended in the following order: |
| <ol> |
| <li>On the package of this class. |
| <li>On interfaces ordered parent-to-child. |
| <li>On parent classes ordered parent-to-child. |
| <li>On this class. |
| </ol> |
| |
| <p> |
| The default var resolver <a href="../../../org/apache/juneau/svl/VarResolver.html#DEFAULT"><code>VarResolver.DEFAULT</code></a> is used to resolve any variables in annotation field values. |
| |
| <h5 class='section'>Example:</h5> |
| <p class='bjava'> |
| <jc>// A class annotated with a config annotation.</jc> |
| <ja>@BeanConfig</ja>(sortProperties=<js>"$S{sortProperties,false}"</js>) |
| <jk>public class</jk> MyClass {...} |
| |
| <jc>// Apply any settings found on the annotations.</jc> |
| WriterSerializer <jv>serializer</jv> = JsonSerializer |
| .<jsm>create</jsm>() |
| .applyAnnotations(MyClass.<jk>class</jk>) |
| .build(); |
| </p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>fromClasses</code> - The classes on which the annotations are defined.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>This object.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="applyAnnotations-java.lang.reflect.Method...-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>applyAnnotations</h4> |
| <pre>public <a href="../../../org/apache/juneau/Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a> <a href="../../../src-html/org/apache/juneau/Context.Builder.html#line.513">applyAnnotations</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</a>... fromMethods)</pre> |
| <div class="block">Applies any of the various <ja>@XConfig</ja> annotations on the specified method to this context. |
| |
| <p> |
| Any annotations found that themselves are annotated with <a href="../../../org/apache/juneau/annotation/ContextApply.html" title="annotation in org.apache.juneau.annotation"><code>ContextApply</code></a> will be resolved and |
| applied as properties to this builder. These annotations include: |
| <ul class='javatreec'> |
| <li class ='ja'><a href="../../../org/apache/juneau/annotation/BeanConfig.html" title="annotation in org.apache.juneau.annotation"><code>BeanConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/csv/annotation/CsvConfig.html" title="annotation in org.apache.juneau.csv.annotation"><code>CsvConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/html/annotation/HtmlConfig.html" title="annotation in org.apache.juneau.html.annotation"><code>HtmlConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/html/annotation/HtmlDocConfig.html" title="annotation in org.apache.juneau.html.annotation"><code>HtmlDocConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/json/annotation/JsonConfig.html" title="annotation in org.apache.juneau.json.annotation"><code>JsonConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/jsonschema/annotation/JsonSchemaConfig.html" title="annotation in org.apache.juneau.jsonschema.annotation"><code>JsonSchemaConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/msgpack/annotation/MsgPackConfig.html" title="annotation in org.apache.juneau.msgpack.annotation"><code>MsgPackConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/oapi/annotation/OpenApiConfig.html" title="annotation in org.apache.juneau.oapi.annotation"><code>OpenApiConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/parser/annotation/ParserConfig.html" title="annotation in org.apache.juneau.parser.annotation"><code>ParserConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/plaintext/annotation/PlainTextConfig.html" title="annotation in org.apache.juneau.plaintext.annotation"><code>PlainTextConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/serializer/annotation/SerializerConfig.html" title="annotation in org.apache.juneau.serializer.annotation"><code>SerializerConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/soap/annotation/SoapXmlConfig.html" title="annotation in org.apache.juneau.soap.annotation"><code>SoapXmlConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/uon/annotation/UonConfig.html" title="annotation in org.apache.juneau.uon.annotation"><code>UonConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/urlencoding/annotation/UrlEncodingConfig.html" title="annotation in org.apache.juneau.urlencoding.annotation"><code>UrlEncodingConfig</code></a> |
| <li class ='ja'><a href="../../../org/apache/juneau/xml/annotation/XmlConfig.html" title="annotation in org.apache.juneau.xml.annotation"><code>XmlConfig</code></a> |
| <li class ='ja'><c>RdfConfig</c> |
| </ul> |
| |
| <p> |
| Annotations on methods are appended in the following order: |
| <ol> |
| <li>On the package of the method class. |
| <li>On interfaces ordered parent-to-child. |
| <li>On parent classes ordered parent-to-child. |
| <li>On the method class. |
| <li>On this method and matching methods ordered parent-to-child. |
| </ol> |
| |
| <p> |
| The default var resolver <a href="../../../org/apache/juneau/svl/VarResolver.html#DEFAULT"><code>VarResolver.DEFAULT</code></a> is used to resolve any variables in annotation field values. |
| |
| <h5 class='section'>Example:</h5> |
| <p class='bjava'> |
| <jc>// A method annotated with a config annotation.</jc> |
| <jk>public class</jk> MyClass { |
| <ja>@BeanConfig</ja>(sortProperties=<js>"$S{sortProperties,false}"</js>) |
| <jk>public void</jk> myMethod() {...} |
| } |
| |
| <jc>// Apply any settings found on the annotations.</jc> |
| WriterSerializer <jv>serializer</jv> = JsonSerializer |
| .<jsm>create</jsm>() |
| .applyAnnotations(MyClass.<jk>class</jk>.getMethod(<js>"myMethod"</js>)) |
| .build(); |
| </p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>fromMethods</code> - The methods on which the annotations are defined.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>This object.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="annotations-java.lang.annotation.Annotation...-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>annotations</h4> |
| <pre>public <a href="../../../org/apache/juneau/Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a> <a href="../../../src-html/org/apache/juneau/Context.Builder.html#line.696">annotations</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation">Annotation</a>... values)</pre> |
| <div class="block">Defines annotations to apply to specific classes and methods. |
| |
| <p> |
| Allows you to dynamically apply Juneau annotations typically applied directly to classes and methods. |
| Useful in cases where you want to use the functionality of the annotation on beans and bean properties but |
| do not have access to the code to do so. |
| |
| <p> |
| As a rule, any Juneau annotation with an <l>on()</l> method can be used with this setting. |
| |
| <p> |
| The following example shows the equivalent methods for applying the <a href="../../../org/apache/juneau/annotation/Bean.html" title="annotation in org.apache.juneau.annotation"><code>@Bean</code></a> annotation: |
| <p class='bjava'> |
| <jc>// Class with explicit annotation.</jc> |
| <ja>@Bean</ja>(properties=<js>"street,city,state"</js>) |
| <jk>public class</jk> A {...} |
| |
| <jc>// Class with annotation applied via @BeanConfig</jc> |
| <jk>public class</jk> B {...} |
| |
| <jc>// Java REST method with @BeanConfig annotation.</jc> |
| <ja>@RestGet</ja>(...) |
| <ja>@Bean</ja>(on=<js>"B"</js>, properties=<js>"street,city,state"</js>) |
| <jk>public void</jk> doFoo() {...} |
| </p> |
| |
| <p> |
| In general, the underlying framework uses this method when it finds dynamically applied annotations on |
| config annotations. However, concrete implementations of annotations are also provided that can be passed |
| directly into builder classes like so: |
| <p class='bjava'> |
| <jc>// Create a concrete @Bean annotation.</jc> |
| <ja>Bean</ja> <jv>annotation</jv> = BeanAnnotation.<jsm>create</jsm>(B.<jk>class</jk>).properties(<js>"street,city,state"</js>).build(); |
| |
| <jc>// Apply it to a serializer.</jc> |
| WriterSerializer <jv>serializer</jv> = JsonSerializer.<jsm>create</jsm>().annotations(<jv>annotation</jv>).build(); |
| |
| <jc>// Serialize a bean with the dynamically applied annotation.</jc> |
| String <jv>json</jv> = <jv>serializer</jv>.serialize(<jk>new</jk> B()); |
| </p> |
| |
| <p> |
| The following is the list of annotations builders provided that can be constructed |
| and passed into the builder class: |
| <ul class='javatreec'> |
| <li class='ja'><a href="../../../org/apache/juneau/annotation/BeanAnnotation.html" title="class in org.apache.juneau.annotation"><code>BeanAnnotation</code></a> |
| <li class='ja'><a href="../../../org/apache/juneau/annotation/BeancAnnotation.html" title="class in org.apache.juneau.annotation"><code>BeancAnnotation</code></a> |
| <li class='ja'><a href="../../../org/apache/juneau/annotation/BeanIgnoreAnnotation.html" title="class in org.apache.juneau.annotation"><code>BeanIgnoreAnnotation</code></a> |
| <li class='ja'><a href="../../../org/apache/juneau/annotation/BeanpAnnotation.html" title="class in org.apache.juneau.annotation"><code>BeanpAnnotation</code></a> |
| <li class='ja'><a href="../../../org/apache/juneau/annotation/ExampleAnnotation.html" title="class in org.apache.juneau.annotation"><code>ExampleAnnotation</code></a> |
| <li class='ja'><a href="../../../org/apache/juneau/annotation/NamePropertyAnnotation.html" title="class in org.apache.juneau.annotation"><code>NamePropertyAnnotation</code></a> |
| <li class='ja'><a href="../../../org/apache/juneau/annotation/ParentPropertyAnnotation.html" title="class in org.apache.juneau.annotation"><code>ParentPropertyAnnotation</code></a> |
| <li class='ja'><a href="../../../org/apache/juneau/annotation/SwapAnnotation.html" title="class in org.apache.juneau.annotation"><code>SwapAnnotation</code></a> |
| <li class='ja'><a href="../../../org/apache/juneau/annotation/UriAnnotation.html" title="class in org.apache.juneau.annotation"><code>UriAnnotation</code></a> |
| <li class='ja'><a href="../../../org/apache/juneau/csv/annotation/CsvAnnotation.html" title="class in org.apache.juneau.csv.annotation"><code>CsvAnnotation</code></a> |
| <li class='ja'><a href="../../../org/apache/juneau/html/annotation/HtmlAnnotation.html" title="class in org.apache.juneau.html.annotation"><code>HtmlAnnotation</code></a> |
| <li class='ja'><a href="../../../org/apache/juneau/json/annotation/JsonAnnotation.html" title="class in org.apache.juneau.json.annotation"><code>JsonAnnotation</code></a> |
| <li class='ja'><a href="../../../org/apache/juneau/annotation/SchemaAnnotation.html" title="class in org.apache.juneau.annotation"><code>SchemaAnnotation</code></a> |
| <li class='ja'><a href="../../../org/apache/juneau/msgpack/annotation/MsgPackAnnotation.html" title="class in org.apache.juneau.msgpack.annotation"><code>MsgPackAnnotation</code></a> |
| <li class='ja'><a href="../../../org/apache/juneau/oapi/annotation/OpenApiAnnotation.html" title="class in org.apache.juneau.oapi.annotation"><code>OpenApiAnnotation</code></a> |
| <li class='ja'><a href="../../../org/apache/juneau/plaintext/annotation/PlainTextAnnotation.html" title="class in org.apache.juneau.plaintext.annotation"><code>PlainTextAnnotation</code></a> |
| <li class='ja'><a href="../../../org/apache/juneau/soap/annotation/SoapXmlAnnotation.html" title="class in org.apache.juneau.soap.annotation"><code>SoapXmlAnnotation</code></a> |
| <li class='ja'><a href="../../../org/apache/juneau/uon/annotation/UonAnnotation.html" title="class in org.apache.juneau.uon.annotation"><code>UonAnnotation</code></a> |
| <li class='ja'><a href="../../../org/apache/juneau/urlencoding/annotation/UrlEncodingAnnotation.html" title="class in org.apache.juneau.urlencoding.annotation"><code>UrlEncodingAnnotation</code></a> |
| <li class='ja'><a href="../../../org/apache/juneau/xml/annotation/XmlAnnotation.html" title="class in org.apache.juneau.xml.annotation"><code>XmlAnnotation</code></a> |
| </ul> |
| |
| <p> |
| The syntax for the <l>on()</l> pattern match parameter depends on whether it applies to a class, method, field, or constructor. |
| The valid pattern matches are: |
| <ul class='spaced-list'> |
| <li>Classes: |
| <ul> |
| <li>Fully qualified: |
| <ul> |
| <li><js>"com.foo.MyClass"</js> |
| </ul> |
| <li>Fully qualified inner class: |
| <ul> |
| <li><js>"com.foo.MyClass$Inner1$Inner2"</js> |
| </ul> |
| <li>Simple: |
| <ul> |
| <li><js>"MyClass"</js> |
| </ul> |
| <li>Simple inner: |
| <ul> |
| <li><js>"MyClass$Inner1$Inner2"</js> |
| <li><js>"Inner1$Inner2"</js> |
| <li><js>"Inner2"</js> |
| </ul> |
| </ul> |
| <li>Methods: |
| <ul> |
| <li>Fully qualified with args: |
| <ul> |
| <li><js>"com.foo.MyClass.myMethod(String,int)"</js> |
| <li><js>"com.foo.MyClass.myMethod(java.lang.String,int)"</js> |
| <li><js>"com.foo.MyClass.myMethod()"</js> |
| </ul> |
| <li>Fully qualified: |
| <ul> |
| <li><js>"com.foo.MyClass.myMethod"</js> |
| </ul> |
| <li>Simple with args: |
| <ul> |
| <li><js>"MyClass.myMethod(String,int)"</js> |
| <li><js>"MyClass.myMethod(java.lang.String,int)"</js> |
| <li><js>"MyClass.myMethod()"</js> |
| </ul> |
| <li>Simple: |
| <ul> |
| <li><js>"MyClass.myMethod"</js> |
| </ul> |
| <li>Simple inner class: |
| <ul> |
| <li><js>"MyClass$Inner1$Inner2.myMethod"</js> |
| <li><js>"Inner1$Inner2.myMethod"</js> |
| <li><js>"Inner2.myMethod"</js> |
| </ul> |
| </ul> |
| <li>Fields: |
| <ul> |
| <li>Fully qualified: |
| <ul> |
| <li><js>"com.foo.MyClass.myField"</js> |
| </ul> |
| <li>Simple: |
| <ul> |
| <li><js>"MyClass.myField"</js> |
| </ul> |
| <li>Simple inner class: |
| <ul> |
| <li><js>"MyClass$Inner1$Inner2.myField"</js> |
| <li><js>"Inner1$Inner2.myField"</js> |
| <li><js>"Inner2.myField"</js> |
| </ul> |
| </ul> |
| <li>Constructors: |
| <ul> |
| <li>Fully qualified with args: |
| <ul> |
| <li><js>"com.foo.MyClass(String,int)"</js> |
| <li><js>"com.foo.MyClass(java.lang.String,int)"</js> |
| <li><js>"com.foo.MyClass()"</js> |
| </ul> |
| <li>Simple with args: |
| <ul> |
| <li><js>"MyClass(String,int)"</js> |
| <li><js>"MyClass(java.lang.String,int)"</js> |
| <li><js>"MyClass()"</js> |
| </ul> |
| <li>Simple inner class: |
| <ul> |
| <li><js>"MyClass$Inner1$Inner2()"</js> |
| <li><js>"Inner1$Inner2()"</js> |
| <li><js>"Inner2()"</js> |
| </ul> |
| </ul> |
| <li>A comma-delimited list of anything on this list. |
| </ul> |
| |
| <ul class='seealso'> |
| <li class='ja'><a href="../../../org/apache/juneau/annotation/BeanConfig.html" title="annotation in org.apache.juneau.annotation"><code>BeanConfig</code></a> |
| </ul></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>values</code> - The annotations to register with the context.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>This object.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="debug--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>debug</h4> |
| <pre>public <a href="../../../org/apache/juneau/Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a> <a href="../../../src-html/org/apache/juneau/Context.Builder.html#line.749">debug</a>()</pre> |
| <div class="block"><i><l>Context</l> configuration property: </i> Debug mode. |
| |
| <p> |
| Enables the following additional information during serialization: |
| <ul class='spaced-list'> |
| <li> |
| When bean getters throws exceptions, the exception includes the object stack information |
| in order to determine how that method was invoked. |
| <li> |
| Enables <a href="../../../org/apache/juneau/BeanTraverseContext.Builder.html#detectRecursions--"><code>BeanTraverseContext.Builder.detectRecursions()</code></a>. |
| </ul> |
| |
| <p> |
| Enables the following additional information during parsing: |
| <ul class='spaced-list'> |
| <li> |
| When bean setters throws exceptions, the exception includes the object stack information |
| in order to determine how that method was invoked. |
| </ul> |
| |
| <h5 class='section'>Example:</h5> |
| <p class='bjava'> |
| <jc>// Create a serializer with debug enabled.</jc> |
| WriterSerializer <jv>serializer</jv> = JsonSerializer |
| .<jsm>create</jsm>() |
| .debug() |
| .build(); |
| |
| <jc>// Create a POJO model with a recursive loop.</jc> |
| <jk>public class</jk> MyBean { |
| <jk>public</jk> Object <jf>f</jf>; |
| } |
| MyBean <jv>bean</jv> = <jk>new</jk> MyBean(); |
| <jv>bean</jv>.<jf>f</jf> = <jv>bean</jv>; |
| |
| <jc>// Throws a SerializeException and not a StackOverflowError</jc> |
| String <jv>json</jv> = <jv>serializer</jv>.serialize(<jv>bean</jv>); |
| </p> |
| |
| <ul class='seealso'> |
| <li class='ja'><a href="../../../org/apache/juneau/annotation/BeanConfig.html#debug--"><code>BeanConfig.debug()</code></a> |
| <li class='jm'><a href="../../../org/apache/juneau/ContextSession.Builder.html#debug-java.lang.Boolean-"><code>ContextSession.Builder.debug(Boolean)</code></a> |
| </ul></div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>This object.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="debug-boolean-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>debug</h4> |
| <pre>public <a href="../../../org/apache/juneau/Context.Builder.html" title="class in org.apache.juneau">Context.Builder</a> <a href="../../../src-html/org/apache/juneau/Context.Builder.html#line.760">debug</a>(boolean value)</pre> |
| <div class="block">Same as <a href="../../../org/apache/juneau/Context.Builder.html#debug--"><code>debug()</code></a> but allows you to explicitly specify the value.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>value</code> - The value for this setting.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>This object.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="isDebug--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isDebug</h4> |
| <pre>public boolean <a href="../../../src-html/org/apache/juneau/Context.Builder.html#line.770">isDebug</a>()</pre> |
| <div class="block">Returns <jk>true</jk> if debug is enabled.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><jk>true</jk> if debug is enabled.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="env-java.lang.String-java.lang.Object-"> |
| <!-- --> |
| </a><a name="env-java.lang.String-T-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>env</h4> |
| <pre>protected <T> T <a href="../../../src-html/org/apache/juneau/Context.Builder.html#line.786">env</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, |
| T def)</pre> |
| <div class="block">Looks up a system property or environment variable. |
| |
| <p> |
| First looks in system properties. Then converts the name to env-safe and looks in the system environment. |
| Then returns the default if it can't be found.</div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>T</code> - The type to convert to.</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - The property name.</dd> |
| <dd><code>def</code> - The default value if not found.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The default value.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="env-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>env</h4> |
| <pre>protected <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html?is-external=true" title="class or interface in java.util">Optional</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>> <a href="../../../src-html/org/apache/juneau/Context.Builder.html#line.800">env</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name)</pre> |
| <div class="block">Looks up a system property or environment variable. |
| |
| <p> |
| First looks in system properties. Then converts the name to env-safe and looks in the system environment. |
| Then returns the default if it can't be found.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - The property name.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The value if found.</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../index-all.html">Index</a></li> |
| <li><a href="../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../org/apache/juneau/Context.html" title="class in org.apache.juneau"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../org/apache/juneau/ContextRuntimeException.html" title="class in org.apache.juneau"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../index.html?org/apache/juneau/Context.Builder.html" target="_top">Frames</a></li> |
| <li><a href="Context.Builder.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| <p class="legalCopy"><small>Copyright © 2016–2022 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </body> |
| </html> |