Class LHEOUtils


  • public final class LHEOUtils
    extends Object
    Class utils for LHEO XML export
    • Field Detail

      • __logger

        private static org.slf4j.Logger __logger
    • Method Detail

      • createCoordinateLHEOElementsPart1

        public static void createCoordinateLHEOElementsPart1​(ContentHandler contentHandler,
                                                             Content content,
                                                             String civility,
                                                             String lastname,
                                                             String firstname,
                                                             String address)
                                                      throws SAXException
        Create some LHEO elements for tag >coordonnees<
        Contains the following XML tags:
        [0,1] <civilite>
        [0,1] <nom>
        [0,1] <prenom>
        [0,3] <ligne>
        Parameters:
        contentHandler - the content handler
        content - the saxed content
        civility - the civility. Can be null.
        lastname - the lastname. Can be null.
        firstname - the firstname. Can be null.
        address - the address. Can be null.
        Throws:
        SAXException - if a saxing exception occurred
      • createCoordinateLHEOElementsPart1

        public static void createCoordinateLHEOElementsPart1​(ContentHandler contentHandler,
                                                             Content content,
                                                             String civility,
                                                             String lastname,
                                                             String firstname,
                                                             List<String> lines)
                                                      throws SAXException
        Create some LHEO elements for tag >coordonnees<
        Contains the following XML tags:
        [0,1] <civilite>
        [0,1] <nom>
        [0,1] <prenom>
        [0,3] <ligne>
        Parameters:
        contentHandler - the content handler
        content - the saxed content
        civility - the civility. Can be null.
        lastname - the lastname. Can be null.
        firstname - the firstname. Can be null.
        lines - the address line. Can be empty.
        Throws:
        SAXException - if a saxing exception occurred
      • createCoordinateLHEOElementsPart2

        public static void createCoordinateLHEOElementsPart2​(ContentHandler contentHandler,
                                                             Content content,
                                                             String telFix,
                                                             String portable,
                                                             String fax,
                                                             String mail,
                                                             String urlWeb)
                                                      throws SAXException
        Create some LHEO elements for tag >coordonnees<
        Contains the following XML tags:
        [0,1] <telfixe>
        [0,1] <portable>
        [0,1] <fax>
        [0,1] <courriel>
        [0,1] <web>
        Parameters:
        contentHandler - the content handler
        content - the saxed content
        telFix - the telFix. Can be null.
        portable - the portable. Can be null.
        fax - the fax. Can be null.
        mail - the mail. Can be null.
        urlWeb - the url web. Can be null.
        Throws:
        SAXException - if a saxing exception occurred
      • createAddressLHEOElements

        public static void createAddressLHEOElements​(ContentHandler contentHandler,
                                                     Content content,
                                                     String address,
                                                     String zipCode,
                                                     String town,
                                                     String department,
                                                     String codeINSEEtown,
                                                     String codeINSEEdistrict,
                                                     String zone,
                                                     String country,
                                                     String latitude,
                                                     String longitude)
                                              throws SAXException
        Create some LHEO elements for tag >adresse<
        Contains the following XML tags:
        [0,1] <ligne>
        [0,1] <codepostal>
        [0,1] <ville>
        [0,3] <departement>
        [0,1] <code-INSEE-commune>
        [0,1] <code-INSEE-canton>
        [0,1] <region>
        [0,1] <pays>
        [0,1] <geolocalisation>
        Parameters:
        contentHandler - the content handler
        content - the saxed content
        address - the address. Is mandatory.
        zipCode - the zip code. Is mandatory.
        town - the town. Is mandatory.
        department - the department. Can be null.
        codeINSEEtown - the code INSEE for the town. Can be null.
        codeINSEEdistrict - the code INSEE for the district. Can be null.
        zone - the zone. Can be null.
        country - the country. Can be null.
        latitude - the latitude. Can be null.
        longitude - the longitude. Can be null.
        Throws:
        SAXException - if a saxing exception occurred
      • createAddressLHEOElements

        public static void createAddressLHEOElements​(ContentHandler contentHandler,
                                                     Content content,
                                                     List<String> lines,
                                                     String zipCode,
                                                     String town,
                                                     String department,
                                                     String codeINSEEtown,
                                                     String codeINSEEdistrict,
                                                     String zone,
                                                     String country,
                                                     String latitude,
                                                     String longitude)
                                              throws SAXException
        Create some LHEO elements for tag >adresse<
        Contains the following XML tags:
        [0,1] <ligne>
        [0,1] <codepostal>
        [0,1] <ville>
        [0,3] <departement>
        [0,1] <code-INSEE-commune>
        [0,1] <code-INSEE-canton>
        [0,1] <region>
        [0,1] <pays>
        [0,1] <geolocalisation>
        Parameters:
        contentHandler - the content handler
        content - the saxed content
        lines - the address lines. Is mandatory.
        zipCode - the zip code. Is mandatory.
        town - the town. Is mandatory.
        department - the department. Can be null.
        codeINSEEtown - the code INSEE for the town. Can be null.
        codeINSEEdistrict - the code INSEE for the district. Can be null.
        zone - the zone. Can be null.
        country - the country. Can be null.
        latitude - the latitude. Can be null.
        longitude - the longitude. Can be null.
        Throws:
        SAXException - if a saxing exception occurred
      • createMandatoryLHEOElement

        public static void createMandatoryLHEOElement​(ContentHandler contentHandler,
                                                      Content content,
                                                      String elementName,
                                                      String value,
                                                      int minLength,
                                                      int maxLength)
                                               throws SAXException
        Create the mandatory LHEO element
        Parameters:
        contentHandler - the content handler
        content - the saxed content
        elementName - the element name
        value - the value to sax
        minLength - the min length of the value (0 if there is no min length). If the value length is lower than minLength, a warning will be logged
        maxLength - the max length of the value (0 if there is no max length). If the value length is greater than maxLength, a warning will be logged and the value will be troncated
        Throws:
        SAXException - if a saxing error occurred
      • createMandatoryLHEOElement

        public static void createMandatoryLHEOElement​(ContentHandler contentHandler,
                                                      Content content,
                                                      String elementName,
                                                      AttributesImpl attrs,
                                                      String value,
                                                      int minLength,
                                                      int maxLength)
                                               throws SAXException
        Create the mandatory LHEO element
        Parameters:
        contentHandler - the content handler
        content - the saxed content
        elementName - the element name
        attrs - the attributes
        value - the value to sax
        minLength - the min length of the value (0 if there is no min length). If the value length is lower than minLength, a warning will be logged
        maxLength - the max length of the value (0 if there is no max length). If the value length is greater than maxLength, a warning will be logged and the value will be troncated
        Throws:
        SAXException - if a saxing error occurred
      • createLHEOElement

        public static void createLHEOElement​(ContentHandler contentHandler,
                                             Content content,
                                             String elementName,
                                             String value)
                                      throws SAXException
        Create the LHEO element
        Parameters:
        contentHandler - the content handler
        content - the saxed content
        elementName - the element name
        value - the value to sax
        Throws:
        SAXException - if a saxing error occurred
      • createLHEOElement

        public static void createLHEOElement​(ContentHandler contentHandler,
                                             Content content,
                                             String elementName,
                                             String value,
                                             int minLength,
                                             int maxLength)
                                      throws SAXException
        Create the LHEO element
        Parameters:
        contentHandler - the content handler
        content - the saxed content
        elementName - the element name
        value - the value to sax
        minLength - the min length of the value (0 if there is no min length). If the value length is lower than minLength, a warning will be logged
        maxLength - the max length of the value (0 if there is no max length). If the value length is greater than maxLength, a warning will be logged and the value will be troncated
        Throws:
        SAXException - if a saxing error occurred
      • createLHEOElement

        public static void createLHEOElement​(ContentHandler contentHandler,
                                             Content content,
                                             String elementName,
                                             AttributesImpl attrs,
                                             String value,
                                             int minLength,
                                             int maxLength)
                                      throws SAXException
        Create the LHEO element
        Parameters:
        contentHandler - the content handler
        content - the saxed content
        elementName - the element name
        attrs - the attributes
        value - the value to sax
        minLength - the min length of the value (0 if there is no min length). If the value length is lower than minLength, a warning will be logged
        maxLength - the max length of the value (0 if there is no max length). If the value length is greater than maxLength, a warning will be logged and the value will be troncated
        Throws:
        SAXException - if a saxing error occurred