org.apache.xalan.extensions
Class ExtensionNamespacesManager

java.lang.Object
  extended by org.apache.xalan.extensions.ExtensionNamespacesManager

public class ExtensionNamespacesManager
extends java.lang.Object

Used during assembly of a stylesheet to collect the information for each extension namespace that is required during the transformation process to generate an ExtensionHandler.


Field Summary
private  java.util.Vector m_extensions
          Vector of ExtensionNamespaceSupport objects to be used to generate ExtensionHandlers.
private  java.util.Vector m_predefExtensions
          Vector of ExtensionNamespaceSupport objects for predefined ExtensionNamespaces.
private  java.util.Vector m_unregisteredExtensions
          Vector of extension namespaces for which sufficient information is not yet available to complete the registration process.
 
Constructor Summary
ExtensionNamespacesManager()
          An ExtensionNamespacesManager is instantiated the first time an extension function or element is found in the stylesheet.
 
Method Summary
 ExtensionNamespaceSupport defineJavaNamespace(java.lang.String ns)
          For any extension namespace that is not either predefined or defined by a "component" declaration or exslt function declaration, attempt to create an ExtensionNamespaceSuport object for the appropriate Java class or Java package Extension Handler.
 ExtensionNamespaceSupport defineJavaNamespace(java.lang.String ns, java.lang.String classOrPackage)
           
 java.util.Vector getExtensions()
          Get the vector of extension namespaces.
 int namespaceIndex(java.lang.String namespace, java.util.Vector extensions)
          Get the index for a namespace entry in the extension namespace Vector, -1 if no such entry yet exists.
 void registerExtension(ExtensionNamespaceSupport extNsSpt)
          Register the extension namespace for an ElemExtensionDecl or ElemFunction, and prepare a support object to launch the appropriate ExtensionHandler at transformation runtime.
 void registerExtension(java.lang.String namespace)
          If necessary, register the extension namespace found compiling a function or creating an extension element.
 void registerUnregisteredNamespaces()
          Attempt to register any unregistered extension namespaces.
private  void setPredefinedNamespaces()
          Set up a Vector for predefined extension namespaces.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_extensions

private java.util.Vector m_extensions
Vector of ExtensionNamespaceSupport objects to be used to generate ExtensionHandlers.


m_predefExtensions

private java.util.Vector m_predefExtensions
Vector of ExtensionNamespaceSupport objects for predefined ExtensionNamespaces. Elements from this vector are added to the m_extensions vector when encountered in the stylesheet.


m_unregisteredExtensions

private java.util.Vector m_unregisteredExtensions
Vector of extension namespaces for which sufficient information is not yet available to complete the registration process.

Constructor Detail

ExtensionNamespacesManager

public ExtensionNamespacesManager()
An ExtensionNamespacesManager is instantiated the first time an extension function or element is found in the stylesheet. During initialization, a vector of ExtensionNamespaceSupport objects is created, one for each predefined extension namespace.

Method Detail

registerExtension

public void registerExtension(java.lang.String namespace)
If necessary, register the extension namespace found compiling a function or creating an extension element. If it is a predefined namespace, create a support object to simplify the instantiate of an appropriate ExtensionHandler during transformation runtime. Otherwise, add the namespace, if necessary, to a vector of undefined extension namespaces, to be defined later.


registerExtension

public void registerExtension(ExtensionNamespaceSupport extNsSpt)
Register the extension namespace for an ElemExtensionDecl or ElemFunction, and prepare a support object to launch the appropriate ExtensionHandler at transformation runtime.


namespaceIndex

public int namespaceIndex(java.lang.String namespace,
                          java.util.Vector extensions)
Get the index for a namespace entry in the extension namespace Vector, -1 if no such entry yet exists.


getExtensions

public java.util.Vector getExtensions()
Get the vector of extension namespaces. Used to provide the extensions table access to a list of extension namespaces encountered during composition of a stylesheet.


registerUnregisteredNamespaces

public void registerUnregisteredNamespaces()
Attempt to register any unregistered extension namespaces.


defineJavaNamespace

public ExtensionNamespaceSupport defineJavaNamespace(java.lang.String ns)
For any extension namespace that is not either predefined or defined by a "component" declaration or exslt function declaration, attempt to create an ExtensionNamespaceSuport object for the appropriate Java class or Java package Extension Handler. Called by StylesheetRoot.recompose(), after all ElemTemplate compose() operations have taken place, in order to set up handlers for the remaining extension namespaces.

Parameters:
ns - The extension namespace URI.
Returns:
An ExtensionNamespaceSupport object for this namespace (which defines the ExtensionHandler to be used), or null if such an object cannot be created.
Throws:
javax.xml.transform.TransformerException

defineJavaNamespace

public ExtensionNamespaceSupport defineJavaNamespace(java.lang.String ns,
                                                     java.lang.String classOrPackage)

setPredefinedNamespaces

private void setPredefinedNamespaces()
Set up a Vector for predefined extension namespaces.