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

E17493-02

javax.ide.extension
Class DeferredElementVisitorHook

java.lang.Object
  extended by javax.ide.extension.ElementVisitor
      extended by javax.ide.extension.ExtensionHook
          extended by javax.ide.extension.DeferredElementVisitorHook

public class DeferredElementVisitorHook
extends ExtensionHook

DeferredElementVisitorHook is a specialized hook handler class that helps clients with existing custom hook handlers convert to a lazier, pull based model. If DeferredElementVisitorHook 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 DeferredElementVisitorHook 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). DeferredElementVisitor 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, they will be directly passed to the attached ElementVisitor's start/end method with no buffering.


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
DeferredElementVisitorHook()
           
 
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.
 ElementVisitor getAttachedElementVisitor()
          Returns the attached ElementVisitor.
 boolean isElementVisitorAttached()
          Returns true if an ElementVisitor is attached
 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

DeferredElementVisitorHook

public DeferredElementVisitorHook()
Method Detail

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 -

isElementVisitorAttached

public boolean isElementVisitorAttached()
Returns true if an ElementVisitor is attached

Returns:
See Also:
attachElementVisitor(ElementVisitor)

getAttachedElementVisitor

public ElementVisitor getAttachedElementVisitor()
Returns the attached ElementVisitor.

Returns:
null if visitor is not attached.

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.