|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--org.xml.sax.helpers.DefaultHandler
|
+--Catalog
Parses a corpus catalog file and supplies name resolution service.
| Inner Class Summary | |
protected class |
Catalog.SlaveMatch
Associates a slave text and matching data. |
| Field Summary | |
static java.lang.String |
HOST
|
static java.lang.String |
MAGIC
|
static java.lang.String |
MAGIC_2
|
static java.lang.String |
PREFIX
|
| Constructor Summary | |
Catalog()
|
|
| Method Summary | |
boolean |
add(java.lang.String locator,
java.lang.String location,
java.lang.String type,
java.lang.String author,
java.lang.String title,
ArborAgent agent)
Adds an entry to the mapping table. |
void |
characters(char[] ch,
int start,
int length)
This is part of the ContentHandler interface. |
boolean |
checkForSaves(ArborAgent agent)
Queries the user on application close if unsaved changes have been made to the generated catalog. |
void |
clear()
Clears the name resolution mapping table. |
void |
endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName)
This is part of the ContentHandler interface. |
java.net.URL |
getRealDocBase(ContentOwner owner)
Returns the real (devirtualized) docBase for a ContentOwner. |
Catalog.SlaveMatch |
getSlaveMatch(java.lang.String locator,
int index)
Returns the SlaveMatch corresponding to a given index
for a specified text. |
java.lang.String[] |
getSlaveTitlesFor(java.lang.String locator)
Returns an array of slave text titles for a given text. |
boolean |
isDirty()
Returns a boolean value indicating whether the catalog is dirty. |
int |
parse(java.lang.String location)
Parses the catalog file. |
int |
parse(java.lang.String location,
boolean ignoreErrors)
Parses the catalog file. |
boolean |
seen(java.lang.String location)
Returns true if the specified catalog file has been seen. |
void |
serialize(java.io.File file,
ArborAgent agent)
Serializes the generated catalog entries as XML. |
int |
size()
Returns the number of entries in the catalog. |
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes atts)
This is part of the ContentHandler interface. |
java.lang.String |
translate(java.lang.String canonical)
Translates a canonical into an actual URI (string representations). |
java.net.URL |
translate(java.net.URL canonical)
Translates a canonical into an actual URI object. |
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String HOST
public static final java.lang.String PREFIX
public static final java.lang.String MAGIC
public static final java.lang.String MAGIC_2
| Constructor Detail |
public Catalog()
| Method Detail |
public void startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes atts)
throws org.xml.sax.SAXException
ContentHandler interface.startElement in class org.xml.sax.helpers.DefaultHandler
public void endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName)
throws org.xml.sax.SAXException
ContentHandler interface.endElement in class org.xml.sax.helpers.DefaultHandler
public void characters(char[] ch,
int start,
int length)
ContentHandler interface.characters in class org.xml.sax.helpers.DefaultHandler
public int parse(java.lang.String location,
boolean ignoreErrors)
location - catalog file URLignoreErrors - be silent about errorspublic int parse(java.lang.String location)
location - catalog file URLpublic boolean seen(java.lang.String location)
location - location URLpublic void clear()
public java.lang.String translate(java.lang.String canonical)
canonical - canonical URI
public java.net.URL translate(java.net.URL canonical)
throws java.net.MalformedURLException
canonical - canonical URIpublic java.net.URL getRealDocBase(ContentOwner owner)
ContentOwner.owner - ContentOwner
public boolean add(java.lang.String locator,
java.lang.String location,
java.lang.String type,
java.lang.String author,
java.lang.String title,
ArborAgent agent)
generated), which can be serialized.locator - the locator (virtual URI)location - the location (actual URL)type - type descriptorauthor - author metadata (may be null)title - title metadata (may be null)agent - ArborAgent
public void serialize(java.io.File file,
ArborAgent agent)
file - file where XML is writtenagent - ArborAgentpublic boolean checkForSaves(ArborAgent agent)
agent - ArborAgentpublic boolean isDirty()
public int size()
public java.lang.String[] getSlaveTitlesFor(java.lang.String locator)
locator - locator/URI for master text
public Catalog.SlaveMatch getSlaveMatch(java.lang.String locator,
int index)
throws java.lang.Exception
SlaveMatch corresponding to a given index
for a specified text.locator - locator/URI for master textindex - index of slave
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||