Class ScannerFactory


  • class ScannerFactory
    extends java.lang.Object
    The ScannerFactory is used to create scanner objects that will scan a class for its XML class schema. Caching is done by this factory so that repeat retrievals of a Scanner will not require repeat scanning of the class for its XML schema.
    See Also:
    Context
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Cache<Scanner> cache
      This is used to cache all schemas built to represent a class.
      private Support support
      This is used to determine which objects are primitives.
    • Constructor Summary

      Constructors 
      Constructor Description
      ScannerFactory​(Support support)
      Constructor for the ScannerFactory object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Scanner getInstance​(java.lang.Class type)
      This creates a Scanner object that can be used to examine the fields within the XML class schema.
      • Methods inherited from class java.lang.Object

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

      • cache

        private final Cache<Scanner> cache
        This is used to cache all schemas built to represent a class.
      • support

        private final Support support
        This is used to determine which objects are primitives.
    • Constructor Detail

      • ScannerFactory

        public ScannerFactory​(Support support)
        Constructor for the ScannerFactory object. This is used to create a factory that will create and cache scanned data for a given class. Scanning the class is required to find the fields and methods that have been annotated.
        Parameters:
        support - this is used to determine if a type is primitive
    • Method Detail

      • getInstance

        public Scanner getInstance​(java.lang.Class type)
                            throws java.lang.Exception
        This creates a Scanner object that can be used to examine the fields within the XML class schema. The scanner maintains information when a field from within the scanner is visited, this allows the serialization and deserialization process to determine if all required XML annotations are used.
        Parameters:
        type - the schema class the scanner is created for
        Returns:
        a scanner that can maintains information on the type
        Throws:
        java.lang.Exception - if the class contains an illegal schema