View Javadoc

1   /*
2    * Copyright 2003,2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  /*
17   * This source code implements specifications defined by the Java
18   * Community Process. In order to remain compliant with the specification
19   * DO NOT add / change / or delete method signatures!
20   */
21  package javax.portlet;
22  
23  
24  /***
25   * The <CODE>PreferencesValidator</CODE> allows to validate the set of
26   * preferences of the associated portlet just before they are
27   * stored in the persistent store.
28   * <p>
29   * The portlet container invokes the <code>validate</code> method as 
30   * part of the invocation of the <code>store</code> method of the
31   * <code>PortletPreferences</code>.
32   */
33  public interface PreferencesValidator
34  {
35  
36  
37    /***
38     * If the preferences values are successfully validated the call to this method
39     * must finish gracefully. Otherwise it must throw a <code>ValidatorException</code>.
40     *
41     * @param  preferences   preferences to validate
42     *
43     * @throws  ValidatorException  if the given preferences contains invalid
44     *                              settings
45     *
46     */
47  
48    public void validate(PortletPreferences preferences)
49      throws ValidatorException;  
50  }