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

public abstract Class IslandSchemaImpl

extends Object
implements IslandSchema, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.iso_relax.dispatcher.IslandSchema
Known Direct Subclasses
com.sun.msv.relaxns.grammar.relax.RELAXIslandSchema, com.sun.msv.relaxns.grammar.trex.TREXIslandSchema
Annotations
@SuppressWarnings:serial
Imports
java.util.Iterator, .Map, .Set, org.iso_relax.dispatcher.AttributesDecl, .AttributesVerifier, .ElementDecl, .IslandSchema, .IslandVerifier, .SchemaProvider, org.xml.sax.ErrorHandler, .SAXException, .SAXParseException, com.sun.msv.grammar.AttributeExp, .ElementExp, .Expression, .ExpressionCloner, .ExpressionPool, .Grammar, .OtherExp, .ReferenceContainer, .ReferenceExp, com.sun.msv.relaxns.grammar.DeclImpl, .ExternalAttributeExp, .ExternalElementExp, com.sun.msv.verifier.regexp.REDocumentDeclaration

base implementation of IslandSchema for MSV. the iso_relax package doesn't have the distinction between AGM and VGM. For the safety, the implementation of the createNewVerifier method creates a new VGM everytime it is called. Fortunately, when all island schemas are from MSV, the application can simply treat RELAXGrammar as a normal Grammar object; there is no need to use Dispatcher nor any divide-and-validate framework. So createNewVerifier method is called only when In that case, the current createNewVerifier method causes a performance problem.
Author
Kohsuke KAWAGUCHI

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
IslandSchemaImpl.Binder

replaces all ExternalElementExp and ExternalAttributeExp by actual definitions.

Field Summary

Modifier and TypeField and Description
protected final Map<String, AttributesDecl>
attributesDecls

map from name to DeclImpl.

protected final Map<String, ElementDecl>
elementDecls

map from name to DeclImpl.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
public AttributesVerifier
createNewAttributesVerifier(String
namespace URI of the attributes, which is going to be validated by the newly created verifier.
namespaceURI
,
AttributesDecl[]
set of AttributesDecl objects that newly created verifier shall validate.
decls
)

Implements org.iso_relax.dispatcher.IslandSchema.createNewAttributesVerifier.

creates a new AttributesVerifier instance that is going to validate attribute declarations.
public IslandVerifier
createNewVerifier(String
namespace URI of the newly found element, which is going to be validated by the newly created IslandVerifier.
namespace
,
ElementDecl[]
set of ElementDecl objects that newly created verifier shall validate.
rules
)

Implements org.iso_relax.dispatcher.IslandSchema.createNewVerifier.

creates a new IslandVerifier instance that is going to validate one island.
public AttributesDecl
getAttributesDeclByName(String name)

Implements org.iso_relax.dispatcher.IslandSchema.getAttributesDeclByName.

gets exported AttributesDecl object that has specified name.
public AttributesDecl[]
getAttributesDecls()

Implements org.iso_relax.dispatcher.IslandSchema.getAttributesDecls.

returns all exported attributesDecl objects at once.
public ElementDecl
getElementDeclByName(String name)

Implements org.iso_relax.dispatcher.IslandSchema.getElementDeclByName.

gets exported elementDecl object that has specified name.
public ElementDecl[]
getElementDecls()

Implements org.iso_relax.dispatcher.IslandSchema.getElementDecls.

returns all exported elementDecl objects at once.
protected abstract Grammar
getGrammar()

get the grammar object that represents this island.

public Iterator<AttributesDecl>
iterateAttributesDecls()

Implements org.iso_relax.dispatcher.IslandSchema.iterateAttributesDecls.

iterates all exported attributesDecl objects.
public Iterator<ElementDecl>
iterateElementDecls()

Implements org.iso_relax.dispatcher.IslandSchema.iterateElementDecls.

iterates all exported elementDecl objects.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

attributesDeclsback to summary
protected final Map<String, AttributesDecl> attributesDecls

map from name to DeclImpl.

elementDeclsback to summary
protected final Map<String, ElementDecl> elementDecls

map from name to DeclImpl.

Constructor Detail

IslandSchemaImplback to summary
public IslandSchemaImpl()

Method Detail

bindback to summary
protected void bind(ReferenceContainer con, IslandSchemaImpl.Binder binder)
createNewAttributesVerifierback to summary
public AttributesVerifier createNewAttributesVerifier(String namespaceURI, AttributesDecl[] decls)

Implements org.iso_relax.dispatcher.IslandSchema.createNewAttributesVerifier.

Doc from org.iso_relax.dispatcher.IslandSchema.createNewAttributesVerifier.

creates a new AttributesVerifier instance that is going to validate attribute declarations.

Parameters
namespaceURI:String

namespace URI of the attributes, which is going to be validated by the newly created verifier.

decls:AttributesDecl[]

set of AttributesDecl objects that newly created verifier shall validate.

createNewVerifierback to summary
public IslandVerifier createNewVerifier(String namespace, ElementDecl[] rules)

Implements org.iso_relax.dispatcher.IslandSchema.createNewVerifier.

Doc from org.iso_relax.dispatcher.IslandSchema.createNewVerifier.

creates a new IslandVerifier instance that is going to validate one island.

Parameters
namespace:String

namespace URI of the newly found element, which is going to be validated by the newly created IslandVerifier.

rules:ElementDecl[]

set of ElementDecl objects that newly created verifier shall validate.

getAttributesDeclByNameback to summary
public AttributesDecl getAttributesDeclByName(String name)

Implements org.iso_relax.dispatcher.IslandSchema.getAttributesDeclByName.

Doc from org.iso_relax.dispatcher.IslandSchema.getAttributesDeclByName.

gets exported AttributesDecl object that has specified name.

Returns:AttributesDecl

null if no AttributesDecl is exported under the given name.

getAttributesDeclsback to summary
public AttributesDecl[] getAttributesDecls()

Implements org.iso_relax.dispatcher.IslandSchema.getAttributesDecls.

Doc from org.iso_relax.dispatcher.IslandSchema.getAttributesDecls.

returns all exported attributesDecl objects at once.

getElementDeclByNameback to summary
public ElementDecl getElementDeclByName(String name)

Implements org.iso_relax.dispatcher.IslandSchema.getElementDeclByName.

Doc from org.iso_relax.dispatcher.IslandSchema.getElementDeclByName.

gets exported elementDecl object that has specified name.

Returns:ElementDecl

null if no elementDecl is exported under the given name.

getElementDeclsback to summary
public ElementDecl[] getElementDecls()

Implements org.iso_relax.dispatcher.IslandSchema.getElementDecls.

Doc from org.iso_relax.dispatcher.IslandSchema.getElementDecls.

returns all exported elementDecl objects at once.

getGrammarback to summary
protected abstract Grammar getGrammar()

get the grammar object that represents this island.

iterateAttributesDeclsback to summary
public Iterator<AttributesDecl> iterateAttributesDecls()

Implements org.iso_relax.dispatcher.IslandSchema.iterateAttributesDecls.

Doc from org.iso_relax.dispatcher.IslandSchema.iterateAttributesDecls.

iterates all exported attributesDecl objects.

iterateElementDeclsback to summary
public Iterator<ElementDecl> iterateElementDecls()

Implements org.iso_relax.dispatcher.IslandSchema.iterateElementDecls.

Doc from org.iso_relax.dispatcher.IslandSchema.iterateElementDecls.

iterates all exported elementDecl objects.

com.sun.msv.relaxns.verifier back to summary

public Class IslandSchemaImpl.Binder

extends ExpressionCloner
Class Inheritance

replaces all ExternalElementExp and ExternalAttributeExp by actual definitions. these two expressions forms the fundamental mechanism of schema interaction.

Field Summary

Modifier and TypeField and Description
private final Set<Object>
public static final String
public static final String
public static final String
public static final String
protected final ErrorHandler
protected final SchemaProvider
Inherited from com.sun.msv.grammar.ExpressionCloner:
pool

Constructor Summary

AccessConstructor and Description
public
Binder(SchemaProvider provider, ErrorHandler errorHandler, ExpressionPool pool)

Method Summary

Modifier and TypeMethod and Description
public String
localize(String propertyName, Object[] args)

localizes messages.

public String
public String
localize(String prop, Object arg1)

public String
localize(String prop, Object arg1, Object arg2)

public Expression
public Expression
public Expression
public Expression
Inherited from com.sun.msv.grammar.ExpressionCloner:
onAnyStringonChoiceonConcuronDataonEpsilononInterleaveonListonMixedonNullSetonOneOrMoreonSequenceonValue

Field Detail

boundElementsback to summary
private final Set<Object> boundElements
ERR_UNDEFINED_NAMESPACEback to summary
public static final String ERR_UNDEFINED_NAMESPACE
ERR_UNEXPORTED_ATTRIBUTE_DECLback to summary
public static final String ERR_UNEXPORTED_ATTRIBUTE_DECL
ERR_UNEXPORTED_ELEMENT_DECLback to summary
public static final String ERR_UNEXPORTED_ELEMENT_DECL
ERR_UNSUPPROTED_ATTRIBUTES_IMPORTback to summary
public static final String ERR_UNSUPPROTED_ATTRIBUTES_IMPORT
errorHandlerback to summary
protected final ErrorHandler errorHandler
providerback to summary
protected final SchemaProvider provider

Constructor Detail

Binderback to summary
public Binder(SchemaProvider provider, ErrorHandler errorHandler, ExpressionPool pool)

Method Detail

localizeback to summary
public String localize(String propertyName, Object[] args)

localizes messages. derived class can override this method to provide schema languagespecific error messages.

localizeback to summary
public String localize(String prop)
localizeback to summary
public String localize(String prop, Object arg1)
localizeback to summary
public String localize(String prop, Object arg1, Object arg2)
onAttributeback to summary
public Expression onAttribute(AttributeExp exp)

Implements com.sun.msv.grammar.ExpressionVisitorExpression.onAttribute.

onElementback to summary
public Expression onElement(ElementExp exp)

Implements com.sun.msv.grammar.ExpressionVisitorExpression.onElement.

onOtherback to summary
public Expression onOther(OtherExp exp)

Implements com.sun.msv.grammar.ExpressionVisitorExpression.onOther.

onRefback to summary
public Expression onRef(ReferenceExp exp)

Implements com.sun.msv.grammar.ExpressionVisitorExpression.onRef.