/**
* Add an Resolvable object with an unresolved idref
* @param idref the idref whose target id has not yet been located
- * @param res the Resolvable object with the unresolved idref
+ * @param res the Resolvable object needing the idref to be resolved
*/
public void addUnresolvedIDRef(String idref, Resolvable res) {
Set todo = (Set) unresolvedIDRefs.get(idref);
* @throws SAXException if there is some error
*/
public void endDocument() throws SAXException {
- // deal with unresolved references
+ /*
+ * inform Resolveable objects that certain idrefs
+ * could not be found
+ * @todo unsure if this block is needed.
+ */
for (Iterator iter = unresolvedIDRefs.keySet().iterator();
iter.hasNext();) {
- String id = (String)iter.next();
- Set list = (Set) unresolvedIDRefs.get(id);
+ String idref = (String) iter.next();
+ Set list = (Set) unresolvedIDRefs.get(idref);
for (Iterator resIter = list.iterator(); resIter.hasNext();) {
- Resolvable res = (Resolvable)resIter.next();
+ Resolvable res = (Resolvable) resIter.next();
if (!res.isResolved()) {
- res.resolveIDRef(id, null);
+ res.resolveIDRef(idref, null);
}
}
}
* Resolve by adding an internal link.
*/
public void resolveIDRef(String id, List pages) {
- resolved = true;
if (idRef.equals(id) && pages != null) {
+ resolved = true;
PageViewport page = (PageViewport)pages.get(0);
area.addTrait(Trait.INTERNAL_LINK, page.getKey());
}
String[] getIDs();
/**
- * This method provides the opportunity for a Resolvable object
- * to resolve one of its unresolved idrefs with the actual set of
- * PageViewports containing the target ID.
+ * This method allows the Resolvable object to resolve one of
+ * its unresolved idrefs with the actual set of PageViewports
+ * containing the target ID. The Resolvable object initially
+ * identifies to the AreaTreeHandler which idrefs it needs
+ * resolved. After the idrefs are resolved, the ATH calls this
+ * method to allow the Resolvable object to update itself with
+ * the PageViewport information.
*
- * @param id an ID possibly matching one of the Resolvable object's
+ * @param id an ID matching one of the Resolvable object's
* unresolved idref's.
* @param pages the list of PageViewports with the given ID
* may be null if ID is not tied to any
*
* @param id the id associated with the pages parameter
* @param pages the list of PageViewports associated with this ID
- * @todo determine why the ID passed in will (always?) equal the pageIDRef,
- * explain in comments above
*/
public void resolveIDRef(String id, List pages) {
- resolved = true;
if (pages != null) {
+ resolved = true;
PageViewport page = (PageViewport)pages.get(0);
String str = page.getPageNumber();
text = str;
-
/**@todo Update IPD ??? */
}
}