Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.crosswire.jsword.passage
Class OsisParser

    java.lang.Object
      org.crosswire.jsword.passage.OsisParser

    public final class OsisParser

extends Object

The Osis ID parser simply assumes 1-3 parts divided by '.'. Any deviation from the dot-delimited formatted yields nulls. OSIS Refs should be separated by a '-' if there are 2 refs signifying a range e.g. Gen.1-Gen.3. The current implementation doesn't support an OSIS ID or OSIS ref with a missing chapter, as are currently returned by the getOsisRef() calls occasionally. Algorithm: If ony 1 ID passed in then create ending id from it to enable a single flow through algorithm. Missing chapter or verse of starting id will be set to 0/1. Missing chapter or verse of ending id will be set to last chapter/verse.

Author:
  chrisburrell, mjdenham

Field Summary
`private static String` | `START_CHAPTER_OR_VERSE`

Constructor Summary
`OsisParser()`

Method Summary
`private static boolean` | `isAnEmptyPart(List<String> parts)` Check no part of the Osis ref is empty
`private Verse` | `parseOsisID(Versification v11n, List<String> osisIDParts)`
`Verse` | `parseOsisID(Versification v11n, String osisID)` Strict OSIS ID parsers, case-sensitive
`VerseRange` | `parseOsisRef(Versification v11n, String osisRef)` String OSIS Ref parser, assumes a - separating two osis IDs
`private List<String>` | `splitOsisId(String osisID1)` Split string like 'Gen.1.1' into a 3 element list

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### START_CHAPTER_OR_VERSE

    private static final String START_CHAPTER_OR_VERSE

See Also:
  Constant Field Values

Constructor Detail

### OsisParser

    public OsisParser()

Method Detail

### parseOsisRef

    public VerseRange parseOsisRef(Versification v11n,
                                   String osisRef)

  String OSIS Ref parser, assumes a - separating two osis IDs

  Parameters:
    `v11n` - the v11n
    `osisRef` - the ref
  Returns:
    the equivalent verse range

### parseOsisID

    public Verse parseOsisID(Versification v11n,
                             String osisID)

  Strict OSIS ID parsers, case-sensitive

  Parameters:
    `v11n` - the versification to use when constructing the verse
    `osisID` - the ID we want to parse
  Returns:
    the verse that matches the OSIS ID

### parseOsisID

    private Verse parseOsisID(Versification v11n,
                              List<String> osisIDParts)

### splitOsisId

    private List<String> splitOsisId(String osisID1)

  Split string like 'Gen.1.1' into a 3 element list

### isAnEmptyPart

    private static boolean isAnEmptyPart(List<String> parts)

  Check no part of the Osis ref is empty

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Copyright ¨ 2003-2015
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD