blob: 19902817589b2eaf55f62ba0f8ab044f8ede2ee5 [file] [log] [blame]
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="fr">
<head>
<!-- Generated by javadoc (11.0.4) on Fri Jan 24 17:07:14 CET 2020 -->
<title>DefaultHashFormatFactory (Apache Shiro 1.5.0 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2020-01-24">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../../../jquery/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../../../../../../jquery/jquery-migrate-3.0.1.js"></script>
<script type="text/javascript" src="../../../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="DefaultHashFormatFactory (Apache Shiro 1.5.0 API)";
}
}
catch(err) {
}
//-->
var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/DefaultHashFormatFactory.html">Use</a></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" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</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>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">org.apache.shiro.crypto.hash.format</a></div>
<h2 title="Class DefaultHashFormatFactory" class="title">Class DefaultHashFormatFactory</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" class="externalLink">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.shiro.crypto.hash.format.DefaultHashFormatFactory</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><code><a href="HashFormatFactory.html" title="interface in org.apache.shiro.crypto.hash.format">HashFormatFactory</a></code></dd>
</dl>
<hr>
<pre>public class <a href="../../../../../../src-html/org/apache/shiro/crypto/hash/format/DefaultHashFormatFactory.html#line.37">DefaultHashFormatFactory</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" class="externalLink">Object</a>
implements <a href="HashFormatFactory.html" title="interface in org.apache.shiro.crypto.hash.format">HashFormatFactory</a></pre>
<div class="block">This default <code>HashFormatFactory</code> implementation heuristically determines a <code>HashFormat</code> class to
instantiate based on the input argument and returns a new instance of the discovered class. The heuristics are
detailed in the <a href="#getInstance(java.lang.String)"><code>getInstance</code></a> method documentation.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.2</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Constructor</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E()">DefaultHashFormatFactory</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
</table>
</li>
</ul>
</section>
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#assertHashFormatImpl(java.lang.Class)">assertHashFormatImpl</a></span>&#8203;(<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="externalLink">Class</a>&nbsp;clazz)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>,&#8203;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getFormatClassNames()">getFormatClassNames</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns a <code>hashFormatAlias</code>-to-<code>fullyQualifiedHashFormatClassNameImplementation</code> map.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>protected <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="externalLink">Class</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getHashFormatClass(java.lang.String)">getHashFormatClass</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;token)</code></th>
<td class="colLast">
<div class="block">Heuristically determine the fully qualified HashFormat implementation class name based on the specified
token.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>protected <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="externalLink">Class</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getHashFormatClass(java.lang.String,java.lang.String)">getHashFormatClass</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;packageName,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;token)</code></th>
<td class="colLast">
<div class="block">Heuristically determine the fully qualified <code>HashFormat</code> implementation class name in the specified
package based on the provided token.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="HashFormat.html" title="interface in org.apache.shiro.crypto.hash.format">HashFormat</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getInstance(java.lang.String)">getInstance</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;in)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink">Set</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSearchPackages()">getSearchPackages</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns a set of package names that can be searched for <a href="HashFormat.html" title="interface in org.apache.shiro.crypto.hash.format"><code>HashFormat</code></a> implementations according to
heuristics defined in the <a href="#getHashFormatClass(java.lang.String,java.lang.String)"><code>getHashFormat(packageName, token)</code></a> JavaDoc.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>protected <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="externalLink">Class</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#lookupHashFormatClass(java.lang.String)">lookupHashFormatClass</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;name)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>protected <a href="HashFormat.html" title="interface in org.apache.shiro.crypto.hash.format">HashFormat</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#newHashFormatInstance(java.lang.Class)">newHashFormatInstance</a></span>&#8203;(<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="externalLink">Class</a>&nbsp;clazz)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setFormatClassNames(java.util.Map)">setFormatClassNames</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>,&#8203;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&gt;&nbsp;formatClassNames)</code></th>
<td class="colLast">
<div class="block">Sets the <code>hash-format-alias</code>-to-<code>fullyQualifiedHashFormatClassNameImplementation</code> map to be used in
the <a href="#getInstance(java.lang.String)"><code>getInstance(String)</code></a> implementation.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setSearchPackages(java.util.Set)">setSearchPackages</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink">Set</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&gt;&nbsp;searchPackages)</code></th>
<td class="colLast">
<div class="block">Sets a set of package names that can be searched for <a href="HashFormat.html" title="interface in org.apache.shiro.crypto.hash.format"><code>HashFormat</code></a> implementations according to
heuristics defined in the <a href="#getHashFormatClass(java.lang.String,java.lang.String)"><code>getHashFormat(packageName, token)</code></a> JavaDoc.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;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" class="externalLink">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" class="externalLink">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" class="externalLink">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" class="externalLink">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" class="externalLink">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" class="externalLink">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" class="externalLink">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" class="externalLink">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" class="externalLink">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" class="externalLink">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" class="externalLink">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" class="externalLink">wait</a></code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a id="&lt;init&gt;()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>DefaultHashFormatFactory</h4>
<pre>public&nbsp;<a href="../../../../../../src-html/org/apache/shiro/crypto/hash/format/DefaultHashFormatFactory.html#line.43">DefaultHashFormatFactory</a>()</pre>
</li>
</ul>
</li>
</ul>
</section>
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="getFormatClassNames()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFormatClassNames</h4>
<pre class="methodSignature">public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>,&#8203;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&gt;&nbsp;<a href="../../../../../../src-html/org/apache/shiro/crypto/hash/format/DefaultHashFormatFactory.html#line.65">getFormatClassNames</a>()</pre>
<div class="block">Returns a <code>hashFormatAlias</code>-to-<code>fullyQualifiedHashFormatClassNameImplementation</code> map.
<p/>
This map will be used by the <a href="#getInstance(java.lang.String)"><code>getInstance</code></a> implementation: that method's argument
will be used as a lookup key to this map. If the map returns a value, that value will be used to instantiate
and return a new <code>HashFormat</code> instance.
<h3>Defaults</h3>
Shiro's default HashFormat implementations (as listed by the <a href="ProvidedHashFormat.html" title="enum in org.apache.shiro.crypto.hash.format"><code>ProvidedHashFormat</code></a> enum) will
be searched automatically independently of this map. You only need to populate this map with custom
<code>HashFormat</code> implementations that are <em>not</em> already represented by a <code>ProvidedHashFormat</code>.
<h3>Efficiency</h3>
Populating this map will be more efficient than configuring <a href="#getSearchPackages()"><code>searchPackages</code></a>,
but search packages may be more convenient depending on the number of <code>HashFormat</code> implementations that
need to be supported by this factory.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a <code>hashFormatAlias</code>-to-<code>fullyQualifiedHashFormatClassNameImplementation</code> map.</dd>
</dl>
</li>
</ul>
<a id="setFormatClassNames(java.util.Map)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setFormatClassNames</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/shiro/crypto/hash/format/DefaultHashFormatFactory.html#line.81">setFormatClassNames</a>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>,&#8203;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&gt;&nbsp;formatClassNames)</pre>
<div class="block">Sets the <code>hash-format-alias</code>-to-<code>fullyQualifiedHashFormatClassNameImplementation</code> map to be used in
the <a href="#getInstance(java.lang.String)"><code>getInstance(String)</code></a> implementation. See the <a href="#getFormatClassNames()"><code>getFormatClassNames()</code></a> JavaDoc for more
information.
<h3>Efficiency</h3>
Populating this map will be more efficient than configuring <a href="#getSearchPackages()"><code>searchPackages</code></a>,
but search packages may be more convenient depending on the number of <code>HashFormat</code> implementations that
need to be supported by this factory.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>formatClassNames</code> - the <code>hash-format-alias</code>-to-<code>fullyQualifiedHashFormatClassNameImplementation</code>
map to be used in the <a href="#getInstance(java.lang.String)"><code>getInstance(String)</code></a> implementation.</dd>
</dl>
</li>
</ul>
<a id="getSearchPackages()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSearchPackages</h4>
<pre class="methodSignature">public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink">Set</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&gt;&nbsp;<a href="../../../../../../src-html/org/apache/shiro/crypto/hash/format/DefaultHashFormatFactory.html#line.96">getSearchPackages</a>()</pre>
<div class="block">Returns a set of package names that can be searched for <a href="HashFormat.html" title="interface in org.apache.shiro.crypto.hash.format"><code>HashFormat</code></a> implementations according to
heuristics defined in the <a href="#getHashFormatClass(java.lang.String,java.lang.String)"><code>getHashFormat(packageName, token)</code></a> JavaDoc.
<h3>Efficiency</h3>
Configuring this property is not as efficient as configuring a <a href="#getFormatClassNames()"><code>formatClassNames</code></a>
map, but it may be more convenient depending on the number of <code>HashFormat</code> implementations that
need to be supported by this factory.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a set of package names that can be searched for <a href="HashFormat.html" title="interface in org.apache.shiro.crypto.hash.format"><code>HashFormat</code></a> implementations</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#getHashFormatClass(java.lang.String,java.lang.String)"><code>getHashFormatClass(String, String)</code></a></dd>
</dl>
</li>
</ul>
<a id="setSearchPackages(java.util.Set)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSearchPackages</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/shiro/crypto/hash/format/DefaultHashFormatFactory.html#line.110">setSearchPackages</a>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink">Set</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&gt;&nbsp;searchPackages)</pre>
<div class="block">Sets a set of package names that can be searched for <a href="HashFormat.html" title="interface in org.apache.shiro.crypto.hash.format"><code>HashFormat</code></a> implementations according to
heuristics defined in the <a href="#getHashFormatClass(java.lang.String,java.lang.String)"><code>getHashFormat(packageName, token)</code></a> JavaDoc.
<h3>Efficiency</h3>
Configuring this property is not as efficient as configuring a <a href="#getFormatClassNames()"><code>formatClassNames</code></a>
map, but it may be more convenient depending on the number of <code>HashFormat</code> implementations that
need to be supported by this factory.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>searchPackages</code> - a set of package names that can be searched for <a href="HashFormat.html" title="interface in org.apache.shiro.crypto.hash.format"><code>HashFormat</code></a> implementations</dd>
</dl>
</li>
</ul>
<a id="getInstance(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getInstance</h4>
<pre class="methodSignature">public&nbsp;<a href="HashFormat.html" title="interface in org.apache.shiro.crypto.hash.format">HashFormat</a>&nbsp;<a href="../../../../../../src-html/org/apache/shiro/crypto/hash/format/DefaultHashFormatFactory.html#line.114">getInstance</a>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;in)</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="HashFormatFactory.html#getInstance(java.lang.String)">getInstance</a></code>&nbsp;in interface&nbsp;<code><a href="HashFormatFactory.html" title="interface in org.apache.shiro.crypto.hash.format">HashFormatFactory</a></code></dd>
</dl>
</li>
</ul>
<a id="getHashFormatClass(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getHashFormatClass</h4>
<pre class="methodSignature">protected&nbsp;<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="externalLink">Class</a>&nbsp;<a href="../../../../../../src-html/org/apache/shiro/crypto/hash/format/DefaultHashFormatFactory.html#line.182">getHashFormatClass</a>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;token)</pre>
<div class="block">Heuristically determine the fully qualified HashFormat implementation class name based on the specified
token.
<p/>
This implementation functions as follows (in order):
<ol>
<li>See if the argument can be used as a lookup key in the <a href="#getFormatClassNames()"><code>formatClassNames</code></a>
map. If a value (a fully qualified class name <a href="HashFormat.html" title="interface in org.apache.shiro.crypto.hash.format"><code>HashFormat</code></a> implementation) is found,
<a href="../../../util/ClassUtils.html#forName(java.lang.String)"><code>lookup</code></a> the class and return it.</li>
<li>
Check to see if the token argument is a
<a href="ProvidedHashFormat.html" title="enum in org.apache.shiro.crypto.hash.format"><code>ProvidedHashFormat</code></a> enum value. If so, acquire the corresponding <code>HashFormat</code> class and
return it.
</li>
<li>
Check to see if the token argument is itself a fully qualified class name. If so, try to load the class
and return it.
</li>
<li>If the above options do not result in a discovered class, search all all configured
<a href="#getSearchPackages()"><code>searchPackages</code></a> using heuristics defined in the
<a href="#getHashFormatClass(java.lang.String,java.lang.String)"><code>getHashFormatClass(packageName, token)</code></a> method documentation
(relaying the <code>token</code> argument to that method for each configured package).
</li>
</ol>
<p/>
If a class is not discovered via any of the above means, <code>null</code> is returned to indicate the class
could not be found.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>token</code> - the string token from which a class name will be heuristically determined.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the discovered HashFormat class implementation or <code>null</code> if no class could be heuristically determined.</dd>
</dl>
</li>
</ul>
<a id="getHashFormatClass(java.lang.String,java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getHashFormatClass</h4>
<pre class="methodSignature">protected&nbsp;<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="externalLink">Class</a>&nbsp;<a href="../../../../../../src-html/org/apache/shiro/crypto/hash/format/DefaultHashFormatFactory.html#line.281">getHashFormatClass</a>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;packageName,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;token)</pre>
<div class="block">Heuristically determine the fully qualified <code>HashFormat</code> implementation class name in the specified
package based on the provided token.
<p/>
The token is expected to be a relevant fragment of an unqualified class name in the specified package.
A 'relevant fragment' can be one of the following:
<ul>
<li>The <code>HashFormat</code> implementation unqualified class name</li>
<li>The prefix of an unqualified class name ending with the text <code>Format</code>. The first character of
this prefix can be upper or lower case and both options will be tried.</li>
<li>The prefix of an unqualified class name ending with the text <code>HashFormat</code>. The first character of
this prefix can be upper or lower case and both options will be tried.</li>
<li>The prefix of an unqualified class name ending with the text <code>CryptoFormat</code>. The first character
of this prefix can be upper or lower case and both options will be tried.</li>
</ul>
<p/>
Some examples:
<table>
<tr>
<th>Package Name</th>
<th>Token</th>
<th>Expected Output Class</th>
<th>Notes</th>
</tr>
<tr>
<td><code>com.foo.whatever</code></td>
<td><code>MyBarFormat</code></td>
<td><code>com.foo.whatever.MyBarFormat</code></td>
<td>Token is a complete unqualified class name</td>
</tr>
<tr>
<td><code>com.foo.whatever</code></td>
<td><code>Bar</code></td>
<td><code>com.foo.whatever.BarFormat</code> <em>or</em> <code>com.foo.whatever.BarHashFormat</code> <em>or</em>
<code>com.foo.whatever.BarCryptFormat</code></td>
<td>The token is only part of the unqualified class name - i.e. all characters in front of the <code>*Format</code>
<code>*HashFormat</code> or <code>*CryptFormat</code> suffix. Note that the <code>*Format</code> variant will be tried before
<code>*HashFormat</code> and then finally <code>*CryptFormat</code></td>
</tr>
<tr>
<td><code>com.foo.whatever</code></td>
<td><code>bar</code></td>
<td><code>com.foo.whatever.BarFormat</code> <em>or</em> <code>com.foo.whatever.BarHashFormat</code> <em>or</em>
<code>com.foo.whatever.BarCryptFormat</code></td>
<td>Exact same output as the above <code>Bar</code> input example. (The token differs only by the first character)</td>
</tr>
</table></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>packageName</code> - the package to search for matching <code>HashFormat</code> implementations.</dd>
<dd><code>token</code> - the string token from which a class name will be heuristically determined.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the discovered HashFormat class implementation or <code>null</code> if no class could be heuristically determined.</dd>
</dl>
</li>
</ul>
<a id="lookupHashFormatClass(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>lookupHashFormatClass</h4>
<pre class="methodSignature">protected&nbsp;<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="externalLink">Class</a>&nbsp;<a href="../../../../../../src-html/org/apache/shiro/crypto/hash/format/DefaultHashFormatFactory.html#line.333">lookupHashFormatClass</a>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;name)</pre>
</li>
</ul>
<a id="assertHashFormatImpl(java.lang.Class)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>assertHashFormatImpl</h4>
<pre class="methodSignature">protected final&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/shiro/crypto/hash/format/DefaultHashFormatFactory.html#line.342">assertHashFormatImpl</a>&#8203;(<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="externalLink">Class</a>&nbsp;clazz)</pre>
</li>
</ul>
<a id="newHashFormatInstance(java.lang.Class)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>newHashFormatInstance</h4>
<pre class="methodSignature">protected final&nbsp;<a href="HashFormat.html" title="interface in org.apache.shiro.crypto.hash.format">HashFormat</a>&nbsp;<a href="../../../../../../src-html/org/apache/shiro/crypto/hash/format/DefaultHashFormatFactory.html#line.350">newHashFormatInstance</a>&#8203;(<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="externalLink">Class</a>&nbsp;clazz)</pre>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/DefaultHashFormatFactory.html">Use</a></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" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses.html">All&nbsp;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>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small>Copyright &#169; 2004&#x2013;2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</body>
</html>