Class ResultFactory


  • public class ResultFactory
    extends java.lang.Object
    Builds Results from various input sources.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static org.apache.logging.log4j.Logger log  
    • Constructor Summary

      Constructors 
      Constructor Description
      ResultFactory()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Result fromMap​(java.util.Map<java.lang.String,​java.lang.String> data, QuickLinks ql, Explain explain, Collapsed collapsed)
      Builds a Result from a Map containing the values
      static Result fromXmlStreamReader​(javax.xml.stream.XMLStreamReader xmlStreamReader)
      Builds a Result from an XMLStreamReader Doesn't supports MetaData reading.
      (package private) static java.util.Optional<java.lang.Boolean> getBoolean​(java.util.Map<java.lang.String,​java.lang.String> data, java.lang.String tag)  
      (package private) static boolean isDocumentVisibleToUser​(java.util.Map<java.lang.String,​java.lang.String> data)  
      private static Collapsed parseCollapsed​(javax.xml.stream.XMLStreamReader reader)  
      private static java.util.Set<java.lang.String> parseGScopeSet​(java.lang.String strGScopesSet)
      Parses the field into a Set of Integers If it hits any failure it will return the set of as many as it parsed, or the empty set.
      private static java.lang.String parseTags​(javax.xml.stream.XMLStreamReader reader)
      Parses tags associated with a results.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • log

        private static final org.apache.logging.log4j.Logger log
    • Constructor Detail

      • ResultFactory

        public ResultFactory()
    • Method Detail

      • fromMap

        public static Result fromMap​(java.util.Map<java.lang.String,​java.lang.String> data,
                                     QuickLinks ql,
                                     Explain explain,
                                     Collapsed collapsed)
        Builds a Result from a Map containing the values
        Parameters:
        data - The map containing the values
        ql - Quick links for the results
        explain - Explain data for the result
        collapsed - Collapsing information for the result
        Returns:
        A result with populated values
      • isDocumentVisibleToUser

        static boolean isDocumentVisibleToUser​(java.util.Map<java.lang.String,​java.lang.String> data)
      • getBoolean

        static java.util.Optional<java.lang.Boolean> getBoolean​(java.util.Map<java.lang.String,​java.lang.String> data,
                                                                java.lang.String tag)
      • parseGScopeSet

        private static java.util.Set<java.lang.String> parseGScopeSet​(java.lang.String strGScopesSet)
        Parses the field into a Set of Integers If it hits any failure it will return the set of as many as it parsed, or the empty set.
      • fromXmlStreamReader

        public static Result fromXmlStreamReader​(javax.xml.stream.XMLStreamReader xmlStreamReader)
                                          throws javax.xml.stream.XMLStreamException
        Builds a Result from an XMLStreamReader Doesn't supports MetaData reading. Assumes that the stream is already inside the tag
        Parameters:
        xmlStreamReader - The XMLStreamReader to read from
        Returns:
        A Result with populated values
        Throws:
        javax.xml.stream.XMLStreamException
      • parseTags

        private static java.lang.String parseTags​(javax.xml.stream.XMLStreamReader reader)
                                           throws javax.xml.stream.XMLStreamException
        Parses tags associated with a results. href attributes are ignored because the URL will be rebuilt manually if needed.
        Parameters:
        reader -
        Returns:
        Throws:
        javax.xml.stream.XMLStreamException
      • parseCollapsed

        private static Collapsed parseCollapsed​(javax.xml.stream.XMLStreamReader reader)
                                         throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException