com.itextpdf.text.zugferd.checkers.basic
Class DateFormatCode
java.lang.Object
com.itextpdf.text.zugferd.checkers.CodeValidation
com.itextpdf.text.zugferd.checkers.basic.DateFormatCode
public class DateFormatCode
- extends CodeValidation
Class that can be used to check a code for a date format.
Additionally, this class also contains some methods that allow you
to convert dates to strings and vice-versa based on a given format.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
YYYYMMDD
public static final String YYYYMMDD
- See Also:
- Constant Field Values
YYYYMM
public static final String YYYYMM
- See Also:
- Constant Field Values
YYYYWW
public static final String YYYYWW
- See Also:
- Constant Field Values
DateFormatCode
public DateFormatCode()
isValid
public boolean isValid(String format)
- Description copied from class:
CodeValidation
- Checks if a specific code is valid.
- Specified by:
isValid in class CodeValidation
- Parameters:
format - the value you want to check
- Returns:
- true if the code is valid
convertToString
public String convertToString(Date d,
String format)
throws InvalidCodeException
- Throws:
InvalidCodeException
convertToDate
public Date convertToDate(String d,
String format)
throws InvalidCodeException,
ParseException
- Throws:
InvalidCodeException
ParseException
getDateFormat
public static SimpleDateFormat getDateFormat(String format)
throws InvalidCodeException
- Throws:
InvalidCodeException
Copyright © 2015. All Rights Reserved.