View Javadoc

1   // Copyright 2006-2007, by the California Institute of Technology.
2   // ALL RIGHTS RESERVED. United States Government Sponsorship acknowledged.
3   // Any commercial use must be negotiated with the Office of Technology Transfer
4   // at the California Institute of Technology.
5   //
6   // This software is subject to U. S. export control laws and regulations
7   // (22 C.F.R. 120-130 and 15 C.F.R. 730-774). To the extent that the software
8   // is subject to U.S. export control laws and regulations, the recipient has
9   // the responsibility to obtain export licenses or other export authority as
10  // may be required before exporting such information to foreign countries or
11  // providing access to foreign nationals.// Copyright 2006, by the California Institute of 
12  // Technology. ALL RIGHTS RESERVED. United States Government 
13  // Sponsorship acknowledged. Any commercial use must be negotiated with 
14  // the Office of Technology Transfer at the California Institute of 
15  // Technology.
16  //
17  // This software may be subject to U.S. export control laws. By 
18  // accepting this software, the user agrees to comply with all 
19  // applicable U.S. export laws and regulations. User has the 
20  // responsibility to obtain export licenses, or other export authority 
21  // as may be required before exporting such information to foreign 
22  // countries or providing access to foreign persons.
23  //
24  // $Id: TypeChecker.java 2601 2007-04-12 18:34:25Z pramirez $ 
25  //
26  
27  package gov.nasa.pds.tools.dict.type;
28  
29  /***
30   * @author pramirez
31   * @version $Revision: 2601 $
32   * 
33   */
34  public interface TypeChecker {
35      /***
36       * Trys to cast the value to the appropriate type and return the value
37       * @param value which must be cast
38       * @return value after it has been cast
39       * @throws InvalidTypeException thrown when value can not be cast
40       */
41      public Object cast(String value) throws InvalidTypeException;
42      
43      /***
44       * Checks to make sure that the value does fall below the minimum length
45       * length
46       * @param value to be checked
47       * @param min acts as the bound
48       * @throws InvalidLengthException thrown when value falls below minimum
49       */
50      public void checkMinLength(String value, int min) throws InvalidLengthException;
51      
52      /***
53       * Checks to make sure that the value does not exceed the maximu length
54       * @param value to be checked
55       * @param max acts as the bound
56       * @throws InvalidLengthException thrown when value exceeds maximum
57       */
58      public void checkMaxLength(String value, int max) throws InvalidLengthException;
59  }