Package org.jibx.runtime.impl
Class RuntimeSupport
- java.lang.Object
-
- org.jibx.runtime.impl.RuntimeSupport
-
public abstract class RuntimeSupport extends java.lang.Object
Support class providing methods used by generated code and binding factory initialization.- Author:
- Dennis M. Sosnoski
-
-
Constructor Summary
Constructors Constructor Description RuntimeSupport()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IXMLReaderFactory
createReaderFactory(java.lang.String cname)
Parser factory class loader method.static java.lang.String[]
expandNamespaces(java.lang.String blob, java.lang.String[] uris)
Expand names URI indexes into an array of individual names URIs.static IXMLReaderFactory
loadFactory()
Load the appropriate reader factory.static java.lang.String[]
splitClassNames(java.lang.String blob)
Split concatenated class or method names string into an array of fully-qualified individual class and/or method names.static int[]
splitInts(java.lang.String blob)
Split concatenated ints string into an array of individual int values.static java.lang.String[]
splitNames(java.lang.String blob)
Split concatenated names string into an array of individual names.
-
-
-
Method Detail
-
splitClassNames
public static java.lang.String[] splitClassNames(java.lang.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 leftnull
in the array.- Parameters:
blob
- compacted class names separated by '|' delimiters- Returns:
- expanded class names
-
expandNamespaces
public static java.lang.String[] expandNamespaces(java.lang.String blob, java.lang.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 indexesuris
- namespace URIs defined in binding- Returns:
- expanded class names
-
splitNames
public static java.lang.String[] splitNames(java.lang.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(java.lang.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(java.lang.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:
java.lang.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
-
-