snipt

Ctrl+h for KB shortcuts

Java

deflog snippet for eclipse

private static final Logger logger = Logger.getLogger(${enclosing_type}.class);
${cursor}
https://snipt.net/embed/ced73f5a5101a2f5755c214de496e6f5/
/raw/ced73f5a5101a2f5755c214de496e6f5/
ced73f5a5101a2f5755c214de496e6f5
java
Java
2
2019-05-31T04:52:40
True
False
False
/api/public/snipt/7621/
deflog-snippet-for-eclipse
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="kd">private</span> <span class="kd">static</span> <span class="kd">final</span> <span class="n">Logger</span> <span class="n">logger</span> <span class="o">=</span> <span class="n">Logger</span><span class="o">.</span><span class="na">getLogger</span><span class="o">(</span><span class="n">$</span><span class="o">{</span><span class="n">enclosing_type</span><span class="o">}.</span><span class="na">class</span><span class="o">);</span> </span><span id="L-2"><a name="L-2"></a><span class="n">$</span><span class="o">{</span><span class="n">cursor</span><span class="o">}</span> </span></pre></div> </td></tr></table>
eclipse, java, template

Java

IsEmpty snippet for eclipse

1
2
3
if(StringUtils.isEmpty(${str:var(java.lang.String)})) {
   ${cursor}
}
https://snipt.net/embed/b0fd5cbd6968911fcf778ca7926b91fb/
/raw/b0fd5cbd6968911fcf778ca7926b91fb/
b0fd5cbd6968911fcf778ca7926b91fb
java
Java
3
2019-06-10T14:42:22
True
False
False
/api/public/snipt/7620/
isempty-snippet-for-eclipse
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">if</span><span class="o">(</span><span class="n">StringUtils</span><span class="o">.</span><span class="na">isEmpty</span><span class="o">(</span><span class="n">$</span><span class="o">{</span><span class="n">str</span><span class="o">:</span><span class="n">var</span><span class="o">(</span><span class="n">java</span><span class="o">.</span><span class="na">lang</span><span class="o">.</span><span class="na">String</span><span class="o">)}))</span> <span class="o">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="n">$</span><span class="o">{</span><span class="n">cursor</span><span class="o">}</span> </span><span id="L-3"><a name="L-3"></a><span class="o">}</span> </span></pre></div> </td></tr></table>
eclipse, java, template

Java

Error snippet for Eclipse

logger.error("<${word_selection}> ${cursor}",${e:var(java.lang.Exception)});
https://snipt.net/embed/27ef5cc13fcc17060c13a3aa41a06fb2/
/raw/27ef5cc13fcc17060c13a3aa41a06fb2/
27ef5cc13fcc17060c13a3aa41a06fb2
java
Java
1
2019-06-05T16:13:40
True
False
False
/api/public/snipt/7619/
error-snippet-for-eclipse
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="n">logger</span><span class="o">.</span><span class="na">error</span><span class="o">(</span><span class="s">&quot;&lt;${word_selection}&gt; ${cursor}&quot;</span><span class="o">,</span><span class="n">$</span><span class="o">{</span><span class="n">e</span><span class="o">:</span><span class="n">var</span><span class="o">(</span><span class="n">java</span><span class="o">.</span><span class="na">lang</span><span class="o">.</span><span class="na">Exception</span><span class="o">)});</span> </span></pre></div> </td></tr></table>
eclipse, java, template

Java

Warn snippet for Eclipse

logger.warn("<${word_selection}> ${cursor}",${e:var(java.lang.Exception)});
https://snipt.net/embed/99faded69d25741bd9d55ad01a873814/
/raw/99faded69d25741bd9d55ad01a873814/
99faded69d25741bd9d55ad01a873814
java
Java
1
2019-06-08T16:46:07
True
False
False
/api/public/snipt/7618/
warn-snippet-for-eclipse
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="n">logger</span><span class="o">.</span><span class="na">warn</span><span class="o">(</span><span class="s">&quot;&lt;${word_selection}&gt; ${cursor}&quot;</span><span class="o">,</span><span class="n">$</span><span class="o">{</span><span class="n">e</span><span class="o">:</span><span class="n">var</span><span class="o">(</span><span class="n">java</span><span class="o">.</span><span class="na">lang</span><span class="o">.</span><span class="na">Exception</span><span class="o">)});</span> </span></pre></div> </td></tr></table>
eclipse, java, template

Java

Info snippet for Eclipse

1
2
3
if(logger.isInfoEnabled()) {
   logger.info("<${word_selection}> ${cursor}");
}
https://snipt.net/embed/88c26dc0497a8b0f9f85b3b59236f753/
/raw/88c26dc0497a8b0f9f85b3b59236f753/
88c26dc0497a8b0f9f85b3b59236f753
java
Java
3
2019-06-12T08:35:21
True
False
False
/api/public/snipt/7617/
info-snippet-for-eclipse
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">if</span><span class="o">(</span><span class="n">logger</span><span class="o">.</span><span class="na">isInfoEnabled</span><span class="o">())</span> <span class="o">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="n">logger</span><span class="o">.</span><span class="na">info</span><span class="o">(</span><span class="s">&quot;&lt;${word_selection}&gt; ${cursor}&quot;</span><span class="o">);</span> </span><span id="L-3"><a name="L-3"></a><span class="o">}</span> </span></pre></div> </td></tr></table>
eclipse, java, template

Java

Debug Snippet for Eclipse

1
2
3
if(logger.isDebugEnabled()) {
	logger.debug("<${word_selection}> ${cursor}");
}
https://snipt.net/embed/c27574dad2b40f3504bcd3eb87c90515/
/raw/c27574dad2b40f3504bcd3eb87c90515/
c27574dad2b40f3504bcd3eb87c90515
java
Java
3
2019-06-05T12:04:44
True
False
False
/api/public/snipt/7616/
debug-snippet-for-eclipse
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">if</span><span class="o">(</span><span class="n">logger</span><span class="o">.</span><span class="na">isDebugEnabled</span><span class="o">())</span> <span class="o">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="n">logger</span><span class="o">.</span><span class="na">debug</span><span class="o">(</span><span class="s">&quot;&lt;${word_selection}&gt; ${cursor}&quot;</span><span class="o">);</span> </span><span id="L-3"><a name="L-3"></a><span class="o">}</span> </span></pre></div> </td></tr></table>
eclipse, java, template