@DoNotObfuscate
public final class SingleFieldValidator
extends com.pdfunit.validators.AbstractValidator
Type | Property and Description |
---|---|
FieldPropertyValidator |
with
This method prepares the validator to check field properties.
|
Modifier | Constructor and Description |
---|---|
protected |
SingleFieldValidator(com.pdfunit.validators.AbstractValidator validator,
org.apache.commons.collections4.multimap.ArrayListValuedHashMap<java.lang.String,com.pdfunit.internal.spi.IField> allFields) |
protected |
SingleFieldValidator(DocumentValidator documentValidator)
Creating a validator for a single field of an acro form in PDF documents.
|
Modifier and Type | Method and Description |
---|---|
SingleFieldValidator |
containing(java.lang.String expectedContent)
Validating that the content of the current field contains the value given by the parameter.
|
SingleFieldValidator |
endingWith(java.lang.String expectedEnd)
Validating that the content of the current field ends with the value given by the parameter.
|
SingleFieldValidator |
equalsTo(java.lang.String expectedValue)
Validating that the content of the current field is equal to the given parameter.
|
SingleFieldValidator |
hasField(java.lang.String expectedFieldName)
Verify that a field with the given name exists.
|
SingleFieldValidator |
matchingRegex(java.lang.String regex)
Validating that the content of the current field matches the regular expression.
|
SingleFieldValidator |
notContaining(java.lang.String notExpectedContent)
Validating that the content of the current field does NOT contain the value given by the parameter.
|
SingleFieldValidator |
notMatchingRegex(java.lang.String regex)
Validating that the content of the current field does not match the regular expression.
|
SingleFieldValidator |
ofType(FieldType expectedType)
This method checks the type of the current field.
|
SingleFieldValidator |
startingWith(java.lang.String expectedStart)
Validating that the content of the current field starts with the value given by the parameter.
|
SingleFieldValidator |
withHeight(int expectedHeight)
This method verifies that the current field has the width equals to the given parameter.
|
SingleFieldValidator |
withHeight(int expectedHeight,
FormatUnit formatUnit,
int allowedDelta)
This method verifies that the current field has the width equals to the given parameter.
|
SingleFieldJavaScriptValidator |
withJavaScript()
This method reads all JavaScript functions that are associated to the current field.
|
SingleFieldValidator |
withoutTextOverflow()
This method validates that the content of the current field fits inside
the size of the field.
|
FieldPropertyValidator |
withProperty()
This method prepares the validator to check field properties.
|
SingleFieldValidator |
withText()
This method checks whether a field has any text.
|
SingleFieldValidator |
withWidth(int expectedWidth)
This method verifies that the current field has the width equals to the given parameter.
|
SingleFieldValidator |
withWidth(int expectedWidth,
FormatUnit formatUnit,
int allowedDelta)
This method verifies that the current field has the width equals to the given parameter.
|
protected SingleFieldValidator(DocumentValidator documentValidator)
protected SingleFieldValidator(com.pdfunit.validators.AbstractValidator validator, org.apache.commons.collections4.multimap.ArrayListValuedHashMap<java.lang.String,com.pdfunit.internal.spi.IField> allFields)
@Guarded public SingleFieldValidator containing(java.lang.String expectedContent)
@Guarded public SingleFieldValidator endingWith(java.lang.String expectedEnd)
@Guarded public SingleFieldValidator hasField(java.lang.String expectedFieldName)
When the field not exists, an instance of PDFUnitValidationException or a subclass of it will be thrown.
@Guarded public SingleFieldValidator equalsTo(java.lang.String expectedValue)
@Guarded public SingleFieldValidator matchingRegex(java.lang.String regex)
@Guarded public SingleFieldValidator notContaining(java.lang.String notExpectedContent)
@Guarded public SingleFieldValidator notMatchingRegex(java.lang.String regex)
@Guarded public SingleFieldValidator ofType(FieldType expectedType)
FieldType
@Guarded public SingleFieldValidator startingWith(java.lang.String expectedStart)
@Guarded public SingleFieldValidator withHeight(int expectedHeight)
@Guarded public SingleFieldValidator withHeight(int expectedHeight, FormatUnit formatUnit, int allowedDelta)
FormatUnit
public SingleFieldJavaScriptValidator withJavaScript()
public FieldPropertyValidator withProperty()
public SingleFieldValidator withText()
@Guarded public SingleFieldValidator withWidth(int expectedWidth)
@Guarded public SingleFieldValidator withWidth(int expectedWidth, FormatUnit formatUnit, int allowedDelta)
FormatUnit
public SingleFieldValidator withoutTextOverflow()
Only fields of type "button" and "text" are checked, no "choice" and no "sig". Also password fields are not checked.
Copyright (C) PDFUnit.com. See here for license.