Class UIFactory

java.lang.Object
overit.geocall.platform.ui.UIFactory
Direct Known Subclasses:
UIFactory

public class UIFactory extends Object
Utility class used to create an instance of UI class through the method make(java.lang.String, java.lang.Object). This utility class is very important because it allows to get an instance of an UI class by passing the name of the file and the caller. The name of the file can be passed if the class lies in the same package of the caller, otherwise it must have the relative path starting from the layer root. The resolution of the UI class depends from the identity package. The searching logic is: search inside the package of the identity and then in all the other levels, the order of the levels depends from the layers. This allows the possibility to extends other UI classes with some specific logic inside that may differ from project to project assuring the creation of the right class.
  • Constructor Details

    • UIFactory

      public UIFactory()
  • Method Details

    • getCacheDimension

      public static int getCacheDimension()
      Returns the dimention of the cache
      Returns:
      The dimension of the cache
    • invalidateCache

      public static void invalidateCache()
      Invalidate the cache by creating a new one
    • getDom

      public static Document getDom(String absPath, boolean normalizeTags, boolean normalizeAttributes, String xsl)
      Returns the Document
      Parameters:
      absPath - String containint the absolute path
      normalizeTags - Boolean indicating the use of normalize tags
      normalizeAttributes - Boolean indicating the use of normalize attributes
      xsl - String containing the xls
      Returns:
      The Document
    • getDom

      public static Document getDom(String absPath, boolean normalizeTags, boolean normalizeAttributes, String xsl, boolean useCache)
      Returns the Document
      Parameters:
      absPath - String containint the absolute path
      normalizeTags - Boolean indicating the use of normalize tags
      normalizeAttributes - Boolean indicating the use of normalize attributes
      xsl - String containing the xls
      useCache - specify if retrieve this instance from cache first or if load it from scratch every time
      Returns:
      The Document
    • loadDom

      protected static Document loadDom(String absPath)
    • normalizeDom

      public static void normalizeDom(Element el, String from, boolean normalizeTags, boolean normalizeAttributes)
      Normalize the document
      Parameters:
      el - The document element
      from - String from
      normalizeTags - Boolean indicating the use of normalize tags
      normalizeAttributes - Boolean indicating the use of normalize attributes
    • make

      public static <T> T make(Class reference)
      Returns an instance of the UI class searching for an eventual personalization of the class
      Type Parameters:
      T - The type of the class
      Parameters:
      reference - The reference of the class
      Returns:
      An instance of the class searching for an eventual personalization of the class
    • make

      public static <T> T make(String resource, Class from)
      Returns an instance of the UI class searching for an eventual personalization of the class
      Type Parameters:
      T - The type of the class
      Parameters:
      resource - The rootpath of the class
      from - The class
      Returns:
      An instance of the class searching for an eventual personalization of the class
    • make

      public static <T> T make(String resource, Object caller)
      Returns an instance of the UI class searching for an eventual personalization of the class
      Type Parameters:
      T - The type of the class
      Parameters:
      resource - The rootpath of the class
      caller - The caller
      Returns:
      An instance of the class searching for an eventual personalization of the class
    • make

      public static Object make(String resource, Object caller, String xsl)
      Returns an instance of the UI class searching for an eventual personalization of the class
      Parameters:
      resource - The rootpath of the class
      caller - The caller
      xsl - The xls
      Returns:
      An instance of the class searching for an eventual personalization of the class
    • make

      public static <T> T make(String resource, Object caller, String xsl, UINode parent)
      Returns an instance of the UI class searching for an eventual personalization of the class
      Type Parameters:
      T - The type of the class
      Parameters:
      resource - The rootpath of the class
      caller - The caller
      xsl - The xls
      parent - The UINode parent
      Returns:
      An instance of the class searching for an eventual personalization of the class
    • make

      public static <T> T make(String resource, String from, String xsl, UINode parent)
      Returns an instance of the UI class searching for an eventual personalization of the class
      Type Parameters:
      T - The type of the class
      Parameters:
      resource - The rootpath of the class
      from - The starting position. If it is null, the path is meant to be absolute
      xsl - String containing the xls
      parent - The UINode parent
      Returns:
      An instance of the class searching for an eventual personalization of the class
    • make

      public static <T> T make(String resource, String from, String xsl, UINode parent, boolean useCache)
      Returns an instance of the UI class searching for an eventual personalization of the class
      Type Parameters:
      T - The type of the class
      Parameters:
      resource - The rootpath of the class
      from - The starting position. If it is null, the path is meant to be absolute
      xsl - String containing the xls
      parent - The UINode parent
      useCache - specify if retrieve this instance from cache first or if load it from scratch every time
      Returns:
      An instance of the class searching for an eventual personalization of the class
    • make

      public static <T> T make(XMLTree tree, String resource, Object caller, String xsl)
      Returns an instance of the UI class searching for an eventual personalization of the class
      Type Parameters:
      T - The type of the class
      Parameters:
      tree - The [@link XMLTree]
      resource - The rootpath of the class
      caller - The caller
      xsl - The xls
      Returns:
      An instance of the class searching for an eventual personalization of the class
    • make

      public static <T> T make(XMLTree tree, String resource, Object caller, String xsl, boolean useCache)
      Returns an instance of the UI class searching for an eventual personalization of the class
      Type Parameters:
      T - The type of the class
      Parameters:
      tree - The [@link XMLTree]
      resource - The rootpath of the class
      caller - The caller
      xsl - The xls
      useCache - specify if retrieve this instance from cache first or if load it from scratch every time
      Returns:
      An instance of the class searching for an eventual personalization of the class
    • make

      public static <T> T make(XMLTree tree, String resource, Object caller, String xsl, UINode parent)
      Returns an instance of the UI class searching for an eventual personalization of the class
      Type Parameters:
      T - The type of the class
      Parameters:
      tree - The [@link XMLTree]
      resource - The rootpath of the class
      caller - The caller
      xsl - The xls
      parent - The UINode parent
      Returns:
      An instance of the class searching for an eventual personalization of the class
    • make

      public static <T> T make(XMLTree tree, String resource, Object caller, String xsl, UINode parent, boolean useCache)
      Returns an instance of the UI class searching for an eventual personalization of the class
      Type Parameters:
      T - The type of the class
      Parameters:
      tree - The [@link XMLTree]
      resource - The rootpath of the class
      caller - The caller
      xsl - The xls
      parent - The UINode parent
      useCache - specify if retrieve this instance from cache first or if load it from scratch every time
      Returns:
      An instance of the class searching for an eventual personalization of the class
    • getInstance

      protected static UINode getInstance(Element e, String resource, String from, UINode parent, UISchema uis)
      Returns an instance of the UI class
      Parameters:
      e - The Element
      resource - The rootpath of the class
      from - From
      parent - The UINode parent
      uis - The UISchema
      Returns:
      An instance of the UI class
    • getInstance

      protected static UINode getInstance(Element e, String resource, String from, UINode parent, UISchema uis, boolean useCache)
      Returns an instance of the UI class
      Parameters:
      e - The Element
      resource - The rootpath of the class
      from - From
      parent - The UINode parent
      uis - The UISchema
      useCache - specify if retrieve this instance from cache first or if load it from scratch every time
      Returns:
      An instance of the UI class
    • setBean

      protected static void setBean(UINode bean, String propName, String value, String from)