Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.google.appengine.api.search
Class FieldChecker

    java.lang.Object
      com.google.appengine.api.search.FieldChecker

    public final class FieldChecker

extends java.lang.Object

Provides checks for Field names, language code, and values: text, HTML, atom or date.

Field Summary
`static java.lang.String` | `FIELD_NAME_PATTERN` The pattern each document field name should match.
`static int` | `MAXIMUM_ATOM_LENGTH` The maximum length of an atom.
`static int` | `MAXIMUM_NAME_LENGTH` The maximum length of a field name.
`static int` | `MAXIMUM_TEXT_LENGTH` The maximum length of a text or HTML.

Constructor Summary
`FieldChecker()`

Method Summary
`static java.lang.String` | `checkAtom(java.lang.String atom)` Checks whether an atom is valid.
`static java.util.Date` | `checkDate(java.util.Date date)` Checks whether a date is specified in ISO860 format.
`static java.lang.String` | `checkExpression(java.lang.String expression)` Checks whether expression is not null and is parsable.
`static java.lang.String` | `checkFieldName(java.lang.String name)` Checks whether a field name is valid.
`static java.lang.String` | `checkFieldName(java.lang.String name, java.lang.String fieldName)` Checks whether a field name is valid.
`static java.lang.String` | `checkHTML(java.lang.String html)` Checks whether a html is valid.
`static java.lang.String` | `checkText(java.lang.String text)` Checks whether a text is valid.

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

Field Detail

### MAXIMUM_NAME_LENGTH

    public static final int MAXIMUM_NAME_LENGTH

  The maximum length of a field name.

  See Also:
    Constant Field Values

### MAXIMUM_TEXT_LENGTH

    public static final int MAXIMUM_TEXT_LENGTH

  The maximum length of a text or HTML.

  See Also:
    Constant Field Values

### MAXIMUM_ATOM_LENGTH

    public static final int MAXIMUM_ATOM_LENGTH

  The maximum length of an atom.

  See Also:
    Constant Field Values

### FIELD_NAME_PATTERN

    public static final java.lang.String FIELD_NAME_PATTERN

  The pattern each document field name should match.

  See Also:
    Constant Field Values

Constructor Detail

### FieldChecker

    public FieldChecker()

Method Detail

### checkFieldName

    public static java.lang.String checkFieldName(java.lang.String name)

  Checks whether a field name is valid. The field name length must be between 1 and `Field.MAXIMUM_NAME_LENGTH` and it should match `FIELD_NAME_PATTERN`.

  Parameters:
    `name` - the field name to check
  Returns:
    the checked field name
  Throws:
    `java.lang.IllegalArgumentException` - if the field name is null or empty or is longer than Field.MAXIMUM_NAME_LENGTH or it doesn't match #FIELD_NAME_PATTERN.

### checkFieldName

    public static java.lang.String checkFieldName(java.lang.String name,
                                                  java.lang.String fieldName)

  Checks whether a field name is valid. The field name length must be between 1 and `Field.MAXIMUM_NAME_LENGTH` and it should match `FIELD_NAME_PATTERN`.

  Parameters:
    `name` - the field name to check
    `fieldName` - the name of the Java field name of the class where name is checked
  Returns:
    the checked field name
  Throws:
    `java.lang.IllegalArgumentException` - if the field name is null or empty or is longer than Field.MAXIMUM_NAME_LENGTH or it doesn't match #FIELD_NAME_PATTERN.

### checkText

    public static java.lang.String checkText(java.lang.String text)

  Checks whether a text is valid. A text can be null, or a string between 0 and Field.MAXIMUM_TEXT_LENGTH in length.

  Parameters:
    `text` - the text to check
  Returns:
    the checked text
  Throws:
    `java.lang.IllegalArgumentException` - if text is too long

### checkHTML

    public static java.lang.String checkHTML(java.lang.String html)

  Checks whether a html is valid. A html can be null or a string between 0 and Field.MAXIMUM_TEXT_LENGTH in length.

  Parameters:
    `html` - the html to check
  Returns:
    the checked html
  Throws:
    `java.lang.IllegalArgumentException` - if html is too long

### checkAtom

    public static java.lang.String checkAtom(java.lang.String atom)

  Checks whether an atom is valid. An atom can be null or a string between 1 and Field.MAXIMUM_ATOM_LENGTH in length.

  Parameters:
    `atom` - the atom to check
  Returns:
    the checked atom
  Throws:
    `java.lang.IllegalArgumentException` - if atom is too long

### checkDate

    public static java.util.Date checkDate(java.util.Date date)
                                    throws java.lang.IllegalArgumentException

  Checks whether a date is specified in ISO860 format. Date is nullable.

  Parameters:
    `date` - the date to check
  Returns:
    the checked date
  Throws:
    `java.lang.IllegalArgumentException` - if date has a time component

### checkExpression

    public static java.lang.String checkExpression(java.lang.String expression)

  Checks whether expression is not null and is parsable.

  Parameters:
    `expression` - the expression to check
  Returns:
    the checked expression
  Throws:
    `java.lang.IllegalArgumentException` - if the expression is null, or cannot be parsed

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD