biz.c24.io.api.data.target2
Class TARGET2Validator

java.lang.Object
  extended by biz.c24.io.api.data.DefaultValidationRule
      extended by biz.c24.io.api.data.target2.TARGET2Validator
All Implemented Interfaces:
Enumeration, ModelComponent, ValidationRule, Validator, Serializable

public class TARGET2Validator
extends DefaultValidationRule
implements Enumeration

A class for parsing Target2 data.

This class uses the System property Utils.SYSTEM_PROPERTY_TARGET2_FILE to locate the source of the enumeration.

See Also:
Serialized Form

Constructor Summary
TARGET2Validator()
           
 
Method Summary
 Target2Directory get(int index)
           
 Annotation getAnnotation()
          Returns the annotation associated with this rule.
 Annotation getAnnotation(int index)
          Returns the annotation associated with the enumeration value at index.
 int getCount()
          Returns the number of enumeration values.
 ArrayList getEntries()
           
 int getIndex(String bicCode)
          Returns the first index of value or -1 if it was not found.
 String getName()
          Returns the name of this component.
 String getName(int index)
          Returns the name associated with the enumeration value at index.
 String getValue(int index)
          Returns the enumeration value at index.
static void init()
          Reinitializes the validator from the system property.
static Target2Directory parseLine(String line)
           
 String removeLogicalTerminalCodeFromBic(String bic)
           
 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, getContextForPredicateChecking, getDependentPredicateCode, getDependentPredicateCodeCount, getErrorCode, 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
 
Methods inherited from interface biz.c24.io.api.data.Enumeration
getErrorCode
 

Constructor Detail

TARGET2Validator

public TARGET2Validator()
Method Detail

init

public static void init()
Reinitializes the validator from the system property.

Use this method if you change the system property setting during the invocation of the JVM.


parseLine

public static Target2Directory parseLine(String line)
                                  throws Exception
Throws:
Exception

getAnnotation

public Annotation getAnnotation()
Description copied from interface: ValidationRule
Returns the annotation associated with this rule.

Specified by:
getAnnotation in interface Enumeration
Specified by:
getAnnotation in interface ValidationRule
Overrides:
getAnnotation in class DefaultValidationRule
Returns:
The annotation

getIndex

public int getIndex(String bicCode)
Description copied from interface: Enumeration
Returns the first index of value or -1 if it was not found.

Specified by:
getIndex in interface Enumeration
Parameters:
bicCode - The value to look for.
Returns:
The index of the first occurance of value or -1 if it was not found.

getCount

public int getCount()
Description copied from interface: Enumeration
Returns the number of enumeration values.

Specified by:
getCount in interface Enumeration
Returns:
The number of values.

getValue

public String getValue(int index)
Description copied from interface: Enumeration
Returns the enumeration value at index.

Specified by:
getValue in interface Enumeration
Parameters:
index - The index of the value to return.
Returns:
The value at index.

get

public Target2Directory get(int index)

getName

public String getName(int index)
Description copied from interface: Enumeration
Returns the name associated with the enumeration value at index.

Specified by:
getName in interface Enumeration
Parameters:
index - The index of the name to return.
Returns:
The name at index.

getAnnotation

public Annotation getAnnotation(int index)
Description copied from interface: Enumeration
Returns the annotation associated with the enumeration value at index.

Specified by:
getAnnotation in interface Enumeration
Parameters:
index - The index of the annotation to return.
Returns:
The name at index.

validate

public boolean validate(Object object,
                        DataComponent component,
                        ComplexDataObject context,
                        ValidationManager manager)
                 throws ValidationException
Description copied from interface: Validator
Validate the given object.

Specified by:
validate in interface Validator
Overrides:
validate in class DefaultValidationRule
Parameters:
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.
Returns:
Whether the object is valid if the validation manager is not operating in exception mode.
Throws:
ValidationException - If the object is not valid and the validation maanger is operating in exception mode.

removeLogicalTerminalCodeFromBic

public String removeLogicalTerminalCodeFromBic(String bic)

getName

public String getName()
Description copied from interface: ModelComponent
Returns the name of this component.

Specified by:
getName in interface ModelComponent
Overrides:
getName in class DefaultValidationRule
Returns:
The name.

getEntries

public ArrayList getEntries()


C24 Technologies © 2002-2012: All Rights Reserved.