Class 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 Detail

      • CbeffValidator

        public CbeffValidator()
    • 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 type
        xsd - 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 data
        type - format type
        subType - format subtype
        Returns:
        bdbMap
        Throws:
        Exception - exception
      • isInEnum

        public static <E extends Enum<E>> boolean isInEnum​(String value,
                                                           Class<E> enumClass)
      • convertBIRTypeToBIR

        public static List<BIR> convertBIRTypeToBIR​(List<BIRType> birType)