blob: 598f8734f270daeaa1a8fabb93788d937f1d2b82 [file] [log] [blame]
<?xml version="1.0"?>
<!--
Copyright 2005 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<module id="tapestry.form.validator" version="4.0.0" package="org.apache.tapestry.form.validator">
Support for input field validators.
<configuration-point id="Validators">
<schema>
<element name="validator" key-attribute="name">
<attribute name="name"/>
<attribute name="configurable" translator="boolean,default=true">
If true (the default), then the validator should have a property with the same name
which must be configured.
</attribute>
<attribute name="class" translator="class" required="true">
The class which implements the Validator interface, and has a public no-arguments
constructor.
</attribute>
<conversion class="ValidatorContribution">
<map attribute="class" property="validatorClass"/>
</conversion>
</element>
</schema>
</configuration-point>
<contribution configuration-id="Validators">
<validator name="email" configurable="false" class="Email"/>
<validator name="required" configurable="false" class="Required"/>
<validator name="max" class="Max"/>
<validator name="maxDate" class="MaxDate"/>
<validator name="maxLength" class="MaxLength"/>
<validator name="min" class="Min"/>
<validator name="minDate" class="MinDate"/>
<validator name="minLength" class="MinLength"/>
<validator name="pattern" class="Pattern"/>
<validator name="match" class="Identity"/>
<validator name="differ" class="Identity"/>
</contribution>
<service-point id="ValidatorFactory">
<invoke-factory>
<construct class="ValidatorFactoryImpl">
<set-configuration property="validators" configuration-id="Validators"/>
</construct>
</invoke-factory>
</service-point>
<service-point id="ValidatorsBindingFactory" interface="org.apache.tapestry.binding.BindingFactory">
Factory for the "translator:" binding prefix.
<invoke-factory>
<construct class="ValidatorsBindingFactory">
<set-service property="validatorFactory" service-id="ValidatorFactory"/>
<set-object property="valueConverter" value="infrastructure:valueConverter"/>
</construct>
</invoke-factory>
</service-point>
<contribution configuration-id="tapestry.bindings.BindingFactories">
<binding prefix="validators" service-id="ValidatorsBindingFactory"/>
</contribution>
</module>