Package com.iizix.prop
Class PropVerification
- java.lang.Object
- com.iizix.prop.PropVerification
- All Implemented Interfaces:
IKStringInfoProviderHolder
public final class PropVerification extends java.lang.Object implements IKStringInfoProviderHolder
Class used to hold information about errors of the property container verification process.- Author:
- Christopher Mindus
Field Summary
Fields Modifier and Type Field Description static PropVerificationError[]EMPTYEmpty list of errors.static java.lang.StringERROR_IDVerification error ID in the error property of the owner ("com.iizix.prop.verify").
Constructor Summary
Constructors Constructor Description PropVerification(IKStringInfoProvider provider)Creates the verification instance.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(PropVerificationError error)Adds an error.booleanadd(PropVerificationError error, boolean ignoreDups)Adds an error.PropVerificationError[]getErrors()Gets the list of errors.PropVerificationError[]getErrors(GProp<?> property)Gets the list of errors of a property.IKStringInfoProvidergetKStringInfoProvider()Gets the KString information provider used for e.g.booleanhasErrors()Checks if the verification list contains errors.
Field Detail
EMPTY
public static final PropVerificationError[] EMPTY
Empty list of errors.
ERROR_ID
public static final java.lang.String ERROR_ID
Verification error ID in the error property of the owner ("com.iizix.prop.verify").- See Also:
- Constant Field Values
Constructor Detail
PropVerification
public PropVerification(IKStringInfoProvider provider)
Creates the verification instance.- Parameters:
provider- Specifies the KString information provider.- Throws:
java.lang.NullPointerException- Ifproviderisnull.
Method Detail
getKStringInfoProvider
public IKStringInfoProvider getKStringInfoProvider()
Gets the KString information provider used for e.g. resolving KString's.- Specified by:
getKStringInfoProviderin interfaceIKStringInfoProviderHolder- Returns:
- The provider, never
null.
add
public void add(PropVerificationError error)
Adds an error.- Parameters:
error- The error.- Throws:
java.lang.InternalError- if the error ID already has been added for the property.
add
public boolean add(PropVerificationError error, boolean ignoreDups)
Adds an error.- Parameters:
error- The error.ignoreDups- Ignores duplicates.- Returns:
- true if added, false if ignored (already added).
- Throws:
java.lang.InternalError- if the error ID already has been added for the property andignoreDupsis false.
getErrors
public PropVerificationError[] getErrors()
Gets the list of errors.- Returns:
- The list of errors.
getErrors
public PropVerificationError[] getErrors(GProp<?> property)
Gets the list of errors of a property.- Parameters:
property- The property.- Returns:
- The list of errors.
hasErrors
public boolean hasErrors()
Checks if the verification list contains errors.- Returns:
- true if errors are present, false otherwise.