Package com.mongodb.internal.validator
Class UpdateFieldNameValidator
- java.lang.Object
-
- com.mongodb.internal.validator.UpdateFieldNameValidator
-
- All Implemented Interfaces:
FieldNameValidator
public class UpdateFieldNameValidator extends java.lang.Object implements FieldNameValidator
A field name validator for update documents. It ensures that all top-level fields start with a '$'.This class should not be considered a part of the public API.
-
-
Constructor Summary
Constructors Constructor Description UpdateFieldNameValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldNameValidator
getValidatorForField(java.lang.String fieldName)
Gets a new validator to use for the value of the field with the given name.boolean
validate(java.lang.String fieldName)
Returns true if the field name is valid, false otherwise.
-
-
-
Method Detail
-
validate
public boolean validate(java.lang.String fieldName)
Description copied from interface:FieldNameValidator
Returns true if the field name is valid, false otherwise.- Specified by:
validate
in interfaceFieldNameValidator
- Parameters:
fieldName
- the field name- Returns:
- true if the field name is valid, false otherwise
-
getValidatorForField
public FieldNameValidator getValidatorForField(java.lang.String fieldName)
Description copied from interface:FieldNameValidator
Gets a new validator to use for the value of the field with the given name.- Specified by:
getValidatorForField
in interfaceFieldNameValidator
- Parameters:
fieldName
- the field name- Returns:
- a non-null validator
-
-