# DocumentChecker
Date: 2012-02-24

## com.google.appengine.api.search.checkers
Class DocumentChecker

    java.lang.Object
      com.google.appengine.api.search.checkers.DocumentChecker

    public final class DocumentChecker

extends java.lang.Object

Checks values of a Document.

Field Summary
`static int` `MAXIMUM_DOCUMENT_ID_LENGTH` The maximum length of a document id.
`static int` `MAXIMUM_DOCUMENT_LENGTH`

Constructor Summary
`DocumentChecker()`

Method Summary
`static java.lang.String` `checkDocumentId(java.lang.String documentId)` Checks whether a document id is valid.
`static DocumentPb.Document` `checkValid(DocumentPb.Document pb)` Checks whether a `DocumentPb.Document` has a valid set of fields.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### MAXIMUM_DOCUMENT_ID_LENGTH

    public static final int MAXIMUM_DOCUMENT_ID_LENGTH

  The maximum length of a document id.

  See Also:
    Constant Field Values

### MAXIMUM_DOCUMENT_LENGTH

    public static final int MAXIMUM_DOCUMENT_LENGTH

See Also:
  Constant Field Values

Constructor Detail

### DocumentChecker

    public DocumentChecker()

Method Detail

### checkDocumentId

    public static java.lang.String checkDocumentId(java.lang.String documentId)

  Checks whether a document id is valid. A document id is a non-null ASCII visible printable string of #MAXIMUM_DOCUMENT_ID_LENGTH characters which does not start with '!' which is reserved for system documents.

  Parameters:
    `documentId` - the document id to check
  Returns:
    the checked document id

### checkValid

    public static DocumentPb.Document checkValid(DocumentPb.Document pb)

  Checks whether a `DocumentPb.Document` has a valid set of fields.

  Parameters:
    `pb` - the `DocumentPb.Document` protocol buffer to check
  Returns:
    the checked document
  Throws:
    `java.lang.IllegalArgumentException` - if some field is invalid such as document id or fields