Skip to content

Commit 692eecd

Browse files
committed
Publish docs from b0994db
0 parents  commit 692eecd

50 files changed

Lines changed: 3746 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.nojekyll

Whitespace-only changes.

annotations/component/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!doctype html><html lang=en-us><head><meta charset=UTF-8><meta name=viewport content="width=device-width,initial-scale=1"><title>@Component | Pixie Documentation</title><meta name=description content="Inject dependent objects from the Pixie System"><link rel=preconnect href=https://fonts.googleapis.com><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link href="https://fonts.googleapis.com/css2?family=Urbanist:ital,wght@0,300..900;1,300..900&family=Lato:ital,wght@0,300;0,400;0,700;0,900;1,300;1,400;1,700&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel=stylesheet><link rel=stylesheet href=/pixie/css/main.css></head><body><header class=site-header><a href=https://tomitribe.github.io/pixie/ class=header-brand><span class=brand-name>Pixie</span>
2+
<span class=brand-tagline>by Tomitribe</span></a><nav><ul class=header-nav><li><a href=/pixie/getting-started/>Docs</a></li><li><a href=/pixie/annotations/>Annotations</a></li><li><a href=/pixie/references/>References</a></li><li><a href=/pixie/producers/>Producers</a></li><li><a href=/pixie/events/>Events</a></li><li><a href=/pixie/testing/>Testing</a></li><li><a href=/pixie/configuration/>Configuration</a></li><li><a href=/pixie/changelog/>Changelog</a></li><li><a href=https://github.com/tomitribe/pixie data-external target=_blank rel=noopener>GitHub</a></li></ul></nav><div class=header-spacer></div><button class=hamburger id=menu-toggle aria-label="Toggle navigation">
3+
<svg viewBox="0 0 24 24"><line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="18" x2="21" y2="18"/></svg></button></header><nav class=sidebar id=sidebar><div class=nav-section><a href=/pixie/getting-started/ class=nav-section-title>Getting Started</a><ul class=nav-pages><li><a href=/pixie/getting-started/overview/>Overview</a></li><li><a href=/pixie/getting-started/installation/>Installation</a></li><li><a href=/pixie/getting-started/quick-example/>Quick Example</a></li></ul></div><div class=nav-section><a href=/pixie/annotations/ class=nav-section-title>Annotations</a><ul class=nav-pages><li><a href=/pixie/annotations/param/>@Param</a></li><li><a href=/pixie/annotations/default/>@Default</a></li><li><a href=/pixie/annotations/component/ class=active>@Component</a></li><li><a href=/pixie/annotations/nullable/>@Nullable</a></li><li><a href=/pixie/annotations/name/>@Name</a></li></ul></div><div class=nav-section><a href=/pixie/references/ class=nav-section-title>References</a><ul class=nav-pages><li><a href=/pixie/references/by-type/>By Type</a></li><li><a href=/pixie/references/by-name/>By Name</a></li><li><a href=/pixie/references/collections/>Collections</a></li><li><a href=/pixie/references/generics/>Generics</a></li></ul></div><div class=nav-section><a href=/pixie/producers/ class=nav-section-title>Producers</a><ul class=nav-pages><li><a href=/pixie/producers/constructor/>Constructor</a></li><li><a href=/pixie/producers/factory-method/>Factory Method</a></li><li><a href=/pixie/producers/builder-pattern/>Builder Pattern</a></li><li><a href=/pixie/producers/pre-built-instances/>Pre-built Instances</a></li></ul></div><div class=nav-section><a href=/pixie/events/ class=nav-section-title>Events</a><ul class=nav-pages><li><a href=/pixie/events/firing-events/>Firing Events</a></li><li><a href=/pixie/events/observing-events/>Observing Events</a></li><li><a href=/pixie/events/before-and-after/>Before & After</a></li><li><a href=/pixie/events/built-in-events/>Built-in Events</a></li></ul></div><div class=nav-section><a href=/pixie/testing/ class=nav-section-title>Testing</a><ul class=nav-pages><li><a href=/pixie/testing/plain-java/>Plain Java</a></li><li><a href=/pixie/testing/system-builder/>System.builder()</a></li></ul></div><div class=nav-section><a href=/pixie/configuration/ class=nav-section-title>Configuration</a><ul class=nav-pages><li><a href=/pixie/configuration/properties/>Properties Format</a></li><li><a href=/pixie/configuration/builder/>Builder API</a></li><li><a href=/pixie/configuration/validation/>Validation</a></li></ul></div><div class=nav-section><a href=/pixie/changelog/ class=nav-section-title>Changelog</a><ul class=nav-pages></ul></div></nav><div class=sidebar-overlay id=sidebar-overlay></div><div class=site-layout><main class=main-content><nav class=breadcrumbs><a href=/>Docs</a>
4+
<span class=sep>&#8250;</span>
5+
<a href=/pixie/annotations/>Annotations</a>
6+
<span class=sep>&#8250;</span>
7+
<span>@Component</span></nav><article class=article><h1>@Component</h1><p class=subtitle>Inject dependent objects from the Pixie System</p><p><strong>Purpose:</strong> Indicates that a constructor parameter should be injected as a component dependency.</p><h2 id=example>Example</h2><div class=highlight><pre tabindex=0 class=chroma><code class=language-java data-lang=java><span class=line><span class=cl><span class=kd>public</span><span class=w> </span><span class=kd>class</span> <span class=nc>ShoppingCart</span><span class=w> </span><span class=p>{</span><span class=w>
8+
</span></span></span><span class=line><span class=cl><span class=w> </span><span class=kd>public</span><span class=w> </span><span class=nf>ShoppingCart</span><span class=p>(</span><span class=nd>@Param</span><span class=p>(</span><span class=s>&#34;processor&#34;</span><span class=p>)</span><span class=w> </span><span class=nd>@Component</span><span class=w>
9+
</span></span></span><span class=line><span class=cl><span class=w> </span><span class=kd>final</span><span class=w> </span><span class=n>PaymentProcessor</span><span class=w> </span><span class=n>processor</span><span class=p>)</span><span class=w> </span><span class=p>{</span><span class=w>
10+
</span></span></span><span class=line><span class=cl><span class=w> </span><span class=c1>// ...</span><span class=w>
11+
</span></span></span><span class=line><span class=cl><span class=w> </span><span class=p>}</span><span class=w>
12+
</span></span></span><span class=line><span class=cl><span class=p>}</span><span class=w>
13+
</span></span></span></code></pre></div><p>Pixie resolves <code>@Component</code> references in several ways:</p><ul><li><a href=/pixie/references/by-name/><strong>By Name</strong></a><code>cart.processor = @stripe</code> references a specific component</li><li><a href=/pixie/references/by-type/><strong>By Type</strong></a> — omit the property and Pixie finds a match automatically</li><li><a href=/pixie/references/collections/><strong>Collections</strong></a> — use <code>List&lt;T></code> to inject multiple components</li><li><a href=/pixie/references/generics/><strong>Generics</strong></a> — generic type arguments narrow which components match</li></ul><p>See the <a href=/pixie/references/>References</a> section for full details on each resolution mode.</p></article><nav class=page-nav><a href=/pixie/annotations/default/ class=prev><div class=nav-label>&larr; Previous</div><div class=nav-title>@Default</div></a><a href=/pixie/annotations/nullable/ class=next><div class=nav-label>Next &rarr;</div><div class=nav-title>@Nullable</div></a></nav></main><aside class=page-toc id=toc><div class=toc-heading>On this page</div><nav><nav id=TableOfContents><ul><li><a href=#example>Example</a></li></ul></nav></nav></aside></div><footer class=site-footer><div class=footer-inner><p><span class=footer-brand>Pixie</span>
14+
by Tomitribe</p></div></footer><script>(function(){var t,s,o=document.getElementById("menu-toggle"),n=document.getElementById("sidebar"),e=document.getElementById("sidebar-overlay");if(o&&n&&(o.addEventListener("click",function(){n.classList.toggle("open"),e&&e.classList.toggle("visible")}),e&&e.addEventListener("click",function(){n.classList.remove("open"),e.classList.remove("visible")})),document.querySelectorAll(".article pre").forEach(function(e){var t,n=e.querySelector("code");if(!n)return;t=document.createElement("button"),t.className="copy-btn",t.textContent="Copy",t.addEventListener("click",function(){navigator.clipboard.writeText(n.textContent).then(function(){t.textContent="Copied!",t.classList.add("copied"),setTimeout(function(){t.textContent="Copy",t.classList.remove("copied")},2e3)})}),e.appendChild(t)}),t=document.querySelectorAll(".page-toc nav a"),t.length>0){s=[],t.forEach(function(e){var n,t=e.getAttribute("href");t&&t.startsWith("#")&&(n=document.getElementById(t.slice(1)),n&&s.push({el:n,link:e}))});function i(){var n=window.scrollY+100,e=null;s.forEach(function(t){t.el.offsetTop<=n&&(e=t)}),t.forEach(function(e){e.classList.remove("active")}),e&&e.link.classList.add("active")}window.addEventListener("scroll",i,{passive:!0}),i()}})()</script></body></html>

annotations/default/index.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!doctype html><html lang=en-us><head><meta charset=UTF-8><meta name=viewport content="width=device-width,initial-scale=1"><title>@Default | Pixie Documentation</title><meta name=description content="Provide fallback values for missing properties"><link rel=preconnect href=https://fonts.googleapis.com><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link href="https://fonts.googleapis.com/css2?family=Urbanist:ital,wght@0,300..900;1,300..900&family=Lato:ital,wght@0,300;0,400;0,700;0,900;1,300;1,400;1,700&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel=stylesheet><link rel=stylesheet href=/pixie/css/main.css></head><body><header class=site-header><a href=https://tomitribe.github.io/pixie/ class=header-brand><span class=brand-name>Pixie</span>
2+
<span class=brand-tagline>by Tomitribe</span></a><nav><ul class=header-nav><li><a href=/pixie/getting-started/>Docs</a></li><li><a href=/pixie/annotations/>Annotations</a></li><li><a href=/pixie/references/>References</a></li><li><a href=/pixie/producers/>Producers</a></li><li><a href=/pixie/events/>Events</a></li><li><a href=/pixie/testing/>Testing</a></li><li><a href=/pixie/configuration/>Configuration</a></li><li><a href=/pixie/changelog/>Changelog</a></li><li><a href=https://github.com/tomitribe/pixie data-external target=_blank rel=noopener>GitHub</a></li></ul></nav><div class=header-spacer></div><button class=hamburger id=menu-toggle aria-label="Toggle navigation">
3+
<svg viewBox="0 0 24 24"><line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="18" x2="21" y2="18"/></svg></button></header><nav class=sidebar id=sidebar><div class=nav-section><a href=/pixie/getting-started/ class=nav-section-title>Getting Started</a><ul class=nav-pages><li><a href=/pixie/getting-started/overview/>Overview</a></li><li><a href=/pixie/getting-started/installation/>Installation</a></li><li><a href=/pixie/getting-started/quick-example/>Quick Example</a></li></ul></div><div class=nav-section><a href=/pixie/annotations/ class=nav-section-title>Annotations</a><ul class=nav-pages><li><a href=/pixie/annotations/param/>@Param</a></li><li><a href=/pixie/annotations/default/ class=active>@Default</a></li><li><a href=/pixie/annotations/component/>@Component</a></li><li><a href=/pixie/annotations/nullable/>@Nullable</a></li><li><a href=/pixie/annotations/name/>@Name</a></li></ul></div><div class=nav-section><a href=/pixie/references/ class=nav-section-title>References</a><ul class=nav-pages><li><a href=/pixie/references/by-type/>By Type</a></li><li><a href=/pixie/references/by-name/>By Name</a></li><li><a href=/pixie/references/collections/>Collections</a></li><li><a href=/pixie/references/generics/>Generics</a></li></ul></div><div class=nav-section><a href=/pixie/producers/ class=nav-section-title>Producers</a><ul class=nav-pages><li><a href=/pixie/producers/constructor/>Constructor</a></li><li><a href=/pixie/producers/factory-method/>Factory Method</a></li><li><a href=/pixie/producers/builder-pattern/>Builder Pattern</a></li><li><a href=/pixie/producers/pre-built-instances/>Pre-built Instances</a></li></ul></div><div class=nav-section><a href=/pixie/events/ class=nav-section-title>Events</a><ul class=nav-pages><li><a href=/pixie/events/firing-events/>Firing Events</a></li><li><a href=/pixie/events/observing-events/>Observing Events</a></li><li><a href=/pixie/events/before-and-after/>Before & After</a></li><li><a href=/pixie/events/built-in-events/>Built-in Events</a></li></ul></div><div class=nav-section><a href=/pixie/testing/ class=nav-section-title>Testing</a><ul class=nav-pages><li><a href=/pixie/testing/plain-java/>Plain Java</a></li><li><a href=/pixie/testing/system-builder/>System.builder()</a></li></ul></div><div class=nav-section><a href=/pixie/configuration/ class=nav-section-title>Configuration</a><ul class=nav-pages><li><a href=/pixie/configuration/properties/>Properties Format</a></li><li><a href=/pixie/configuration/builder/>Builder API</a></li><li><a href=/pixie/configuration/validation/>Validation</a></li></ul></div><div class=nav-section><a href=/pixie/changelog/ class=nav-section-title>Changelog</a><ul class=nav-pages></ul></div></nav><div class=sidebar-overlay id=sidebar-overlay></div><div class=site-layout><main class=main-content><nav class=breadcrumbs><a href=/>Docs</a>
4+
<span class=sep>&#8250;</span>
5+
<a href=/pixie/annotations/>Annotations</a>
6+
<span class=sep>&#8250;</span>
7+
<span>@Default</span></nav><article class=article><h1>@Default</h1><p class=subtitle>Provide fallback values for missing properties</p><p><strong>Purpose:</strong> Specifies a default value for a constructor parameter if it is not set in the configuration.</p><h2 id=example>Example</h2><div class=highlight><pre tabindex=0 class=chroma><code class=language-java data-lang=java><span class=line><span class=cl><span class=kd>public</span><span class=w> </span><span class=kd>final</span><span class=w> </span><span class=kd>class</span> <span class=nc>Address</span><span class=w> </span><span class=p>{</span><span class=w>
8+
</span></span></span><span class=line><span class=cl><span class=w> </span><span class=kd>private</span><span class=w> </span><span class=kd>final</span><span class=w> </span><span class=n>String</span><span class=w> </span><span class=n>country</span><span class=p>;</span><span class=w>
9+
</span></span></span><span class=line><span class=cl><span class=w>
10+
</span></span></span><span class=line><span class=cl><span class=w> </span><span class=kd>public</span><span class=w> </span><span class=nf>Address</span><span class=p>(</span><span class=nd>@Param</span><span class=p>(</span><span class=s>&#34;country&#34;</span><span class=p>)</span><span class=w> </span><span class=nd>@Default</span><span class=p>(</span><span class=s>&#34;USA&#34;</span><span class=p>)</span><span class=w> </span><span class=kd>final</span><span class=w> </span><span class=n>String</span><span class=w> </span><span class=n>country</span><span class=p>)</span><span class=w> </span><span class=p>{</span><span class=w>
11+
</span></span></span><span class=line><span class=cl><span class=w> </span><span class=k>this</span><span class=p>.</span><span class=na>country</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=n>country</span><span class=p>;</span><span class=w>
12+
</span></span></span><span class=line><span class=cl><span class=w> </span><span class=p>}</span><span class=w>
13+
</span></span></span><span class=line><span class=cl><span class=p>}</span><span class=w>
14+
</span></span></span></code></pre></div><p>If <code>country</code> is missing from the config, <code>"USA"</code> is used.</p><h2 id=with-component>With @Component</h2><p><code>@Default</code> also applies to <code>@Component</code> parameters. When used on <code>@Component</code>, it implies the name of the component that should be injected:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-java data-lang=java><span class=line><span class=cl><span class=kd>public</span><span class=w> </span><span class=kd>final</span><span class=w> </span><span class=kd>class</span> <span class=nc>OrderService</span><span class=w> </span><span class=p>{</span><span class=w>
15+
</span></span></span><span class=line><span class=cl><span class=w> </span><span class=kd>private</span><span class=w> </span><span class=kd>final</span><span class=w> </span><span class=n>PaymentProcessor</span><span class=w> </span><span class=n>processor</span><span class=p>;</span><span class=w>
16+
</span></span></span><span class=line><span class=cl><span class=w>
17+
</span></span></span><span class=line><span class=cl><span class=w> </span><span class=kd>public</span><span class=w> </span><span class=nf>OrderService</span><span class=p>(</span><span class=nd>@Param</span><span class=p>(</span><span class=s>&#34;processor&#34;</span><span class=p>)</span><span class=w> </span><span class=nd>@Component</span><span class=w>
18+
</span></span></span><span class=line><span class=cl><span class=w> </span><span class=nd>@Default</span><span class=p>(</span><span class=s>&#34;stripe&#34;</span><span class=p>)</span><span class=w> </span><span class=kd>final</span><span class=w> </span><span class=n>PaymentProcessor</span><span class=w> </span><span class=n>processor</span><span class=p>)</span><span class=w> </span><span class=p>{</span><span class=w>
19+
</span></span></span><span class=line><span class=cl><span class=w> </span><span class=k>this</span><span class=p>.</span><span class=na>processor</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=n>processor</span><span class=p>;</span><span class=w>
20+
</span></span></span><span class=line><span class=cl><span class=w> </span><span class=p>}</span><span class=w>
21+
</span></span></span><span class=line><span class=cl><span class=p>}</span><span class=w>
22+
</span></span></span></code></pre></div><p>If <code>processor</code> is not specified in the config, Pixie will look for a component named <code>stripe</code>.</p></article><nav class=page-nav><a href=/pixie/annotations/param/ class=prev><div class=nav-label>&larr; Previous</div><div class=nav-title>@Param</div></a><a href=/pixie/annotations/component/ class=next><div class=nav-label>Next &rarr;</div><div class=nav-title>@Component</div></a></nav></main><aside class=page-toc id=toc><div class=toc-heading>On this page</div><nav><nav id=TableOfContents><ul><li><a href=#example>Example</a></li><li><a href=#with-component>With @Component</a></li></ul></nav></nav></aside></div><footer class=site-footer><div class=footer-inner><p><span class=footer-brand>Pixie</span>
23+
by Tomitribe</p></div></footer><script>(function(){var t,s,o=document.getElementById("menu-toggle"),n=document.getElementById("sidebar"),e=document.getElementById("sidebar-overlay");if(o&&n&&(o.addEventListener("click",function(){n.classList.toggle("open"),e&&e.classList.toggle("visible")}),e&&e.addEventListener("click",function(){n.classList.remove("open"),e.classList.remove("visible")})),document.querySelectorAll(".article pre").forEach(function(e){var t,n=e.querySelector("code");if(!n)return;t=document.createElement("button"),t.className="copy-btn",t.textContent="Copy",t.addEventListener("click",function(){navigator.clipboard.writeText(n.textContent).then(function(){t.textContent="Copied!",t.classList.add("copied"),setTimeout(function(){t.textContent="Copy",t.classList.remove("copied")},2e3)})}),e.appendChild(t)}),t=document.querySelectorAll(".page-toc nav a"),t.length>0){s=[],t.forEach(function(e){var n,t=e.getAttribute("href");t&&t.startsWith("#")&&(n=document.getElementById(t.slice(1)),n&&s.push({el:n,link:e}))});function i(){var n=window.scrollY+100,e=null;s.forEach(function(t){t.el.offsetTop<=n&&(e=t)}),t.forEach(function(e){e.classList.remove("active")}),e&&e.link.classList.add("active")}window.addEventListener("scroll",i,{passive:!0}),i()}})()</script></body></html>

0 commit comments

Comments
 (0)