Class MetisFieldValidation
java.lang.Object
io.github.tonywasher.joceanus.metis.field.MetisFieldValidation
- All Implemented Interfaces:
MetisDataItem.MetisDataObjectFormat,MetisFieldItem
Records errors relating to an item.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classrepresents an instance of an error for an object.Nested classes/interfaces inherited from interface io.github.tonywasher.joceanus.metis.field.MetisFieldItem
MetisFieldItem.MetisFieldDef, MetisFieldItem.MetisFieldItemType, MetisFieldItem.MetisFieldSetDef, MetisFieldItem.MetisFieldTableItem, MetisFieldItem.MetisFieldUpdatableItem, MetisFieldItem.MetisFieldVersionedDef -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddError(String pText, MetisDataItem.MetisDataFieldId pField) add error to the list.voidClear errors.voidendErrors(StringBuilder pErrors) End error text.formatObject(OceanusDataFormatter pFormatter) Obtain Object summary.Obtain the fieldSet.Get the error details for a particular field.getFieldErrors(MetisFieldItem.MetisFieldDef[] aFields) Get the error text for fields outside a set of fields.getFirst()Get the first error in the list.booleanDo we have any errors?booleanDetermine whether there are any errors for a particular field.
-
Constructor Details
-
MetisFieldValidation
public MetisFieldValidation()Constructor.
-
-
Method Details
-
getDataFieldSet
Description copied from interface:MetisFieldItemObtain the fieldSet.- Specified by:
getDataFieldSetin interfaceMetisFieldItem- Returns:
- the fieldSet
-
formatObject
Description copied from interface:MetisDataItem.MetisDataObjectFormatObtain Object summary.- Specified by:
formatObjectin interfaceMetisDataItem.MetisDataObjectFormat- Parameters:
pFormatter- the data formatter- Returns:
- the display summary of the object
-
hasErrors
public boolean hasErrors()Do we have any errors?- Returns:
- true/false
-
getFirst
Get the first error in the list.- Returns:
- the first error or
null
-
addError
add error to the list.- Parameters:
pText- the text for the errorpField- the field for the error
-
hasErrors
Determine whether there are any errors for a particular field.- Parameters:
pField- - the field- Returns:
trueif there are any errorsfalseotherwise
-
getFieldErrors
Get the error details for a particular field.- Parameters:
pField- - the field- Returns:
- the error text
-
getFieldErrors
Get the error text for fields outside a set of fields.- Parameters:
aFields- the set of fields- Returns:
- the error text
-
endErrors
End error text.- Parameters:
pErrors- the error builder
-
clearErrors
public void clearErrors()Clear errors.
-