Top Description Fields Constructors Methods
com.sun.msv.relaxns.verifier

public Class AnyOtherElementVerifier

extends DefaultHandler
implements IslandVerifier
Class Inheritance
All Implemented Interfaces
org.iso_relax.dispatcher.IslandVerifier, org.xml.sax.ContentHandler
Imports
org.iso_relax.dispatcher.Dispatcher, .ElementDecl, .IslandSchema, .IslandVerifier, org.xml.sax.Attributes, .Locator, .SAXException, .SAXParseException, org.xml.sax.helpers.DefaultHandler, com.sun.msv.relaxns.grammar.relax.AnyOtherElementExp

IslandVerifier that validates <anyOtherElement /> of RELAX.
Author
Kohsuke KAWAGUCHI

Field Summary

Modifier and TypeField and Description
protected Dispatcher
public static final String
private final AnyOtherElementExp[]
exps

this Verifier validates these expressions.

protected Locator

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
endChildIsland(String
namespace URI of the child island.
namespaceURI
,
ElementDecl[]
set of elementDecls that were successfully assigned to this child island. when every elementDecl was failed, then an empty array is passed.
rules
)

Implements org.iso_relax.dispatcher.IslandVerifier.endChildIsland.

this method is called after verification of the child island is completed, instead of endElement method.
public ElementDecl[]
endIsland()

Implements org.iso_relax.dispatcher.IslandVerifier.endIsland.

substitute for endDocument event.
public void
setDispatcher(Dispatcher disp)

Implements org.iso_relax.dispatcher.IslandVerifier.setDispatcher.

Dispatcher passes itself to IslandVerifier by calling this method from Dispatcher.switchVerifier method.
public void
setDocumentLocator(Locator
an object that can return the location of any SAX document event
loc
)

Overrides org.xml.sax.helpers.DefaultHandler.setDocumentLocator.

Implements org.xml.sax.ContentHandler.setDocumentLocator.

Receive an object for locating the origin of SAX document events.
public void
startElement(String
the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed
namespaceURI
,
String
the local name (without prefix), or the empty string if Namespace processing is not being performed
localName
,
String
the qualified name (with prefix), or the empty string if qualified names are not available
qName
,
Attributes
the attributes attached to the element. If there are no attributes, it shall be an empty Attributes object. The value of this object after startElement returns is undefined
atts
)

Overrides org.xml.sax.helpers.DefaultHandler.startElement.

Implements org.xml.sax.ContentHandler.startElement.

Receive notification of the beginning of an element.
Inherited from org.xml.sax.helpers.DefaultHandler:
charactersendDocumentendElementendPrefixMappingerrorfatalErrorignorableWhitespacenotationDeclprocessingInstructionresolveEntityskippedEntitystartDocumentstartPrefixMappingunparsedEntityDeclwarning

Field Detail

dispatcherback to summary
protected Dispatcher dispatcher
ERR_UNEXPECTED_NAMESPACEback to summary
public static final String ERR_UNEXPECTED_NAMESPACE
expsback to summary
private final AnyOtherElementExp[] exps

this Verifier validates these expressions. during validation, failed expression is removed.

locatorback to summary
protected Locator locator

Constructor Detail

AnyOtherElementVerifierback to summary
public AnyOtherElementVerifier(AnyOtherElementExp[] exps)

Method Detail

endChildIslandback to summary
public void endChildIsland(String namespaceURI, ElementDecl[] rules)

Implements org.iso_relax.dispatcher.IslandVerifier.endChildIsland.

Doc from org.iso_relax.dispatcher.IslandVerifier.endChildIsland.

this method is called after verification of the child island is completed, instead of endElement method.

Parameters
namespaceURI:String

namespace URI of the child island.

rules:ElementDecl[]

set of elementDecls that were successfully assigned to this child island. when every elementDecl was failed, then an empty array is passed.

endIslandback to summary
public ElementDecl[] endIsland()

Implements org.iso_relax.dispatcher.IslandVerifier.endIsland.

Doc from org.iso_relax.dispatcher.IslandVerifier.endIsland.

substitute for endDocument event. This method is called after endElement method is called for the top element in the island. endDocument method is never called for IslandVerifier.

Returns:ElementDecl[]

the callee must return all validated ElementDecls. If every candidate fails, return an empty array. It is the callee's responsibility to report an error. The callee may also recover from error. Never return null.

setDispatcherback to summary
public void setDispatcher(Dispatcher disp)

Implements org.iso_relax.dispatcher.IslandVerifier.setDispatcher.

Doc from org.iso_relax.dispatcher.IslandVerifier.setDispatcher.

Dispatcher passes itself to IslandVerifier by calling this method from Dispatcher.switchVerifier method.

setDocumentLocatorback to summary
public void setDocumentLocator(Locator loc)

Overrides org.xml.sax.helpers.DefaultHandler.setDocumentLocator.

Implements org.xml.sax.ContentHandler.setDocumentLocator.

Doc from org.xml.sax.ContentHandler.setDocumentLocator.

Receive an object for locating the origin of SAX document events.

SAX parsers are strongly encouraged (though not absolutely required) to supply a locator: if it does so, it must supply the locator to the application by invoking this method before invoking any of the other methods in the ContentHandler interface.

The locator allows the application to determine the end position of any document-related event, even if the parser is not reporting an error. Typically, the application will use this information for reporting its own errors (such as character content that does not match an application's business rules). The information returned by the locator is probably not sufficient for use with a search engine.

Note that the locator will return correct information only during the invocation SAX event callbacks after startDocument returns and before endDocument is called. The application should not attempt to use it at any other time.

Parameters
loc:Locator

an object that can return the location of any SAX document event

startElementback to summary
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.startElement.

Implements org.xml.sax.ContentHandler.startElement.

Doc from org.xml.sax.ContentHandler.startElement.

Receive notification of the beginning of an element.

The Parser will invoke this method at the beginning of every element in the XML document; there will be a corresponding endElement event for every startElement event (even when the element is empty). All of the element's content will be reported, in order, before the corresponding endElement event.

This event allows up to three name components for each element:

  1. the Namespace URI;
  2. the local name; and
  3. the qualified (prefixed) name.

Any or all of these may be provided, depending on the values of the http://xml.org/sax/features/namespaces and the http://xml.org/sax/features/namespace-prefixes properties:

  • the Namespace URI and local name are required when the namespaces property is true (the default), and are optional when the namespaces property is false (if one is specified, both must be);
  • the qualified name is required when the namespace-prefixes property is true, and is optional when the namespace-prefixes property is false (the default).

Note that the attribute list provided will contain only attributes with explicit values (specified or defaulted): #IMPLIED attributes will be omitted. The attribute list will contain attributes used for Namespace declarations (xmlns* attributes) only if the http://xml.org/sax/features/namespace-prefixes property is true (it is false by default, and support for a true value is optional).

Like characters(), attribute values may have characters that need more than one char value.

Parameters
namespaceURI:String

the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed

localName:String

the local name (without prefix), or the empty string if Namespace processing is not being performed

qName:String

the qualified name (with prefix), or the empty string if qualified names are not available

atts:Attributes

the attributes attached to the element. If there are no attributes, it shall be an empty Attributes object. The value of this object after startElement returns is undefined

Exceptions
SAXException:
any SAX exception, possibly wrapping another exception