public synchronized String getOsisRef() { return ref.getOsisRef(); }
public String getOsisRef() { return ref.getOsisRef(); }
@Override public boolean equals(Object obj) { // This is cheating because I am supposed to say: // <code>!obj.getClass().equals(this.getClass())</code> // However I think it is entirely valid for a RangedPassage // to equal a DistinctPassage since the point of the Factory // is that the user does not need to know the actual type of the // Object he is using. if (!(obj instanceof Passage)) { return false; } Passage that = (Passage) obj; // The real test // FIXME: this is not really true since the versification any longer. return that.getOsisRef().equals(getOsisRef()); }
out.println(String.format("\t[%s]", this.absentVerses.getOsisRef())); out.println(" ******************************"); out.println(" Backwards mappings from KJV"); entry.getKey().toString(), nonKjvName, entry.getValue().getOsisRef()));
public void updateOsisStack(Book book, Key key, LinkedList<Content> stack) { Element ele = OSIS_FACTORY.createReference(); String refstr = getName().substring(2); try { Passage ref = (Passage) book.getKey(refstr); ele.setAttribute(OSISUtil.OSIS_ATTR_REF, ref.getOsisRef()); } catch (NoSuchKeyException ex) { DataPolice.report(book, key, "unable to parse reference: " + refstr); } GBFTags.updateOsisStack(stack, ele); } }
@Override public void processContent(Book book, Key key, Element ele) { String refstr = ele.getValue(); try { if (ele.getAttribute(OSISUtil.OSIS_ATTR_REF) == null) { Passage ref = PassageKeyFactory.instance().getKey(KeyUtil.getVersification(key), refstr, key); String osisname = ref.getOsisRef(); ele.setAttribute(OSISUtil.OSIS_ATTR_REF, osisname); } } catch (NoSuchKeyException ex) { DataPolice.report(book, key, "scripRef has no passage attribute, unable to guess: (" + refstr + ") due to " + ex.getMessage()); } } }
@Override public Element processTag(Book book, Key key, Element ele, Attributes attrs) { Element reference = null; String refstr = attrs.getValue("passage"); if (refstr != null) { Passage ref = null; try { ref = PassageKeyFactory.instance().getKey(KeyUtil.getVersification(key), refstr, key); } catch (NoSuchKeyException ex) { DataPolice.report(book, key, "Unparsable passage: (" + refstr + ") due to " + ex.getMessage()); } // If we don't have a Passage then use the original string String osisname = ref != null ? ref.getOsisRef() : refstr; reference = OSISUtil.factory().createReference(); reference.setAttribute(OSISUtil.OSIS_ATTR_REF, osisname); } else { // The reference will be filled in by processContent reference = OSISUtil.factory().createReference(); } if (ele != null) { ele.addContent(reference); } return reference; }