KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > excalibur > source > validity > NOPValidity


1 /*
2  * Copyright (C) The Apache Software Foundation. All rights reserved.
3  *
4  * This software is published under the terms of the Apache Software License
5  * version 1.1, a copy of which has been included with this distribution in
6  * the LICENSE.txt file.
7  */

8 package org.apache.avalon.excalibur.source.validity;
9
10 import org.apache.avalon.excalibur.source.SourceValidity;
11
12 /**
13  * A validation object which is always valid.
14  *
15  * @author <a HREF="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
16  * @version CVS $Revision: 1.2 $ $Date: 2001/12/17 13:20:57 $
17  */

18 public final class NOPValidity
19 implements SourceValidity {
20
21     public static final SourceValidity SHARED_INSTANCE = new NOPValidity();
22
23     /**
24      * Check if the component is still valid.
25      * If <code>false</code> is returned the isValid(SourceValidity) must be
26      * called afterwards!
27      */

28     public boolean isValid() {
29         return true;
30     }
31
32     public boolean isValid(SourceValidity newValidity) {
33         return newValidity instanceof NOPValidity;
34     }
35
36     public String JavaDoc toString() {
37         return "NOPValidity";
38     }
39
40 }
41
Popular Tags