Class RuntimeSupport

java.lang.Object
org.jibx.runtime.impl.RuntimeSupport

public abstract class RuntimeSupport extends Object
Support class providing methods used by generated code and binding factory initialization.
Author:
Dennis M. Sosnoski
  • Constructor Details

    • RuntimeSupport

      public RuntimeSupport()
  • Method Details

    • splitClassNames

      public static String[] splitClassNames(String blob)
      Split concatenated class or method names string into an array of fully-qualified individual class and/or method names. This is used by the binding factory initialization, so that arrays of class and method names can be represented efficiently in the generated code. It takes as input a string consisting of compacted fully-qualified class names separated by '|' delimiter characters. If the compacted name starts with one or more '.' or '$' characters the corresponding number of package and class name levels are copied from the last name. Empty names are left null in the array.
      Parameters:
      blob - compacted class names separated by '|' delimiters
      Returns:
      expanded class names
    • expandNamespaces

      public static String[] expandNamespaces(String blob, String[] uris)
      Expand names URI indexes into an array of individual names URIs. This is used by the generated binding factory code, to reduce the size of the generated classes and methods. It takes as input a string where each character is a namespace index, biased by +2 in order to avoid the use of null characters, along with a table of corresponding namespace URIs. The character value 1 is used as a marker for the case where no namespace is associated with an index.
      Parameters:
      blob - string of characters representing namespace indexes
      uris - namespace URIs defined in binding
      Returns:
      expanded class names
    • splitNames

      public static String[] splitNames(String blob)
      Split concatenated names string into an array of individual names. This is used by the binding factory initialization, so that arrays of name strings can be represented efficiently in the generated code. It takes as input a string consisting of names separated by '|' delimiter characters.
      Parameters:
      blob - element names separated by '|' delimiters
      Returns:
      expanded class names
    • splitInts

      public static int[] splitInts(String blob)
      Split concatenated ints string into an array of individual int values. This is used by the binding factory initialization, so that arrays of ints can be represented efficiently in the generated code.
      Parameters:
      blob -
      Returns:
      expanded index array
    • createReaderFactory

      public static IXMLReaderFactory createReaderFactory(String cname)
      Parser factory class loader method. This is used during initialization to check that a particular factory class is usable.
      Parameters:
      cname - class name
      Returns:
      reader factory instance
      Throws:
      RuntimeException - on error creating class instance
    • loadFactory

      public static IXMLReaderFactory loadFactory()
      Load the appropriate reader factory. This checks for a system property specifying the factory to be used, and if not found checks for an instance of one of the standard default factories.
      Returns:
      factory instance