Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

javax.ide.extension
Class MultiDeferredElementVisitorHook

java.lang.Object
  extended by javax.ide.extension.ElementVisitor
      extended by javax.ide.extension.ExtensionHook
          extended by javax.ide.extension.ParameterizedExtensionHook
              extended by javax.ide.extension.MultiDeferredElementVisitorHook

public class MultiDeferredElementVisitorHook
extends ParameterizedExtensionHook

MultiDeferredElementVisitorHook is similar to DeferredElementVisitorHook except that it supports attaching multiple ElementVisitors. A client of this API specifies the maximum number of visitors that can be attached. After that many visitors are attached, the recorded data will be released, and an exception will be thrown if someone attempts to attach another visitor. If MultiDeferredElementVisitorHook is registered as the hook handler for an element, it will record the XML data for all instances of that element encountered during extension.xml processing. At a later time, when that data is needed, the client would retrieve the MultiDeferredElementVisitorHook instance from the ExtensionRegistry and call attachElementVisitor() passing an ElementVisitor implementation. Before attachElementVisitor() returns, all of the recorded XML data will be replayed to the attached ElementVisitor instance visitor methods (start/end). MultiDeferredElementVisitor attempts to replicate the original parsing context (such as scope data and locators), such that the attached ElementVisitor would have access to the same information it would have if it had been registered as the hook handler. Once an ElementVisitor is attached, if additional instances of the element are encountered during extension.xml processing, the attached ElementVisitor's start/end method will be called.


Nested Class Summary
 
Nested classes/interfaces inherited from class javax.ide.extension.ExtensionHook
ExtensionHook.URIResource
 
Nested classes/interfaces inherited from class javax.ide.extension.ElementVisitor
ElementVisitor.ResourceBundleProvider
 
Field Summary
 
Fields inherited from class javax.ide.extension.ExtensionHook
KEY_EXTENSION, KEY_RSBUNDLE_CLASS, MANIFEST_XMLNS
 
Fields inherited from class javax.ide.extension.ElementVisitor
KEY_LOCATOR
 
Constructor Summary
MultiDeferredElementVisitorHook()
           
 
Method Summary
 void attachElementVisitor(ElementVisitor elementVisitor)
          When the XML data associated with the hook handler instance needs to be processed, call this method passing an ElementVisitor implementation.
 void end(ElementEndContext context)
          Visit the end tag of an xml element.
 java.util.List<ElementVisitor> getAttachedVisitors()
           
 int getMaximumNumberOfVisitors()
           
 int getNumberOfAttachedVisitors()
           
 void setHookHandlerParameters(java.util.Map<java.lang.String,java.lang.String> parameterMap)
           
 void setMaximumNumberOfVisitors(int maxVisitors)
           
 void start(ElementStartContext context)
          Visit the start tag of an xml element.
 
Methods inherited from class javax.ide.extension.ExtensionHook
findPath, getExtension, getProvider, getRSBundleClass, getSchemaLocation, resolvePath, setProvider, setSchemaLocation
 
Methods inherited from class javax.ide.extension.ElementVisitor
getAttributeHelper, getClassLoader, getMetaClassLoader, getResourceBundle, getResourceBundleProvider, getTextHelper, log, log, setResourceBundleProvider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiDeferredElementVisitorHook

public MultiDeferredElementVisitorHook()
Method Detail

setHookHandlerParameters

public void setHookHandlerParameters(java.util.Map<java.lang.String,java.lang.String> parameterMap)
Specified by:
setHookHandlerParameters in class ParameterizedExtensionHook

setMaximumNumberOfVisitors

public void setMaximumNumberOfVisitors(int maxVisitors)

getMaximumNumberOfVisitors

public int getMaximumNumberOfVisitors()

start

public void start(ElementStartContext context)
Description copied from class: ElementVisitor
Visit the start tag of an xml element.

This implementation does nothing.

Overrides:
start in class ElementVisitor
Parameters:
context - information about the xml start tag.

end

public void end(ElementEndContext context)
Description copied from class: ElementVisitor
Visit the end tag of an xml element.

This implementation does nothing.

Overrides:
end in class ElementVisitor
Parameters:
context - information about the xml end tag.

attachElementVisitor

public void attachElementVisitor(ElementVisitor elementVisitor)
When the XML data associated with the hook handler instance needs to be processed, call this method passing an ElementVisitor implementation. Before attachElementVisitor() returns, all of the recorded XML data will be replayed to the given ElementVisitor instance visitor methods (start/end). Once this method has been called, any additional XML data processed by the DeferredElementVisitorHookHandler will be immediately passed through to the attached ElementVisitor with no buffering. It is illegal to call this method more than once passing in different ElementVisitor instances.

Parameters:
elementVisitor -

getNumberOfAttachedVisitors

public int getNumberOfAttachedVisitors()

getAttachedVisitors

public java.util.List<ElementVisitor> getAttachedVisitors()

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

Copyright © 1997, 2011, Oracle. All rights reserved.