public Object start(final String uri, final String localName,
final Attributes attrs, final ExtensibleXmlParser parser)
throws SAXException {
parser.startElementBuilder(localName, attrs);
DataStore store = new DataStore();
store.setId(attrs.getValue("id"));
store.setName(attrs.getValue("name"));
final String itemSubjectRef = attrs.getValue("itemSubjectRef");
store.setItemSubjectRef(itemSubjectRef);
Map<String, ItemDefinition> itemDefinitions = (Map<String, ItemDefinition>)
((ProcessBuildData) parser.getData()).getMetaData("ItemDefinitions");
// retrieve type from item definition
//FIXME we bypass namespace resolving here. That's not a good idea
// when we start having several documents, with imports.
String localItemSubjectRef = itemSubjectRef.substring(
itemSubjectRef.indexOf(":") +1);
DataType dataType = new ObjectDataType();
if (itemDefinitions != null) {
ItemDefinition itemDefinition = itemDefinitions.get(localItemSubjectRef);
if (itemDefinition != null) {
dataType = new ObjectDataType(itemDefinition.getStructureRef());
}
}
store.setType(dataType);
Definitions parent = (Definitions) parser.getParent();
List<DataStore> dataStores = parent.getDataStores();
if (dataStores == null) {
dataStores = new ArrayList<DataStore>();