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

pack-priv Class TREXIslandVerifier

extends Verifier
implements IslandVerifier
Class Inheritance
All Implemented Interfaces
org.iso_relax.dispatcher.IslandVerifier, org.xml.sax.ContentHandler
Imports
java.util.Map, .Set, .Vector, org.iso_relax.dispatcher.Dispatcher, .ElementDecl, .IslandSchema, .IslandVerifier, org.xml.sax.Attributes, .SAXException, com.sun.msv.grammar.ElementExp, .Expression, com.sun.msv.relaxns.grammar.ExternalElementExp, com.sun.msv.relaxns.grammar.relax.AnyOtherElementExp, com.sun.msv.verifier.regexp.ComplexAcceptor, .REDocumentDeclaration, .SimpleAcceptor

IslandVerifier for RELAX Core and TREX.
Author
Kohsuke KAWAGUCHI

Field Summary

Modifier and TypeField and Description
protected Dispatcher
private String
private String
private String
protected final Map<ElementDecl, Expression>
rule2exp

lazily constructed map from Rule object to ExternalElementExp.

private Set<String>
Inherited from com.sun.msv.verifier.Verifier:
currentdocDeclERR_DUPLICATE_IDERR_MISSING_ATTRIBUTEERR_UNCOMPLETED_CONTENTERR_UNEXPECTED_ATTRIBUTEERR_UNEXPECTED_ELEMENTERR_UNEXPECTED_STARTTAGERR_UNEXPECTED_TEXTERR_UNSOLD_IDREFerrorHandlerhadErrorpanicLevel

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

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

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 boolean
isUnparsedEntity(String entityName)

Overrides com.sun.msv.verifier.AbstractVerifier.isUnparsedEntity.

Implements org.relaxng.datatype.ValidationContext.isUnparsedEntity.

Checks if an unparsed entity is declared with the specified name.
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
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 com.sun.msv.verifier.Verifier.startElement.

Implements org.xml.sax.ContentHandler.startElement.

Receive notification of the beginning of an element.
protected void
switchToAnyOtherElement(AnyOtherElementExp[] exps, String namespaceUri, String localName, String qName, Attributes atts)

switch to another IslandVerifier to validate anyOtherElement.

protected void
switchToChildIsland(ExternalElementExp[] exps, String namespaceUri, String localName, String qName, Attributes atts)

switch to another IslandVerifier.

Inherited from com.sun.msv.verifier.Verifier:
charactersendDocumentendElementfeedAttributegetCurrentElementTypegetErrorHandlergetLastCharacterTypeignorableWhitespaceinitisValidlocalizeMessageonDuplicateIdonErroronErroronNextAcceptorReadysetErrorHandlersetPanicModestartDocumentverifyText

Field Detail

dispatcherback to summary
protected Dispatcher dispatcher
lastLocalNameback to summary
private String lastLocalName
lastNamaespaceUriback to summary
private String lastNamaespaceUri
lastQNameback to summary
private String lastQName
rule2expback to summary
protected final Map<ElementDecl, Expression> rule2exp

lazily constructed map from Rule object to ExternalElementExp. Rule object r and ExternalElementExp whose rule field is r are registered to this map when child island is found. this map is used in endChildIsland method.

unparsedEntitiesback to summary
private Set<String> unparsedEntities

Hides com.sun.msv.verifier.AbstractVerifier.unparsedEntities.

set of unparsed entity names. this set is created on demand.

Constructor Detail

TREXIslandVerifierback to summary
pack-priv TREXIslandVerifier(RulesAcceptor initialAcceptor)

Method Detail

endChildIslandback to summary
public void endChildIsland(String childURI, ElementDecl[] ruleSet) throws SAXException

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
childURI:String

namespace URI of the child island.

ruleSet: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.

isUnparsedEntityback to summary
public boolean isUnparsedEntity(String entityName)

Overrides com.sun.msv.verifier.AbstractVerifier.isUnparsedEntity.

Implements org.relaxng.datatype.ValidationContext.isUnparsedEntity.

Doc from org.relaxng.datatype.ValidationContext.isUnparsedEntity.

Checks if an unparsed entity is declared with the specified name.

Returns:boolean

true if the DTD has an unparsed entity declaration for the specified name. false otherwise.

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.

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

Overrides com.sun.msv.verifier.Verifier.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
switchToAnyOtherElementback to summary
protected void switchToAnyOtherElement(AnyOtherElementExp[] exps, String namespaceUri, String localName, String qName, Attributes atts) throws SAXException

switch to another IslandVerifier to validate anyOtherElement.

switchToChildIslandback to summary
protected void switchToChildIsland(ExternalElementExp[] exps, String namespaceUri, String localName, String qName, Attributes atts) throws SAXException

switch to another IslandVerifier.