Class CbeffValidator
- java.lang.Object
-
- io.mosip.kernel.core.cbeffutil.common.CbeffValidator
-
public class CbeffValidator extends Object
- Author:
- Ramadurai Pandian An Utility Class to validate the data before generating an valid CBEFF XML and to get all the data based on Type and SubType
-
-
Constructor Summary
Constructors Constructor Description CbeffValidator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<BIR>convertBIRTypeToBIR(List<BIRType> birType)static byte[]createXMLBytes(BIRType bir, byte[] xsd)Method used for creating XML bytes using JAXBstatic Map<String,String>getAllBDBData(BIRType bir, String type, String subType)static Map<String,String>getBDBBasedOnTypeAndSubType(BIRType bir, String type, String subType)Method used for searching Cbeff data based on type and subtypestatic List<BIRType>getBIRDataFromXMLType(byte[] xmlBytes, String type)static BIRTypegetBIRFromXML(byte[] fileBytes)Method used for BIR Typestatic <E extends Enum<E>>
booleanisInEnum(String value, Class<E> enumClass)static booleanvalidateXML(BIRType bir)Method used for custom validation of the BIR
-
-
-
Method Detail
-
validateXML
public static boolean validateXML(BIRType bir) throws CbeffException
Method used for custom validation of the BIR- Parameters:
bir- BIR data- Returns:
- boolean value if BIR is valid
- Throws:
CbeffException- when any condition fails
-
createXMLBytes
public static byte[] createXMLBytes(BIRType bir, byte[] xsd) throws Exception
Method used for creating XML bytes using JAXB- Parameters:
bir- BIR typexsd- xml schema definition- Returns:
- byte[] byte array of XML data
- Throws:
Exception- exception
-
getBIRFromXML
public static BIRType getBIRFromXML(byte[] fileBytes) throws Exception
Method used for BIR Type- Parameters:
fileBytes- byte array of XML data- Returns:
- BIRType BIR data
- Throws:
Exception- exception
-
getBDBBasedOnTypeAndSubType
public static Map<String,String> getBDBBasedOnTypeAndSubType(BIRType bir, String type, String subType) throws Exception
Method used for searching Cbeff data based on type and subtype- Parameters:
bir- BIR datatype- format typesubType- format subtype- Returns:
- bdbMap
- Throws:
Exception- exception
-
getAllBDBData
public static Map<String,String> getAllBDBData(BIRType bir, String type, String subType) throws Exception
- Throws:
Exception
-
-