blob: 38b8165d58dbca6f0a0b6cc6e64716d3dbe3f008 [file] [log] [blame]
<!DOCTYPE html>
<!--
| Generated by Apache Maven Doxia Site Renderer 1.9.2 from xdocs/index.xml at 21 September 2021
| Rendered using Apache Maven Fluido Skin 1.9
-->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="generator" content="Apache Maven Doxia Site Renderer 1.9.2" />
<meta name="author" content="Eric Pugh" />
<title>Fulcrum Parser &#x2013; Parser Component</title>
<link rel="stylesheet" href="./css/apache-maven-fluido-1.9.min.css" />
<link rel="stylesheet" href="./css/site.css" />
<link rel="stylesheet" href="./css/print.css" media="print" />
<script src="./js/apache-maven-fluido-1.9.min.js"></script>
</head>
<body class="topBarDisabled">
<div class="container-fluid">
<header>
<div id="banner">
<div class="pull-left"><a href="https://turbine.apache.org/" id="bannerLeft" title="Apache Turbine"><img src="https://turbine.apache.org/images/turbine-project.png" alt="Apache Turbine"/></a></div>
<div class="pull-right"></div>
<div class="clear"><hr/></div>
</div>
<div id="breadcrumbs">
<ul class="breadcrumb">
<li id="publishDate">Last Published: 21 September 2021<span class="divider">|</span>
</li>
<li id="projectVersion">Version: 2.0.2-SNAPSHOT</li>
<li class="pull-right"><span class="divider">|</span>
<a href="https://turbine.apache.org/fulcrum/" class="externalLink" title="Fulcrum">Fulcrum</a></li>
<li class="pull-right"><span class="divider">|</span>
<a href="https://turbine.apache.org/" class="externalLink" title="Turbine">Turbine</a></li>
<li class="pull-right"><a href="https://www.apache.org" class="externalLink" title="Apache">Apache</a></li>
</ul>
</div>
</header>
<div class="row-fluid">
<header id="leftColumn" class="span2">
<nav class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">Overview</li>
<li class="active"><a href="#"><span class="none"></span>Main</a></li>
<li class="nav-header">Project Documentation</li>
<li><a href="project-info.html" title="Project Information"><span class="icon-chevron-down"></span>Project Information</a>
<ul class="nav nav-list">
<li><a href="dependencies.html" title="Dependencies"><span class="none"></span>Dependencies</a></li>
<li><a href="dependency-info.html" title="Dependency Information"><span class="none"></span>Dependency Information</a></li>
<li><a href="distribution-management.html" title="Distribution Management"><span class="none"></span>Distribution Management</a></li>
<li class="active"><a href="#"><span class="none"></span>About</a></li>
<li><a href="issue-management.html" title="Issue Management"><span class="none"></span>Issue Management</a></li>
<li><a href="licenses.html" title="Licenses"><span class="none"></span>Licenses</a></li>
<li><a href="mailing-lists.html" title="Mailing Lists"><span class="none"></span>Mailing Lists</a></li>
<li><a href="plugin-management.html" title="Plugin Management"><span class="none"></span>Plugin Management</a></li>
<li><a href="plugins.html" title="Plugins"><span class="none"></span>Plugins</a></li>
<li><a href="scm.html" title="Source Code Management"><span class="none"></span>Source Code Management</a></li>
<li><a href="summary.html" title="Summary"><span class="none"></span>Summary</a></li>
<li><a href="team.html" title="Team"><span class="none"></span>Team</a></li>
</ul></li>
<li><a href="project-reports.html" title="Project Reports"><span class="icon-chevron-right"></span>Project Reports</a></li>
<li class="nav-header">Apache</li>
<li><a href="https://www.apache.org/" class="externalLink" title="Apache Website"><span class="none"></span>Apache Website</a></li>
<li><a href="https://www.apache.org/licenses/" class="externalLink" title="License"><span class="none"></span>License</a></li>
<li><a href="https://www.apache.org/foundation/how-it-works.html" class="externalLink" title="How the ASF works"><span class="none"></span>How the ASF works</a></li>
<li><a href="https://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsorship"><span class="none"></span>Sponsorship</a></li>
<li><a href="https://www.apache.org/foundation/thanks.html" class="externalLink" title="Thanks"><span class="none"></span>Thanks</a></li>
<li><a href="https://www.apache.org/security/" class="externalLink" title="Security"><span class="none"></span>Security</a></li>
</ul>
</nav>
<div class="well sidebar-nav">
<hr />
<div id="poweredBy">
<div class="clear"></div>
<div class="clear"></div>
<div class="clear"></div>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
</div>
</div>
</header>
<main id="bodyColumn" class="span10" >
<section>
<h2><a name="Overview"></a>Overview</h2>
<p>
This Service functions as a repository for Parser components.
</p>
<p>
It is written
for use in Turbine but it can be used in any container compatible
with Avalon's ECM container.
</p>
</section>
<section>
<h2><a name="Configuration"></a>Configuration</h2>
<section>
<h3><a name="Role_Configuration"></a>Role Configuration</h3>
<div class="source"><pre class="prettyprint">
&lt;role
name=&quot;org.apache.fulcrum.parser.ParserService&quot;
shorthand=&quot;parser&quot;
default-class=&quot;org.apache.fulcrum.parser.DefaultParserService&quot;/&gt;
</pre></div>
</section>
<section>
<h3><a name="Component_Configuration"></a>Component Configuration</h3>
<table border="0" class="table table-striped">
<tr class="a">
<th>Item</th>
<th>Datatype</th>
<th>Cardinality</th>
<th>Description</th>
</tr>
<tr class="b">
<td>urlCaseFolding</td>
<td>String</td>
<td>[0|1]</td>
<td>
This setting controls how parameter names are to be folded during
processing. Valid values are <code>none</code> (no folding),
<code>upper</code> (all names upper case) and <code>lower</code>
(all names lower case). The default is <code>none</code>.
</td>
</tr>
<tr class="a">
<td>parameterEncoding</td>
<td>String</td>
<td>[0|1]</td>
<td>
The parameter encoding to use when converting strings to bytes or
vice versa. This encoding is used when no explicit encoding is specified.
This must be a valid encoding string for the JVM in use. The default is
<code>iso-8859-1</code>.
</td>
</tr>
<tr class="b">
<td>automaticUpload</td>
<td>boolean</td>
<td>[0|1]</td>
<td>
If set to <code>true</code>, parsing the multipart request for attachments
will be performed automatically. Otherwise, the request may be parsed manually
by calling <code>parseUpload(HttpServletRequest)</code>. The default value is
<code>false</code>. When set to true, the component must have the
<a class="externalLink" href="http://turbine.apache.org/fulcrum/fulcrum-upload/">Fulcrum Upload Service</a>
available to parse the request.
</td>
</tr>
<tr class="a">
<td>pool2</td>
<td>list</td>
<td>*</td>
<td>
Wrapper for commons pool2 parameters (child components) <code>maxTotal</code>with value -1 =no limit, other plausible values 1024, 2048.
<code>blockWhenExhausted</code> (by default <code>true</code>), <code>maxWaitMillis</code> by default <code>0</code>, <code>testOnBorrow</code>, <code>testOnCreate</code>, <code>testOnReturn</code>,<code>maxIdle</code> and <code>minIdle</code>.
The parameter values are the same as for commons.pool2,
compare the defaults (upper case and underscore-separated)
<a class="externalLink" href=" https://commons.apache.org/proper/commons-pool/apidocs/index.html">here </a>
look for org.apache.commons.pool2.impl.BaseObjectPoolConfig and BaseGenericObjectPool.
</td>
</tr>
</table>
</section>
<section>
<h3><a name="Component_Configuration_Example"></a>Component Configuration Example</h3>
<div class="source"><pre class="prettyprint">
&lt;parser&gt;
&lt;urlCaseFolding&gt;lower&lt;/urlCaseFolding&gt;
&lt;parameterEncoding&gt;utf-8&lt;/parameterEncoding&gt;
&lt;automaticUpload&gt;true&lt;/automaticUpload&gt;
&lt;pool2&gt;
&lt;maxTotal&gt;2048&lt;/maxTotal&gt;&lt;!-- default 8 --&gt;
&lt;blockWhenExhausted&gt;true&lt;/blockWhenExhausted&gt;&lt;!-- default is true --&gt;
&lt;maxWaitMillis&gt;350&lt;/maxWaitMillis&gt;&lt;!-- default is -1L --&gt;
&lt;/pool2&gt;
&lt;/parser&gt;
</pre></div>
</section>
</section>
<section>
<h2><a name="Usage"></a>Usage</h2>
<p>
You get a parser from the service like this:
</p>
<div class="source"><pre class="prettyprint">
ValueParser parser;
try
{
// Get a ValueParser instance
parser = parserService.getParser(BaseValueParser.class);
parser.add(...);
Double d = parser.getDoubleObject(...);
}
finally
{
// Return the instance to the service
if (parser != null)
{
parserService.putParser(parser);
}
}
</pre></div>
<p>
Parsers are pooled inside the service. You can use this service to manage any types of
parsers, you just need to provide the class you want to manage. If the parser class
implements LogEnabled it will get an (Avalon) logger injected. If the parser class
implements ParserServiceSupport it will get an instance of this service injected.
</p>
</section>
</main>
</div>
</div>
<hr/>
<footer>
<div class="container-fluid">
<div class="row-fluid">
<p>&#169; 2005&#x2013;2021
<a href="https://www.apache.org/">The Apache Software Foundation</a>
</p>
</div>
</div>
</footer>
</body>
</html>