|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.util.ResourceCollection
ucar.unidata.xml.XmlResourceCollection
public class XmlResourceCollection
An extension of ResourceCollection that handles xml documents.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class ucar.unidata.util.ResourceCollection |
|---|
ResourceCollection.Resource |
| Field Summary |
|---|
| Fields inherited from class ucar.unidata.util.ResourceCollection |
|---|
description, id, idToPath, pathToId, writableIndex, writableResource |
| Constructor Summary | |
|---|---|
XmlResourceCollection(String id)
Construct a new object with the given id (The id is simply a name, not one of the resources). |
|
XmlResourceCollection(String id,
List resources)
Construct a new object with the given id and list of resource paths. |
|
XmlResourceCollection(String id,
String description)
Construct a new object with the given id (The id is simply a name, not one of the resources) and description. |
|
XmlResourceCollection(String id,
String writableResource,
List resources)
Deprecated. not good anymore |
|
XmlResourceCollection(String id,
XmlResourceCollection that)
copy ctor |
|
| Method Summary | |
|---|---|
void |
clearCache()
clear the cache |
Element |
getRoot(int resourceIndex)
Create (if not already) and return the xml Element root of the xml resource at the given index. |
Element |
getRoot(int resourceIndex,
boolean lookAtCache)
Create (if not already) and return the xml Element root of the xml resource at the given index. |
Document |
getWritableDocument(String dfltXml)
Return the Document which is the user's writable xml document. |
Element |
getWritableRoot(String dfltXml)
Create (if not created) and return the root of the user's writable xml. |
void |
removeWritable()
Remove the writable resource from the list |
void |
setWritableDocument(Document d,
Element root)
Set the document and root element which represent the user's writable xml document. |
void |
writeWritable()
Write out the user's writable xml into the writable resource path. |
void |
writeWritableResource(String contents)
Write the given contents into the writable resource file. |
| Methods inherited from class ucar.unidata.util.ResourceCollection |
|---|
addLabels, addResource, addResource, addResourceAtStart, addResourceAtStart, addResourceAtStart, addResources, contains, deleteAllFiles, get, getCanLoadMore, getDescription, getId, getLabel, getPathFromId, getProperty, getResourceId, getResources, getShortName, getWritable, hasWritableResource, isHttp, isHttp, isValid, isWritable, isWritableResource, read, read, read, readWritableResource, removeAll, removeResource, setCanLoadMore, setDescription, setId, setIdForPath, size, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public XmlResourceCollection(String id)
id - The id or name of this collection.
public XmlResourceCollection(String id,
XmlResourceCollection that)
id - new idthat - resourcecollection to copy from
public XmlResourceCollection(String id,
String description)
id - The id or name of this collection.description - A human readable description of this collection
public XmlResourceCollection(String id,
List resources)
id - The id or name of this collection.resources - The list of resource paths.
public XmlResourceCollection(String id,
String writableResource,
List resources)
id - The id or name of this collection.writableResource - The resource path that the user can write to.resources - The list of resource paths.| Method Detail |
|---|
public void clearCache()
clearCache in class ResourceCollection
public void writeWritableResource(String contents)
throws FileNotFoundException,
IOException
writeWritableResource in class ResourceCollectioncontents -
FileNotFoundException
IOException
public void writeWritable()
throws FileNotFoundException,
IOException
FileNotFoundException - When the write fails.
IOException - When the write fails.public Element getWritableRoot(String dfltXml)
dfltXml - If the user's document does not exist then use this xml to create the document.
public Document getWritableDocument(String dfltXml)
dfltXml - If the user's document does not exist then use this xml to create the document.
public void setWritableDocument(Document d,
Element root)
d - The new document.root - The root of the writable xml.public void removeWritable()
removeWritable in class ResourceCollectionpublic Element getRoot(int resourceIndex)
resourceIndex - Which resource.
public Element getRoot(int resourceIndex,
boolean lookAtCache)
resourceIndex - Which resource.lookAtCache - SHould we check the cache first
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||