Attributes attrs, Map hints)
throws SAXException, SAXNotSupportedException {
if (element != null) {
if (element.getType() != this) {
if (!(element.getType() instanceof ComplexType)) {
ComplexType t = (ComplexType) element.getType();
while ((t != null) && (t != this))
t = (t.getParent() instanceof ComplexType)
? (ComplexType) t.getParent() : null;
if (t == null) {
throw new SAXNotSupportedException(
"The specified element was not a declared as a WFS_Capabilities element, or derived element");
}
} else {
// error -- cannot encode
throw new SAXNotSupportedException(
"The specified element was not a declared as a WFS_Capabilities element, or derived element");
}
}
}
boolean validation = true;
if(hints != null && hints.containsKey(DocumentFactory.VALIDATION_HINT)){
Boolean t = (Boolean)hints.get(DocumentFactory.VALIDATION_HINT);
if(t!=null)
validation = t.booleanValue();
}
if (validation && ((value == null) || (value.length != 4))) {
throw new SAXException(
"The WFS Capabilites document has the wrong number of children");