Class TreeFactory

java.lang.Object
overit.geocall.xml.TreeFactory

public class TreeFactory extends Object
This class implements the object used to create XMLTree instances starting from a resource; the resource is passed as parameter to the make methods in the form of a string defining a path. The methods will use the localization mechanism to retrieve the correct source.
  • Constructor Details

    • TreeFactory

      public TreeFactory()
  • Method Details

    • make

      public static XMLTree make(Class reference)
      Creates and returns the XMLTree that corresponds to the resource passed as parameter
      Parameters:
      reference - The reference class defining position and name of the desired xml resurce. This factory looks for the best instance of an xml file with the same name of the reference, searching in all layer customizations.
      Returns:
      An XMLTree corresponding the reference parameter
    • make

      public static XMLTree make(String resource, Class from)
      Creates and returns the XMLTree that corresponds to the resource passed as parameter
      Parameters:
      resource - The resource used to make the tree. This factory looks for the best location of this resource searching in all layer customizations. A resource starting with / is ment to be already resolved and will not be changed. A resource can be e relative name with respect to the from class or or absolute if the caller is null.
      from - the starting position. If it is null, the resource is meant to be absolute
      Returns:
      An XMLTree that corresponds to the resource
    • make

      public static XMLTree make(String resource, Object caller)
      Creates and returns the XMLTree that corresponds to the resource passed as parameter
      Parameters:
      resource - The resource used to make the tree. This factory looks for the best location of this resource searching in all layer customizations. A resource starting with // is ment to be already resolved and will not be changed. A resource can be e relative name with respect to the caller object or absolute if the caller is null.
      caller - The caller object
      Returns:
      An XMLTree that corresponds to the resource
    • localize

      public static UISchema localize(String resource, Object caller)
      Returns the UISchema that corresponds to the resource passed as parameter
      Parameters:
      resource - The resource of interest. This factory looks for the best location of this resource searching in all layer customizations. A resource starting with / is ment to be already resolved and will not be changed. A resource can be e relative name with respect to the caller object or or absolute if the caller is null.
      caller - The caller object
      Returns:
      The UISchema
    • localize

      public static UISchema localize(String resource, String from)
      Returns the UISchema that corresponds to the resource passed as parameter
      Parameters:
      resource - The resource of interest. This factory looks for the best location of this resource searching in all layer customizations. A resource starting with // is meant to be already resolved and will not be changed. A resource can be e relative name with respect to the from parameter object or or absolute if the from is null.
      from - the starting position. If it is null, the resource is meant to be absolute
      Returns:
      The UISchema
    • make

      public static XMLTree make(UISchema uis, boolean normalizeAttributes)
      Creates and returns the XMLTree that corresponds to the UISchema passed as parameter
      Parameters:
      uis - The UISchema used to make the tree
      normalizeAttributes - true to normalize the attributes (collect only the well formed ones, without empty spaces), false otherwise
      Returns:
      An XMLTree that corresponds to the schema