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 interfacePackageLoaderHE.ExpressionLoaderstatic interfacePackageLoaderHE.PatternLoader
-
Field Summary
Fields Modifier and Type Field Description java.util.Map<java.lang.String,StylesheetPackage>allPackagesjava.util.List<Action>completionActionsprotected static java.util.Map<java.lang.String,PackageLoaderHE.ExpressionLoader>eMapjava.util.Stack<java.util.List<ComponentInvocation>>fixupsprotected static java.util.Map<java.lang.String,java.lang.String>licensableConstructsjava.util.Stack<LocalBinding>localBindingsprotected java.util.Stack<StylesheetPackage>packStackjava.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 voidaddCompletionAction(Action action)protected voidaddVendorFunctionLibrary(FunctionLibraryList targetList, Configuration config)NodeInfogetChild(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)NodeInfogetChildWithRole(NodeInfo parent, java.lang.String role)ConfigurationgetConfiguration()ExpressiongetExpressionWithRole(NodeInfo parent, java.lang.String role)ExpressiongetFirstChildExpression(NodeInfo parent)java.lang.StringgetInheritedAttribute(NodeInfo element, java.lang.String localName)intgetIntegerAttribute(NodeInfo element, java.lang.String localName)Read an integer-valued attributejava.util.List<StructuredQName>getListOfQNameAttribute(NodeInfo element, java.lang.String localName)ExpressiongetNthChildExpression(NodeInfo parent, int n)protected static intgetOperator(java.lang.String opAtt)StylesheetPackagegetPackage()java.util.Stack<StylesheetPackage>getPackStack()PatterngetPatternWithRole(NodeInfo parent, java.lang.String role)StructuredQNamegetQNameAttribute(NodeInfo element, java.lang.String localName)ExpressiongetSecondChildExpression(NodeInfo parent)SchemaTypegetTypeAttribute(NodeInfo element, java.lang.String attName)ExpressionloadExpression(NodeInfo element)StylesheetPackageloadPackage(javax.xml.transform.Source source)StylesheetPackageloadPackageDoc(NodeInfo doc)voidloadPackageElement(NodeInfo packageElement, StylesheetPackage pack)AtomicComparermakeAtomicComparer(java.lang.String name, NodeInfo element)protected UserFunctionmakeFunction(java.lang.String flags)RetainedStaticContextmakeRetainedStaticContext(NodeInfo element)voidneedsEELicense(java.lang.String name)voidneedsPELicense(java.lang.String name)SequenceTypeparseAlphaCode(NodeInfo element, java.lang.String name)Parse the SequenceType whose value is held in the attribute named "name", as an alphacodeItemTypeparseAlphaCodeForItemType(NodeInfo element, java.lang.String name)ItemTypeparseItemTypeAttribute(NodeInfo element, java.lang.String attName)Parse the ItemType whose value is held in the attribute named "name"SequenceTypeparseSequenceType(NodeInfo element, java.lang.String name)Parse the SequenceType whose value is held in the attribute named "name"static voidprocessAccumulatorList(PackageLoaderHE loader, SourceDocument inst, java.lang.String accumulatorNames)protected booleanprocessComponentReference(StylesheetPackage pack, ComponentInvocation call)UserFunctionreadFunction(NodeInfo functionElement)protected voidreadSchemaNamespaces(NodeInfo packageElement)
-
-
-
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:
loadPackagein interfaceIPackageLoader- Throws:
XPathException
-
loadPackageDoc
public StylesheetPackage loadPackageDoc(NodeInfo doc) throws XPathException
- Specified by:
loadPackageDocin interfaceIPackageLoader- 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 elementn- which child to get (zero-based)- Returns:
- the n'th child, or null if not available
-
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 appearslocalName- 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 attributename- 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 attributename- 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 attributeattName- 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
-
-