com.itextpdf.text.zugferd.checkers.basic
Class CountryCode

java.lang.Object
  extended by com.itextpdf.text.zugferd.checkers.CodeValidation
      extended by com.itextpdf.text.zugferd.checkers.basic.CountryCode

public class CountryCode
extends CodeValidation

Class that can be used to check if a country code is well-formed. IMPORTANT: this doesn't check if the code is valid in the sense that it doesn't check the code against a list of countries.


Constructor Summary
CountryCode()
           
 
Method Summary
 boolean isValid(String code)
          The code list provided with the ZUGFeRD standard only lists four codes: DE, FR, IT, and CN.
 
Methods inherited from class com.itextpdf.text.zugferd.checkers.CodeValidation
check, isLowercase, isNumeric, isUppercase
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CountryCode

public CountryCode()
Method Detail

isValid

public boolean isValid(String code)
The code list provided with the ZUGFeRD standard only lists four codes: DE, FR, IT, and CN. Obviously, there are more codes available (in ISO 3166-1 alpha-2). We won't check the presence of a code in ISO ISO 3166-1 alpha-2, but we'll check if the code consists of two letters and if it's uppercase.

Specified by:
isValid in class CodeValidation
Parameters:
code - the code to be tested
Returns:
true if the code has the correct format


Copyright © 2015. All Rights Reserved.