Package emissary.util

Class PayloadUtil


  • public class PayloadUtil
    extends Object
    Utilities for dealing with IBaseDataObject and Lists thereof
    • Field Detail

      • logger

        public static final org.slf4j.Logger logger
      • historyPreference

        protected static final Map<String,​String> historyPreference
      • compactHistory

        protected static boolean compactHistory
    • Method Detail

      • configure

        protected static void configure()
      • setFileTypeHistoryPreference

        protected static void setFileTypeHistoryPreference​(String fileType,
                                                           String preference)
        Check if fileType is already mapped to history preference. If not, set fileType -$gt; preference in map
        Parameters:
        fileType - current fileType pulled from cfg
        preference - preference associated with current cfg fileType
      • getName

        public static String getName​(Object o)
        Try really hard to get a meaningful name for a payload object
      • getPayloadDisplayString

        public static String getPayloadDisplayString​(IBaseDataObject payload,
                                                     boolean oneLine)
        Generate a string about the payload object
        Parameters:
        payload - the payload to describe
        oneLine - true for a condensed one-line string
      • getPayloadDisplayString

        public static String getPayloadDisplayString​(IBaseDataObject payload)
        Generate a string about the payload object
        Parameters:
        payload - the payload to describe
      • configureHistoryCase

        public static String configureHistoryCase​(String fileType)
        Check if fileType in PayloadUtil.cfg matches current payload fileType
        Parameters:
        fileType - current payload fileType
        Returns:
        string for output case
      • getPayloadOneLineString

        public static String getPayloadOneLineString​(IBaseDataObject payload)
        Generate a one-line string about the payload object
        Parameters:
        payload - the payload to describe
      • toXml

        public static org.jdom2.Document toXml​(IBaseDataObject d)
        Turn the payload into an xml jdom document
        Parameters:
        d - the payload
      • toXml

        public static org.jdom2.Document toXml​(List<IBaseDataObject> list)
        Turn a list of payload into an xml jdom ocument
        Parameters:
        list - the payload list
      • toXmlString

        public static String toXmlString​(IBaseDataObject d)
        Turn the payload into an xml string
        Parameters:
        d - the payload
      • toXmlString

        public static String toXmlString​(List<IBaseDataObject> list)
        Turn the payload list into an xml string
        Parameters:
        list - the payload list
      • isValidForm

        public static boolean isValidForm​(String form)
        Checks whether the form complies with form rules established by a regex Approved forms can contain alpha-numerics, '-', '_', '()', '/', '+'
        Parameters:
        form - The form to be tested
        Returns:
        Whether the form is Emissary compliant