Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.5.0)

E13403-06


oracle.ide.extension
Class HashStructureHook

java.lang.Object
  extended by javax.ide.extension.ElementVisitor
      extended by javax.ide.extension.ExtensionHook
          extended by oracle.ide.extension.HashStructureHook

Direct Known Subclasses:
ContextMenuListenersHook, FileSaveHook, ResourceBundleShapingPreferencesHook

public class HashStructureHook
extends ExtensionHook

Generic extension hook for unmarshalling extension manifest elements into a HashStructure. As a general rule, all elements are unmarshalled as HashStructure, and attributes are values in that HashStructure.

See HashStructureElementVisitor for details on how the extension manifest elements and attributes are unmarshalled into a HashStructure.

Since:
11.0

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
  HashStructureHook()
          Constructor invoked by the extension registry.
protected HashStructureHook(boolean countElementOrder)
          When a custom hook requires that the order of elements be kept by the hash structure, they should call this constructor to turn element counting on.

 

Method Summary
 void dispose()
          Frees all information stored by this hook.
 void end(ElementEndContext context)
          Visit the end tag of an xml element.
static java.lang.String getExtensionId(HashStructure context)
          Tries to find id of the extension that was responsible for populating the specified hash structure.
 HashStructure getHashStructure()
          Gets the hash structure constructed for this hook.
 java.util.Collection<NameValuePair<HashStructure>> getOrderedElements(HashStructure hash)
          Given a HashStructure representing a custom hook element that contains non-homogenous elements, get an ordered collection of hash structures encapsulating those elements.
static java.lang.String getText(HashStructure context)
          Gets the text content of some hash structure.
 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
getClassLoader, getResourceBundle, log

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

HashStructureHook

protected HashStructureHook(boolean countElementOrder)
When a custom hook requires that the order of elements be kept by the hash structure, they should call this constructor to turn element counting on.

Extension writers with custom hooks where element order matters must subclass this class and invoke this constructor from their constructor to turn on element counting.

Parameters:
countElementOrder - flag indicating whether to elements should be counted to record the order they appear in the extension manifest.

HashStructureHook

public HashStructureHook()
Constructor invoked by the extension registry. Must be public.

Method Detail

getHashStructure

public final HashStructure getHashStructure()
Gets the hash structure constructed for this hook.
Returns:
a hash structure. Will never be null.
Throws:
java.lang.IllegalStateException - if the dispose() method has been called.

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 final 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.

getExtensionId

public static final java.lang.String getExtensionId(HashStructure context)
Tries to find id of the extension that was responsible for populating the specified hash structure.
Parameters:
context - a HashStructure. Usually this will not be the HashStructure returned by the getHashStructure() method, because that is the root structure, and no single extension is responsible for it. Must not be null.
Returns:
the extension id responsible for providing the specified structure. If no extension was found in the specified context, this method will return null.

getText

public static final java.lang.String getText(HashStructure context)
Gets the text content of some hash structure. This is a (slightly safer) alternative to
context.getString( "#text" )
.
Parameters:
context - a HashStructure. Must not be null.
Returns:
the text of the specified hash structure. If no text is available, this method will return null.

dispose

public void dispose()
Frees all information stored by this hook. Calling the getHashStructure() method after dispose is not permitted, and will throw an IllegalStateException.

getOrderedElements

public java.util.Collection<NameValuePair<HashStructure>> getOrderedElements(HashStructure hash)
Given a HashStructure representing a custom hook element that contains non-homogenous elements, get an ordered collection of hash structures encapsulating those elements.
Parameters:
hash - the hash structure whose ordered elements are requested.
Returns:
an ordered list of hash structures. Returns an empty set if the element visitor does not have turnElementCounterOn set.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.5.0)

E13403-06


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