java.lang.Object
org.outerj.pollo.xmleditor.schema.MsvSchema
- All Implemented Interfaces:
- ISchema
- public class MsvSchema
- extends java.lang.Object
- implements ISchema
An ISchema implementation using MSV. The schema is read and then flattend
out to the same level as the BasicSchema implementation, meaning information
about content model, required attributes, etc. is ignored. The MSV grammar
is kept however for doing validation (FIXME note to myself: these need to be
cached and shared between open files).
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
namespaceContext
protected SimpleNamespaceContext namespaceContext
elementSchemas
protected org.outerj.pollo.xmleditor.util.NodeMap elementSchemas
source
protected java.lang.String source
grammar
protected Grammar grammar
verifier
protected org.outerj.pollo.xmleditor.schema.msv.PolloMsvVerifier verifier
errorHandler
protected MsvSchema.MsvSchemaErrorHandler errorHandler
MsvSchema
public MsvSchema()
init
protected void init(java.util.HashMap initParams)
throws java.lang.Exception
- Builds elementSchemas NodeMap (as with Basic Schema).
getNameParts
private final java.lang.String[] getNameParts(NameClass nameClass)
getAttributesFor
public java.util.Collection getAttributesFor(org.w3c.dom.Element element)
- Returns the list of attributes an element can have.
- Specified by:
getAttributesFor in interface ISchema
isChildAllowed
public boolean isChildAllowed(org.w3c.dom.Element parent,
org.w3c.dom.Element child)
- Returns true if the element child is allowed as child
of the element parent.
- Specified by:
isChildAllowed in interface ISchema
getPossibleAttributeValues
public java.lang.String[] getPossibleAttributeValues(org.w3c.dom.Element element,
java.lang.String namespaceURI,
java.lang.String localName)
- Returns an array containing a list of possible values an attribute can have,
or null if such a list is not available.
- Specified by:
getPossibleAttributeValues in interface ISchema
getAllowedSubElements
public java.util.Collection getAllowedSubElements(org.w3c.dom.Element element)
- Specified by:
getAllowedSubElements in interface ISchema
getAllowedSubTexts
public java.util.Collection getAllowedSubTexts(org.w3c.dom.Element element)
- Specified by:
getAllowedSubTexts in interface ISchema
getElementSchema
protected ElementSchema getElementSchema(java.lang.String namespaceURI,
java.lang.String localName)
getAttributeSchema
protected AttributeSchema getAttributeSchema(org.w3c.dom.Element element,
java.lang.String namespaceURI,
java.lang.String localName)
validate
public java.util.Collection validate(org.w3c.dom.Document document)
throws ValidationNotSupportedException,
java.lang.Exception
- Specified by:
validate in interface ISchema
getExpression
public Expression getExpression(org.w3c.dom.Document document,
org.w3c.dom.Element element)
throws java.lang.Exception
- Verifies the document up to the given element, and then returns the
Expression describing the content model that the verifiers expects
for that element.
Implementation note: this depends on the classes PolloMsvVerifier and
SAXEventGenerator to stop the validation at a certain node.
initializeVerifier
protected void initializeVerifier()