View Javadoc

1   /*
2    *******************************************************************************
3    * Copyright (c) 2005 Chris Rose and AIMedia
4    * All rights reserved. DatasourceValidator and the accompanying materials
5    * are made available under the terms of the Common Public License v1.0
6    * which accompanies this distribution, and is available at
7    * http://www.eclipse.org/legal/cpl-v10.html
8    * 
9    * Contributors:
10   *     Chris Rose
11   *******************************************************************************/
12  package ca.spaz.cron.config;
13  
14  public final class DatasourceValidator implements PropertyValidator {
15     
16     private DatasourceValidator() {
17        // NO-OP
18     }
19     
20     private static final DatasourceValidator instance = new DatasourceValidator();
21  
22     public boolean isValid(String key, String value) {
23        if (key.startsWith("datasource.") || key.startsWith("db.")) {
24           return false;
25        }
26        return true;
27     }
28     
29     public boolean equals(Object o) {
30        return (null != o && o.getClass() == this.getClass());
31     }
32     
33     public static final DatasourceValidator getInstance() {
34        return instance;
35     }
36  
37  }