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.
12  //
13  // $Id: DataObjectValidator.java 2606 2007-04-18 19:35:09Z pramirez $ 
14  //
15  
16  package gov.nasa.pds.tools.label.validate;
17  
18  import gov.nasa.pds.tools.label.ObjectStatement;
19  import gov.nasa.pds.tools.label.parser.InvalidDescriptionException;
20  import gov.nasa.pds.tools.label.parser.InvalidObjectException;
21  import gov.nasa.pds.tools.object.io.DataObjectInputStream;
22  
23  /***
24   * @author pramirez
25   * @version $Revision: 2606 $
26   * 
27   */
28  public interface DataObjectValidator {
29      /***
30       * Validates the bytes in the object against the decription in the {@link ObjectStatement}
31       * @param input bytes of the data object
32       * @param object The description of the object consists of a set of attribute statements
33       * @throws InvalidObjectException if there is a problem with the bytes in accordance with the description
34       * @throws InvalidDescriptionException if the description is insuffcient for the validation to take place
35       */
36      public void validate(DataObjectInputStream input, ObjectStatement object) throws InvalidObjectException, InvalidDescriptionException;
37      
38  }