|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sourceforge.nite.meta.impl.NiteResourceData
public class NiteResourceData
Instantiates NResourceData which handles any resource file associated with a corpus: if present this must define all the information about where on disk codings live, and what competing versions of annotations exist.
| Constructor Summary | |
|---|---|
NiteResourceData(NMetaData meta,
java.lang.String filename)
the NiteResourceData constructor takes its parent metadata and its filename. |
|
| Method Summary | |
|---|---|
void |
addResource(java.lang.String coding,
NResource resource)
add a new resource |
void |
addResourceGroup(NResourceGroup nrg)
add a NResourceGroup element for resources that instantiate the named coding. |
void |
comment(char[] ch,
int start,
int length)
Store comments (part of the LexicalHandler interface) |
void |
deleteResource(java.lang.String resourceid)
delete resource given its ID |
void |
endCDATA()
part of the org.xml.sax.ext.LexicalHandler implementation - not for programming use |
void |
endDTD()
part of the org.xml.sax.ext.LexicalHandler implementation - not for programming use |
void |
endEntity(java.lang.String name)
part of the org.xml.sax.ext.LexicalHandler implementation - not for programming use |
java.util.List |
getCoherentResourceGroups(java.lang.String coding)
Return the full list of real resources for a coding, except that if there are virtual resources, add them to the list and remove any resources they draw from. |
java.util.List |
getCoherentResourceGroups(java.lang.String coding,
java.lang.String observation)
Return the full list of real resources, except that if there are virtual resources, add them to the list and remove any resources they draw from. |
java.util.List |
getDefaultedResourcesForCoding(java.lang.String coding)
find a list of NResource elements that instantiate the named coding and have their default attribute set to true. |
java.util.List |
getIncompatibleResources(NResource res)
get a List of NResource elements that are incompatible with this one |
NResource |
getResourceByID(java.lang.String rid)
find a resource from its ID |
java.lang.String |
getResourceFilePath()
Return the path to the resource file (absolute) |
NResourceGroup |
getResourceGroupForCoding(java.lang.String coding)
find a NResourceGroup elements that instantiate the named coding. |
java.lang.String |
getResourcePath(NResource resource)
find the path to the resource: each resource has one location on disk which can be affected by: the location of the resource file (if paths are relative); the 'path' attribute of the resource-type element in the resource file; the 'path' attribute of the 'resource' element |
java.lang.String |
getResourcePath(java.lang.String resourceid)
find the path to the resource: each resource has one location on disk which can be affected by: the location of the resource file (if paths are relative); the 'path' attribute of the resource-type element in the resource file; the 'path' attribute of the 'resource' element |
java.util.List |
getResourcesForCoding(java.lang.String coding)
find a list of NRealResource elements that instantiate the named coding. |
java.util.List |
getVirtualResourcesForCoding(java.lang.String coding)
find a list of NVirtualResource elements that instantiate the named coding |
void |
setFilename(java.lang.String filename)
set the resource filename for any future save: relative paths are assumed to be relative to the metadata directory. |
void |
startCDATA()
part of the org.xml.sax.ext.LexicalHandler implementation - not for programming use |
void |
startDTD(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
part of the org.xml.sax.ext.LexicalHandler implementation - not for programming use |
void |
startEntity(java.lang.String name)
part of the org.xml.sax.ext.LexicalHandler implementation - not for programming use |
void |
writeResourceFile()
save the resource file to the current filename (by default the file it was created from, or set using setFilename). |
void |
writeResourceFile(java.lang.String filename)
save the metadata to a file with the given filename. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NiteResourceData(NMetaData meta,
java.lang.String filename)
throws NiteMetaException
NiteMetaException| Method Detail |
|---|
public void writeResourceFile()
writeResourceFile in interface NResourceDatapublic void writeResourceFile(java.lang.String filename)
writeResourceFile in interface NResourceDatapublic void setFilename(java.lang.String filename)
setFilename in interface NResourceDatapublic java.lang.String getResourceFilePath()
getResourceFilePath in interface NResourceDatapublic NResource getResourceByID(java.lang.String rid)
getResourceByID in interface NResourceDatapublic java.util.List getResourcesForCoding(java.lang.String coding)
getResourcesForCoding in interface NResourceDatapublic NResourceGroup getResourceGroupForCoding(java.lang.String coding)
getResourceGroupForCoding in interface NResourceDatapublic void addResourceGroup(NResourceGroup nrg)
addResourceGroup in interface NResourceDatapublic java.util.List getDefaultedResourcesForCoding(java.lang.String coding)
getDefaultedResourcesForCoding in interface NResourceDatapublic java.util.List getVirtualResourcesForCoding(java.lang.String coding)
getVirtualResourcesForCoding in interface NResourceDatapublic java.util.List getCoherentResourceGroups(java.lang.String coding)
getCoherentResourceGroups in interface NResourceData
public java.util.List getCoherentResourceGroups(java.lang.String coding,
java.lang.String observation)
getCoherentResourceGroups in interface NResourceDatapublic void deleteResource(java.lang.String resourceid)
deleteResource in interface NResourceData
public void addResource(java.lang.String coding,
NResource resource)
addResource in interface NResourceDatapublic java.lang.String getResourcePath(java.lang.String resourceid)
getResourcePath in interface NResourceDatapublic java.lang.String getResourcePath(NResource resource)
getResourcePath in interface NResourceDatapublic java.util.List getIncompatibleResources(NResource res)
getIncompatibleResources in interface NResourceData
public void comment(char[] ch,
int start,
int length)
comment in interface org.xml.sax.ext.LexicalHandlerpublic void endCDATA()
endCDATA in interface org.xml.sax.ext.LexicalHandlerpublic void endDTD()
endDTD in interface org.xml.sax.ext.LexicalHandlerpublic void endEntity(java.lang.String name)
endEntity in interface org.xml.sax.ext.LexicalHandlerpublic void startCDATA()
startCDATA in interface org.xml.sax.ext.LexicalHandler
public void startDTD(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
startDTD in interface org.xml.sax.ext.LexicalHandlerpublic void startEntity(java.lang.String name)
startEntity in interface org.xml.sax.ext.LexicalHandler
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||