}
public CullHandler getHandler(String name, org.xml.sax.Attributes attributes) throws SAXException {
PropertyDescriptor pd = cd.getProperty(name);
if (pd == null) {
throw new SAXParseException("cull type " + cd.getCullName() + " has no property " + name, locator);
} if (pd instanceof SimplePropertyDescriptor) {
if (pd.getPropertyType().isPrimitive() || pd.getPropertyType().equals(String.class)) {
return new SimplePropertyHandler(this, (SimplePropertyDescriptor)pd);
} else {
return new ObjectPropertyHandler(this, (SimplePropertyDescriptor)pd);
}
} else if (pd instanceof ListPropertyDescriptor) {
return new ListPropertyHandler(this, (ListPropertyDescriptor)pd);
} else if (pd instanceof MapPropertyDescriptor) {
return new MapPropertyHandler(this, (MapPropertyDescriptor)pd, attributes);
} else if (pd instanceof MapListPropertyDescriptor) {
return new MapListPropertyHandler(this, (MapListPropertyDescriptor)pd, attributes);
} else {
throw new SAXParseException("Unknown property type " + pd.getClass(), locator);
}
}