|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.xml.sax.helpers.DefaultHandler | +--org.daml.validator.Preferences
Parse the preference file
Field Summary | |
java.util.HashMap |
cache
Maps URIs to local cache filenames. |
java.util.HashSet |
cacheList
Keep a list of original cache items |
URISubstitution |
outdatedURIs
URISubstitution structure that store the mapping from old to new URIs. |
java.util.Hashtable |
propertyList
Properties |
java.util.HashSet |
subList
Keep a list of original substitution items |
Constructor Summary | |
Preferences()
Parse the given prefernces file and return the results in a new Preference object. |
Method Summary | |
void |
addSubstitution(java.lang.String original,
java.lang.String replacement,
boolean warn,
boolean load)
Add substitution information for a URI. |
void |
addToCache(java.lang.String original,
java.lang.String file)
Add a URI and filename to the cache records. |
java.lang.String |
cacheURI(java.lang.String uri)
Looks in the cache for a URI and returns a cache file or the original URI. |
boolean |
getBooleanProperty(java.lang.String name,
boolean defaultVal)
|
int |
getIntProperty(java.lang.String name,
int defaultVal)
|
java.lang.String |
getProperty(java.lang.String name)
|
java.lang.String |
getProperty(java.lang.String name,
java.lang.String defaultVal)
Get a property's value. |
boolean |
hasCache(java.lang.String uri)
Is the uri in the cache. |
java.lang.String |
normalizeURI(java.lang.String uri)
Given a URI, convert it to a namespace string (ie, strip file extension and add ending #). |
static Preferences |
parse(java.lang.String file)
|
void |
removeFromCache(java.lang.String original)
Delete a URI from the cache records. |
void |
save(java.lang.String filename)
Save the preferences file to the specified filename. |
void |
setProperty(java.lang.String name,
java.lang.String value)
Set a property value |
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
|
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
characters, endDocument, endElement, 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 URISubstitution outdatedURIs
public java.util.HashSet subList
public java.util.HashMap cache
public java.util.HashSet cacheList
public java.util.Hashtable propertyList
Constructor Detail |
public Preferences()
Method Detail |
public static Preferences parse(java.lang.String file) throws java.lang.Exception
java.lang.Exception
public void addToCache(java.lang.String original, java.lang.String file)
public void addSubstitution(java.lang.String original, java.lang.String replacement, boolean warn, boolean load)
public void setProperty(java.lang.String name, java.lang.String value)
public java.lang.String getProperty(java.lang.String name, java.lang.String defaultVal)
public java.lang.String getProperty(java.lang.String name)
public boolean getBooleanProperty(java.lang.String name, boolean defaultVal)
public int getIntProperty(java.lang.String name, int defaultVal)
public void removeFromCache(java.lang.String original)
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public java.lang.String normalizeURI(java.lang.String uri)
public void save(java.lang.String filename) throws java.io.IOException
java.io.IOException
public java.lang.String cacheURI(java.lang.String uri)
public boolean hasCache(java.lang.String uri)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |