java.lang.Object
org.outerj.pollo.xmleditor.schema.BasicSchema
- All Implemented Interfaces:
- ISchema
- public class BasicSchema
- extends java.lang.Object
- implements ISchema
Simple schema implementation. This class can provide the following information:
- which attributes an element can have
- (optionally) a list of possible attribute values to select form
- which subelements an element can have
The schema information is read from an XML file with a custom syntax, for
an example see the sitemapschema.xml file.
| 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.NestedNodeMap elementSchemas
BasicSchema
public BasicSchema()
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
init
protected void init(java.util.HashMap initParams)
throws java.lang.Exception
addElementSchema
protected void addElementSchema(java.lang.String elementPath,
ElementSchema elementSchema,
org.outerj.pollo.xmleditor.util.NestedNodeMap.NamespaceResolver resolver)
throws java.lang.Exception
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
- Specified by:
validate in interface ISchema