Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.share.xml
Class BaseNodeParser

java.lang.Object
  |
  +--oracle.cabo.share.xml.BaseNodeParser
All Implemented Interfaces:
NodeParser
Direct Known Subclasses:
BaseGroupingParser, BaseImageProviderRequestParser, BeanParser, ColorNodeParser, ColorSchemeNodeParser, CompoundPropertyNodeParser, CSSStyleParser, DataObjectParser, FontParser, GroupingBoundValueParser, HelpProviderConfigParser, ImageGeneratorParser, ImageMapParser, ImageMetadataParser, LeafNodeParser, PropertyNodeParser, RepeatingUINodeListParser, StringParser, StyleNodeParser, StyleSheetDocumentParser, StyleSheetNodeParser, TabParser, TemplateDefinitionParser, TemplateLibraryParser, TextParser, UIExtensionsConfigParser, UINodeParser, ValueNodeParser

public class BaseNodeParser
extends java.lang.Object
implements NodeParser

A base implementation of NodeParser that performs no actions at all. Clients can use this as a base class for their node parsers, or as a way to ignore an element (and all of its children).


Constructor Summary
BaseNodeParser()
           
 
Method Summary
 void addCompletedChild(ParseContext context, java.lang.String namespaceURI, java.lang.String localName, java.lang.Object child)
          Receives notification of the end of a delegated child element.
 void addText(ParseContext context, char[] text, int start, int length)
          Receives notification of text content of this element.
 void addWhitespace(ParseContext context, char[] text, int start, int length)
          Receives notification of ignorable whitespace.
 void endChildElement(ParseContext context, java.lang.String namespaceURI, java.lang.String localName)
          Receives notification of the end of a child element; called only if startChildElement returned "this".
 java.lang.Object endElement(ParseContext context, java.lang.String namespaceURI, java.lang.String localName)
          Receives notification of the end of the element.
static NodeParser getIgnoreParser()
          Returns a shared instance of this class.
protected  java.lang.String getRequiredAttribute(ParseContext context, org.xml.sax.Attributes attrs, java.lang.String qName)
          Get the value of an attribute; if not found, send a warning to the error log.
protected  void logError(ParseContext context, java.lang.String message, java.lang.Exception e)
           
protected  void logUnexpectedAttribute(ParseContext context, java.lang.String qName)
           
protected  void logUnexpectedElement(ParseContext context, java.lang.String namespaceURI, java.lang.String localName)
           
protected  void logWarning(ParseContext context, java.lang.String message)
           
protected  void logWarning(ParseContext context, java.lang.String message, java.lang.Exception e)
           
 NodeParser startChildElement(ParseContext context, java.lang.String namespaceURI, java.lang.String localName, org.xml.sax.Attributes attrs)
          Receives notification of the start of a child element.
 void startElement(ParseContext context, java.lang.String namespaceURI, java.lang.String localName, org.xml.sax.Attributes attrs)
          Receives notification of the start of an element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseNodeParser

public BaseNodeParser()
Method Detail

getIgnoreParser

public static NodeParser getIgnoreParser()
Returns a shared instance of this class. The instance may be used anywhere that a node and all of its children should be ignored (because of an error, for instance)

startElement

public void startElement(ParseContext context,
                         java.lang.String namespaceURI,
                         java.lang.String localName,
                         org.xml.sax.Attributes attrs)
                  throws org.xml.sax.SAXParseException
Description copied from interface: NodeParser
Receives notification of the start of an element.
Specified by:
startElement in interface NodeParser
Following copied from interface: oracle.cabo.share.xml.NodeParser
Parameters:
context - the parsing context
namespaceURI - the namespace of the element
localName - the local name of the element
attrs - the attributes attached to the element

endElement

public java.lang.Object endElement(ParseContext context,
                                   java.lang.String namespaceURI,
                                   java.lang.String localName)
                            throws org.xml.sax.SAXParseException
Description copied from interface: NodeParser
Receives notification of the end of the element.
Specified by:
endElement in interface NodeParser
Following copied from interface: oracle.cabo.share.xml.NodeParser
Parameters:
context - the parsing context
namespaceURI - the namespace of the element
localName - the local name of the element
Returns:
the fully-initialized Java object corresponding to this release

startChildElement

public NodeParser startChildElement(ParseContext context,
                                    java.lang.String namespaceURI,
                                    java.lang.String localName,
                                    org.xml.sax.Attributes attrs)
                             throws org.xml.sax.SAXParseException
Description copied from interface: NodeParser
Receives notification of the start of a child element. If this method returns "this", further processing of that child element will be continue with this same parser. If it returns "null", the element will be ignored, and a warning logged. Otherwise, handling will be delegated to the new parser, and the next call made to this interface will be addCompletedChild()

Specified by:
startChildElement in interface NodeParser
Following copied from interface: oracle.cabo.share.xml.NodeParser
Parameters:
context - the parsing context
namespaceURI - the namespace of the child element
localName - the local name of the child element
attrs - the attributes attached to the element
Returns:
the node parser that should be used for this child element, or null if processing should continue with this NodeParser
See Also:
NodeParser.endChildElement(oracle.cabo.share.xml.ParseContext, java.lang.String, java.lang.String), NodeParser.addCompletedChild(oracle.cabo.share.xml.ParseContext, java.lang.String, java.lang.String, java.lang.Object)

endChildElement

public void endChildElement(ParseContext context,
                            java.lang.String namespaceURI,
                            java.lang.String localName)
                     throws org.xml.sax.SAXParseException
Description copied from interface: NodeParser
Receives notification of the end of a child element; called only if startChildElement returned "this".

Specified by:
endChildElement in interface NodeParser
Following copied from interface: oracle.cabo.share.xml.NodeParser
Parameters:
context - the parsing context
namespaceURI - the namespace of the child element
localName - the local name of the child element

addCompletedChild

public void addCompletedChild(ParseContext context,
                              java.lang.String namespaceURI,
                              java.lang.String localName,
                              java.lang.Object child)
                       throws org.xml.sax.SAXParseException
Description copied from interface: NodeParser
Receives notification of the end of a delegated child element. Called only if startChildElement returns a value other than "null" or "this".

Specified by:
addCompletedChild in interface NodeParser
Following copied from interface: oracle.cabo.share.xml.NodeParser
Parameters:
context - the parsing context
namespaceURI - the namespace of the child element
localName - the local name of the child element
child - the Java object produced for that child by its NodeParser's endElement() method.
See Also:
NodeParser.endElement(oracle.cabo.share.xml.ParseContext, java.lang.String, java.lang.String)

addText

public void addText(ParseContext context,
                    char[] text,
                    int start,
                    int length)
             throws org.xml.sax.SAXParseException
Description copied from interface: NodeParser
Receives notification of text content of this element.
Specified by:
addText in interface NodeParser
Following copied from interface: oracle.cabo.share.xml.NodeParser
Parameters:
context - the parsing context
text - an array of characters
start - the start position in the array
length - the number of characters to read from the array

getRequiredAttribute

protected final java.lang.String getRequiredAttribute(ParseContext context,
                                                      org.xml.sax.Attributes attrs,
                                                      java.lang.String qName)
Get the value of an attribute; if not found, send a warning to the error log.
Parameters:
context - the ParseContext
attrs - the SAX2 attribute list
qName - the XML 1.0 qualified name of the attribute

addWhitespace

public void addWhitespace(ParseContext context,
                          char[] text,
                          int start,
                          int length)
                   throws org.xml.sax.SAXParseException
Description copied from interface: NodeParser
Receives notification of ignorable whitespace.
Specified by:
addWhitespace in interface NodeParser
Following copied from interface: oracle.cabo.share.xml.NodeParser
Parameters:
context - the parsing context
text - an array of characters
start - the start position in the array
length - the number of characters to read from the array

logWarning

protected final void logWarning(ParseContext context,
                                java.lang.String message)

logWarning

protected void logWarning(ParseContext context,
                          java.lang.String message,
                          java.lang.Exception e)

logError

protected void logError(ParseContext context,
                        java.lang.String message,
                        java.lang.Exception e)
                 throws org.xml.sax.SAXParseException

logUnexpectedElement

protected void logUnexpectedElement(ParseContext context,
                                    java.lang.String namespaceURI,
                                    java.lang.String localName)

logUnexpectedAttribute

protected void logUnexpectedAttribute(ParseContext context,
                                      java.lang.String qName)

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

Copyright © 2002,2003, Oracle. All Rights Reserved.