throw new SAXException("StructMap must have TYPE fedora:dsBindingMap");
}
} else if (localName.equals("div")) {
if (m_indiv) {
// inner part of structmap
DSBinding binding = new DSBinding();
if (m_diss.dsBindMap.dsBindings == null) {
// none yet.. create array of size one
DSBinding[] bindings = new DSBinding[1];
m_diss.dsBindMap.dsBindings = bindings;
m_diss.dsBindMap.dsBindings[0] = binding;
} else {
// need to expand the array size by one,
// and do an array copy.
int curSize = m_diss.dsBindMap.dsBindings.length;
DSBinding[] oldArray = m_diss.dsBindMap.dsBindings;
DSBinding[] newArray = new DSBinding[curSize + 1];
for (int i = 0; i < curSize; i++) {
newArray[i] = oldArray[i];
}
newArray[curSize] = binding;
m_diss.dsBindMap.dsBindings = newArray;
}
// now populate 'binding' values...we'll have
// everything at this point except datastreamID...
// that comes as a child: <fptr FILEID="DS2"/>
binding.bindKeyName = grab(a, METS.uri, "TYPE");
binding.bindLabel = grab(a, METS.uri, "LABEL");
binding.seqNo = grab(a, METS.uri, "ORDER");
} else {
m_indiv = true;
// first (outer div) part of structmap
m_diss.dsBindMap.dsBindMechanismPID = grab(a, METS.uri, "TYPE");
m_diss.dsBindMap.dsBindMapLabel = grab(a, METS.uri, "LABEL");
}
} else if (localName.equals("fptr")) {
// assume we're inside the inner div... that's the
// only place the fptr element is valid.
DSBinding binding =
m_diss.dsBindMap.dsBindings[m_diss.dsBindMap.dsBindings.length - 1];
binding.datastreamID = grab(a, METS.uri, "FILEID");
} else if (localName.equals("behaviorSec")) {
// looks like we're in a disseminator... it should be in the
// hash by now because we've already gone through structmaps