Package net.sf.saxon.trans

## Class PackageLoaderHE

- java.lang.Object
- - net.sf.saxon.trans.PackageLoaderHE

- All Implemented Interfaces:
    `IPackageLoader`
  Direct Known Subclasses:
    `PackageLoaderPE`

      public class PackageLoaderHE
      extends java.lang.Object
      implements IPackageLoader

  This class reads the XML exported form of a package and reconstructs the package object in memory.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static interface` | `PackageLoaderHE.ExpressionLoader` |
    `static interface` | `PackageLoaderHE.PatternLoader` |

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `java.util.Map<java.lang.String,​StylesheetPackage>` | `allPackages` |
    `java.util.List<Action>` | `completionActions` |
    `protected static java.util.Map<java.lang.String,​PackageLoaderHE.ExpressionLoader>` | `eMap` |
    `java.util.Stack<java.util.List<ComponentInvocation>>` | `fixups` |
    `protected static java.util.Map<java.lang.String,​java.lang.String>` | `licensableConstructs` |
    `java.util.Stack<LocalBinding>` | `localBindings` |
    `protected java.util.Stack<StylesheetPackage>` | `packStack` |
    `java.util.Map<SymbolicName,​UserFunction>` | `userFunctions` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `PackageLoaderHE​(Configuration config)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addCompletionAction​(Action action)` |
    `protected void` | `addVendorFunctionLibrary​(FunctionLibraryList targetList, Configuration config)` |
    `NodeInfo` | `getChild​(NodeInfo parent, int n)` | Get the n'th element child of an element (zero-based)
    `protected static Expression[]` | `getChildExpressionArray​(PackageLoaderHE loader, NodeInfo element)` |
    `protected static java.util.List<Expression>` | `getChildExpressionList​(PackageLoaderHE loader, NodeInfo element)` |
    `NodeInfo` | `getChildWithRole​(NodeInfo parent, java.lang.String role)` |
    `Configuration` | `getConfiguration()` |
    `Expression` | `getExpressionWithRole​(NodeInfo parent, java.lang.String role)` |
    `Expression` | `getFirstChildExpression​(NodeInfo parent)` |
    `java.lang.String` | `getInheritedAttribute​(NodeInfo element, java.lang.String localName)` |
    `int` | `getIntegerAttribute​(NodeInfo element, java.lang.String localName)` | Read an integer-valued attribute
    `java.util.List<StructuredQName>` | `getListOfQNameAttribute​(NodeInfo element, java.lang.String localName)` |
    `Expression` | `getNthChildExpression​(NodeInfo parent, int n)` |
    `protected static int` | `getOperator​(java.lang.String opAtt)` |
    `StylesheetPackage` | `getPackage()` |
    `java.util.Stack<StylesheetPackage>` | `getPackStack()` |
    `Pattern` | `getPatternWithRole​(NodeInfo parent, java.lang.String role)` |
    `StructuredQName` | `getQNameAttribute​(NodeInfo element, java.lang.String localName)` |
    `Expression` | `getSecondChildExpression​(NodeInfo parent)` |
    `SchemaType` | `getTypeAttribute​(NodeInfo element, java.lang.String attName)` |
    `Expression` | `loadExpression​(NodeInfo element)` |
    `StylesheetPackage` | `loadPackage​(javax.xml.transform.Source source)` |
    `StylesheetPackage` | `loadPackageDoc​(NodeInfo doc)` |
    `void` | `loadPackageElement​(NodeInfo packageElement, StylesheetPackage pack)` |
    `AtomicComparer` | `makeAtomicComparer​(java.lang.String name, NodeInfo element)` |
    `protected UserFunction` | `makeFunction​(java.lang.String flags)` |
    `RetainedStaticContext` | `makeRetainedStaticContext​(NodeInfo element)` |
    `void` | `needsEELicense​(java.lang.String name)` |
    `void` | `needsPELicense​(java.lang.String name)` |
    `SequenceType` | `parseAlphaCode​(NodeInfo element, java.lang.String name)` | Parse the SequenceType whose value is held in the attribute named "name", as an alphacode
    `ItemType` | `parseAlphaCodeForItemType​(NodeInfo element, java.lang.String name)` |
    `ItemType` | `parseItemTypeAttribute​(NodeInfo element, java.lang.String attName)` | Parse the ItemType whose value is held in the attribute named "name"
    `SequenceType` | `parseSequenceType​(NodeInfo element, java.lang.String name)` | Parse the SequenceType whose value is held in the attribute named "name"
    `static void` | `processAccumulatorList​(PackageLoaderHE loader, SourceDocument inst, java.lang.String accumulatorNames)` |
    `protected boolean` | `processComponentReference​(StylesheetPackage pack, ComponentInvocation call)` |
    `UserFunction` | `readFunction​(NodeInfo functionElement)` |
    `protected void` | `readSchemaNamespaces​(NodeInfo packageElement)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### packStack

          protected final java.util.Stack<StylesheetPackage> packStack

    - #### fixups

          public final java.util.Stack<java.util.List<ComponentInvocation>> fixups

    - #### completionActions

          public final java.util.List<Action> completionActions

    - #### allPackages

          public final java.util.Map<java.lang.String,​StylesheetPackage> allPackages

    - #### localBindings

          public java.util.Stack<LocalBinding> localBindings

    - #### userFunctions

          public final java.util.Map<SymbolicName,​UserFunction> userFunctions

    - #### eMap

          protected static final java.util.Map<java.lang.String,​PackageLoaderHE.ExpressionLoader> eMap

    - #### licensableConstructs

          protected static final java.util.Map<java.lang.String,​java.lang.String> licensableConstructs

  - ### Constructor Detail

    - #### PackageLoaderHE

          public PackageLoaderHE​(Configuration config)

  - ### Method Detail

    - #### processAccumulatorList

          public static void processAccumulatorList​(PackageLoaderHE loader,
                                                    SourceDocument inst,
                                                    java.lang.String accumulatorNames)

    - #### getConfiguration

          public Configuration getConfiguration()

    - #### getPackage

          public StylesheetPackage getPackage()

    - #### getPackStack

          public java.util.Stack<StylesheetPackage> getPackStack()

    - #### addCompletionAction

          public void addCompletionAction​(Action action)

    - #### loadPackage

          public StylesheetPackage loadPackage​(javax.xml.transform.Source source)
                                        throws XPathException

      Specified by:
        `loadPackage` in interface `IPackageLoader`
      Throws:
        `XPathException`

    - #### loadPackageDoc

          public StylesheetPackage loadPackageDoc​(NodeInfo doc)
                                           throws XPathException

      Specified by:
        `loadPackageDoc` in interface `IPackageLoader`
      Throws:
        `XPathException`

    - #### needsPELicense

          public void needsPELicense​(java.lang.String name)

    - #### needsEELicense

          public void needsEELicense​(java.lang.String name)

    - #### loadPackageElement

          public void loadPackageElement​(NodeInfo packageElement,
                                         StylesheetPackage pack)
                                  throws XPathException

      Throws:
        `XPathException`

    - #### addVendorFunctionLibrary

          protected void addVendorFunctionLibrary​(FunctionLibraryList targetList,
                                                  Configuration config)

    - #### readSchemaNamespaces

          protected void readSchemaNamespaces​(NodeInfo packageElement)
                                       throws XPathException

      Throws:
        `XPathException`

    - #### readFunction

          public UserFunction readFunction​(NodeInfo functionElement)
                                    throws XPathException

      Throws:
        `XPathException`

    - #### makeFunction

          protected UserFunction makeFunction​(java.lang.String flags)

    - #### getChild

          public NodeInfo getChild​(NodeInfo parent,
                                   int n)

      Get the n'th element child of an element (zero-based)
      Parameters:
        `parent` - the parent element
        `n` - which child to get (zero-based)
      Returns:
        the n'th child, or null if not available

    - #### getChildWithRole

          public NodeInfo getChildWithRole​(NodeInfo parent,
                                           java.lang.String role)

    - #### getFirstChildExpression

          public Expression getFirstChildExpression​(NodeInfo parent)
                                             throws XPathException

      Throws:
        `XPathException`

    - #### getSecondChildExpression

          public Expression getSecondChildExpression​(NodeInfo parent)
                                              throws XPathException

      Throws:
        `XPathException`

    - #### getNthChildExpression

          public Expression getNthChildExpression​(NodeInfo parent,
                                                  int n)
                                           throws XPathException

      Throws:
        `XPathException`

    - #### getExpressionWithRole

          public Expression getExpressionWithRole​(NodeInfo parent,
                                                  java.lang.String role)
                                           throws XPathException

      Throws:
        `XPathException`

    - #### loadExpression

          public Expression loadExpression​(NodeInfo element)
                                    throws XPathException

      Throws:
        `XPathException`

    - #### makeRetainedStaticContext

          public RetainedStaticContext makeRetainedStaticContext​(NodeInfo element)

    - #### getPatternWithRole

          public Pattern getPatternWithRole​(NodeInfo parent,
                                            java.lang.String role)
                                     throws XPathException

      Throws:
        `XPathException`

    - #### getTypeAttribute

          public SchemaType getTypeAttribute​(NodeInfo element,
                                             java.lang.String attName)

    - #### getQNameAttribute

          public StructuredQName getQNameAttribute​(NodeInfo element,
                                                   java.lang.String localName)

    - #### getListOfQNameAttribute

          public java.util.List<StructuredQName> getListOfQNameAttribute​(NodeInfo element,
                                                                         java.lang.String localName)
                                                                  throws XPathException

      Throws:
        `XPathException`

    - #### getIntegerAttribute

          public int getIntegerAttribute​(NodeInfo element,
                                         java.lang.String localName)
                                  throws XPathException

      Read an integer-valued attribute
      Parameters:
        `element` - the element on which the attribute appears
        `localName` - the name of the attribute
      Returns:
        the integer value of the attribute if present and correct; or Integer.MIN_VALUE if absent
      Throws:
        `XPathException` - if the attribute is present but not integer-valued.

    - #### getInheritedAttribute

          public java.lang.String getInheritedAttribute​(NodeInfo element,
                                                        java.lang.String localName)

    - #### parseSequenceType

          public SequenceType parseSequenceType​(NodeInfo element,
                                                java.lang.String name)
                                         throws XPathException

      Parse the SequenceType whose value is held in the attribute named "name"
      Parameters:
        `element` - the element containing this attribute
        `name` - the local name of the attribute
      Returns:
        the SequenceType held in the content of the attribute, or "item()*" if the attribute is absent
      Throws:
        `XPathException` - if the sequence type is invalid

    - #### parseAlphaCode

          public SequenceType parseAlphaCode​(NodeInfo element,
                                             java.lang.String name)
                                      throws XPathException

      Parse the SequenceType whose value is held in the attribute named "name", as an alphacode
      Parameters:
        `element` - the element containing this attribute
        `name` - the local name of the attribute
      Returns:
        the SequenceType held in the content of the attribute, or "item()*" if the attribute is absent
      Throws:
        `XPathException` - if the sequence type is invalid

    - #### parseAlphaCodeForItemType

          public ItemType parseAlphaCodeForItemType​(NodeInfo element,
                                                    java.lang.String name)
                                             throws XPathException

      Throws:
        `XPathException`

    - #### parseItemTypeAttribute

          public ItemType parseItemTypeAttribute​(NodeInfo element,
                                                 java.lang.String attName)
                                          throws XPathException

      Parse the ItemType whose value is held in the attribute named "name"
      Parameters:
        `element` - the element containing this attribute
        `attName` - the local name of the attribute
      Returns:
        the SequenceType held in the content of the attribute, or "item()" if the attribute is absent
      Throws:
        `XPathException` - if the item type is invalid

    - #### makeAtomicComparer

          public AtomicComparer makeAtomicComparer​(java.lang.String name,
                                                   NodeInfo element)
                                            throws XPathException

      Throws:
        `XPathException`

    - #### getChildExpressionList

          protected static java.util.List<Expression> getChildExpressionList​(PackageLoaderHE loader,
                                                                             NodeInfo element)
                                                                      throws XPathException

      Throws:
        `XPathException`

    - #### getChildExpressionArray

          protected static Expression[] getChildExpressionArray​(PackageLoaderHE loader,
                                                                NodeInfo element)
                                                         throws XPathException

      Throws:
        `XPathException`

    - #### getOperator

          protected static int getOperator​(java.lang.String opAtt)

    - #### processComponentReference

          protected boolean processComponentReference​(StylesheetPackage pack,
                                                      ComponentInvocation call)
                                               throws XPathException

      Throws:
        `XPathException`