|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiz.c24.io.api.data.DefaultValidationRule
biz.c24.io.api.data.swift.SwiftQualifierValidator
public class SwiftQualifierValidator
Validator to check the presence and repetitivness of SWIFT qualifiers in generic fields.
This validation is based on the arrays of qualifier values with their associated repetitive and usages restrictions.
The repetitive value will be true / false depending on whether the qualifier can be repeated.
The usage value will be one of QualifierUsageEnum.MANDATORY
, QualifierUsageEnum.OPTIONAL
, QualifierUsageEnum.OR
depending on whether the qualifier is
optional, mandatory or in a mutually exclusive group respectivley.
Constructor Summary | |
---|---|
SwiftQualifierValidator()
Creates a new instance. |
|
SwiftQualifierValidator(String elementName,
String[] qualifierArr,
char[][] optionArr,
boolean[] repetitiveArr,
QualifierUsageEnum[] usageArr)
Creates a new instance with specified qualifiers and restrictions. |
Method Summary | |
---|---|
String |
getElementName()
Returns the name of the element to which this validator applies. |
char[] |
getOptions(int index)
Returns a copy of the array of options allowed for the qualifier at index . |
String |
getQualifier(int index)
Returns the qualifier value at index . |
int |
getQualifierCount()
Returns the number of unique qualifier values allowed. |
QualifierUsageEnum |
getUsage(int index)
Returns the usage restriction for the qualifier at index . |
boolean |
isRepetitive(int index)
Returns whether the qualifier at index can repeat. |
boolean |
validate(Object object,
DataComponent component,
ComplexDataObject context,
ValidationManager manager)
Validate the given object. |
Methods inherited from class biz.c24.io.api.data.DefaultValidationRule |
---|
addDependentPredicateCode, getAnnotation, getContextForPredicateChecking, getDependentPredicateCode, getDependentPredicateCodeCount, getErrorCode, getName, getPredicateCode, getSeverity, removeDependentPredicateCode, setAnnotation, setErrorCode, setName, setPredicateCode, setSeverity, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SwiftQualifierValidator()
public SwiftQualifierValidator(String elementName, String[] qualifierArr, char[][] optionArr, boolean[] repetitiveArr, QualifierUsageEnum[] usageArr)
elementName
- The name of the generic SWIFT field.optionArr
- The array of option letters.qualifierArr
- The array of qualifiers.repetitiveArr
- The array of repetitive restrictions.usageArr
- The array of usage restrictions.Method Detail |
---|
public String getElementName()
public int getQualifierCount()
public String getQualifier(int index)
index
.
index
- The index.
ArrayIndexOutOfBoundsException
- If index
is greater than or equal to getQualifierCount()
public char[] getOptions(int index)
index
.This methods preserves the immutability of this class by returning a cloned array. Care should therefore be taken to use the cached result of one invocation where possible.
index
- The index to be returned.
ArrayIndexOutOfBoundsException
- If index
is greater than or equal to getQualifierCount()
public boolean isRepetitive(int index)
index
can repeat.
index
- The index to be returned.
ArrayIndexOutOfBoundsException
- If index
is greater than or equal to getQualifierCount()
public QualifierUsageEnum getUsage(int index)
index
.
index
- The index to be returned.
ArrayIndexOutOfBoundsException
- If index
is greater than or equal to getQualifierCount()
public boolean validate(Object object, DataComponent component, ComplexDataObject context, ValidationManager manager) throws ValidationException
Validator
validate
in interface Validator
validate
in class DefaultValidationRule
object
- The object to be validated - commonly a String, Integer, Double, Date etc.component
- The Element
or Attribute
inside context
which defines object
.context
- The parent of object
- could be null
.manager
- The validation manager which is performing this validation.
ValidationException
- If the object is not valid and the validation maanger is operating in exception mode.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |