Skip navigation links

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

E17493-03


javax.ide.extension
Class ElementVisitor

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

Direct Known Subclasses:
BooleanVisitor, ExtensionHook, HashStructureElementVisitor, I18NCharVisitor, I18NStringVisitor, IconVisitor, MetaClassVisitor, OnDemandElementVisitor, URLPathHandler

public abstract class ElementVisitor
extends java.lang.Object

ElementVisitor is responsible for visiting elements in an XML file processed by an XML parser used by a JSR-198 compatible IDE. Implementations of this class usually provide an implementation for the start() and end() methods.


Nested Class Summary
static interface ElementVisitor.ResourceBundleProvider
          A class that creates the ResourceBundle instance.

 

Field Summary
static java.lang.String KEY_LOCATOR
          A key that provides information about the position in the manifest file currently being processed.

 

Constructor Summary
ElementVisitor()
           

 

Method Summary
 void end(ElementEndContext context)
          Visit the end tag of an xml element.
protected  java.lang.String getAttributeHelper(ElementStartContext context, java.lang.String attributeName, boolean trim, boolean logErrorIfMissing)
           
static java.lang.ClassLoader getClassLoader(ElementContext context)
          Gets the class loader to use in the specified context.
protected  java.lang.ClassLoader getMetaClassLoader(ElementContext context)
           
static java.util.ResourceBundle getResourceBundle(ElementContext context)
          Gets the resource bundle (if any) to be used for translatable resources in the specified context.
static ElementVisitor.ResourceBundleProvider getResourceBundleProvider()
           
protected  java.lang.String getTextHelper(ElementEndContext context, boolean trim, boolean logErrorIfMissing)
           
protected  void log(ElementContext context, java.util.logging.Level level, java.lang.String msg)
          Log a message.
protected  void log(ElementContext context, java.util.logging.Level level, java.lang.String msg, java.lang.Object... parameters)
          Log a message.
static void setResourceBundleProvider(ElementVisitor.ResourceBundleProvider resBundleProvider)
           
 void start(ElementStartContext context)
          Visit the start tag of an xml element.

 

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

 

Field Detail

KEY_LOCATOR

public static final java.lang.String KEY_LOCATOR
A key that provides information about the position in the manifest file currently being processed. In the scope data map, this key will resolve to an instance of org.xml.sax.Locator, if the parser supports it.

You should always check whether the locator is null, since it is not required that every IDE provide a Locator in the parsing context.

See Also:
Constant Field Values

Constructor Detail

ElementVisitor

public ElementVisitor()

Method Detail

log

protected final void log(ElementContext context,
                         java.util.logging.Level level,
                         java.lang.String msg)
Log a message. This is the recommended way to log errors while processing elements in the manifest file. It will ensure that positional information (if available) is passed to the logger as the first parameter of the log message.
Parameters:
context - the current context.
level - the level to log at.
msg - the message to log.

log

protected final void log(ElementContext context,
                         java.util.logging.Level level,
                         java.lang.String msg,
                         java.lang.Object... parameters)
Log a message. This is the recommended way to log errors while processing elements in the manifest file. It will ensure that positional information (if available) is passed to the logger as the first parameter of the log message.
Parameters:
context - the current context.
level - the level to log at.
msg - the message to log.
parameters - one or more parameters for the message.

start

public void start(ElementStartContext context)
Visit the start tag of an xml element.

This implementation does nothing.

Parameters:
context - information about the xml start tag.

end

public void end(ElementEndContext context)
Visit the end tag of an xml element.

This implementation does nothing.

Parameters:
context - information about the xml end tag.

getClassLoader

public static final java.lang.ClassLoader getClassLoader(ElementContext context)
Gets the class loader to use in the specified context.
Parameters:
context - the context.
Returns:
the class loader to use in this context. Never returns null.
Since:
2.0

getResourceBundle

public static final java.util.ResourceBundle getResourceBundle(ElementContext context)
Gets the resource bundle (if any) to be used for translatable resources in the specified context.
Parameters:
context - a processing context.
Returns:
the resource bundle instance to use for this context, or null if none is available.
Since:
2.0

getAttributeHelper

protected java.lang.String getAttributeHelper(ElementStartContext context,
                                              java.lang.String attributeName,
                                              boolean trim,
                                              boolean logErrorIfMissing)

getTextHelper

protected java.lang.String getTextHelper(ElementEndContext context,
                                         boolean trim,
                                         boolean logErrorIfMissing)

setResourceBundleProvider

public static void setResourceBundleProvider(ElementVisitor.ResourceBundleProvider resBundleProvider)

getResourceBundleProvider

public static ElementVisitor.ResourceBundleProvider getResourceBundleProvider()

getMetaClassLoader

protected java.lang.ClassLoader getMetaClassLoader(ElementContext context)

Skip navigation links

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

E17493-03


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