net.sourceforge.nite.meta.impl
Class NiteResource

java.lang.Object
  extended by net.sourceforge.nite.meta.impl.NiteResource
All Implemented Interfaces:
NRealResource, NResource

public class NiteResource
extends java.lang.Object
implements NRealResource

represents a single resource in a resource file, containing all its attributes and dependencies.

Author:
jonathan

Field Summary
 
Fields inherited from interface net.sourceforge.nite.meta.NRealResource
AUTOMATIC, MANUAL
 
Constructor Summary
NiteResource(NResourceGroup gr, java.lang.String id, java.lang.String description, java.lang.String rtype, java.lang.String annotator, java.lang.String path, java.lang.String def)
          the NiteResource constructor takes its parent resourceGroup and its attributes.
 
Method Summary
 void addDependency(NResource res, java.lang.String observation)
          add a dependency with resource resolved and observation (regexp) as a String
 void addDependency(java.lang.String res, java.lang.String observation)
          add a dependency with resource and observation (regexp) as Strings
 boolean dependsOn(NResource depresource)
          returns true if this resource can trace a dependency on the given resource for any observation (i.e.
 java.lang.String getAnnotator()
          return the annotator for this resource - null if this is an automatic process.
 java.lang.String getCoding()
          return the name of the coding this resource implements
 java.lang.String getCodingManualReference()
          return the coding manual reference or URL as a String
 java.lang.String getCoverage()
          return the responsible person or organisation as a String
 java.util.List getDependencies()
          return a List of NResourceDependency elements
 java.lang.String getDescription()
          return the textual description of this resource
 java.lang.String getID()
          return the ID of this resource
 java.lang.String getIncompatibleID()
          return the value of the 'notloadedwith' attribute - i.e.
 java.lang.String getLastEdit()
          return some details about the last edit to this resource as a String
 java.lang.String getPath()
          return the value of the 'path' attribute for this resource.
 java.lang.String getQuality()
          return the responsible person or organisation as a String
 NResourceGroup getResourceGroup()
          return the NResourceGroup to which this NResource belongs
 java.lang.String getResponsible()
          return the responsible person or organisation as a String
 int getType()
          return the type of this resource: AUTOMATIC or MANUAL
 boolean isDefault()
          return true if this resource has a 'default' attribute that is set to 'true'
 void setAnnotator(java.lang.String annotator)
          set the annotator for this resource - should remain null if this is an automatic process.
 void setCodingManualReference(java.lang.String manual)
          set the coding manual reference or URL as a String
 void setCoverage(java.lang.String coverage)
          set the responsible person or organisation as a String
 void setDescription(java.lang.String description)
          set the textual description of this resource
 void setIncompatibleID(java.lang.String inc)
          set the value of the 'notloadedwith' attribute - i.e.
 void setLastEdit(java.lang.String edit)
          return some details about the last edit to this resource as a String
 void setPath(java.lang.String path)
          Set the value of the 'path' attribute for this resource group.
 void setQuality(java.lang.String quality)
          set the responsible person or organisation as a String
 void setResponsible(java.lang.String responsible)
          set the responsible person or organisation as a String
 void setType(int type)
          set the type of this resource: AUTOMATIC or MANUAL
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NiteResource

public NiteResource(NResourceGroup gr,
                    java.lang.String id,
                    java.lang.String description,
                    java.lang.String rtype,
                    java.lang.String annotator,
                    java.lang.String path,
                    java.lang.String def)
             throws NiteMetaException
the NiteResource constructor takes its parent resourceGroup and its attributes.

Throws:
NiteMetaException
Method Detail

addDependency

public void addDependency(java.lang.String res,
                          java.lang.String observation)
add a dependency with resource and observation (regexp) as Strings

Specified by:
addDependency in interface NResource

addDependency

public void addDependency(NResource res,
                          java.lang.String observation)
add a dependency with resource resolved and observation (regexp) as a String

Specified by:
addDependency in interface NResource

dependsOn

public boolean dependsOn(NResource depresource)
returns true if this resource can trace a dependency on the given resource for any observation (i.e. it has a direct or indirect dependency)

Specified by:
dependsOn in interface NResource

getCoding

public java.lang.String getCoding()
return the name of the coding this resource implements

Specified by:
getCoding in interface NResource

getID

public java.lang.String getID()
return the ID of this resource

Specified by:
getID in interface NResource

getDependencies

public java.util.List getDependencies()
return a List of NResourceDependency elements

Specified by:
getDependencies in interface NResource

getPath

public java.lang.String getPath()
return the value of the 'path' attribute for this resource. This can be absolute or relative, or even a URL

Specified by:
getPath in interface NRealResource

setPath

public void setPath(java.lang.String path)
Set the value of the 'path' attribute for this resource group. This can be absolute or relative, or even a URL - relative paths are relative to the resource file location and/or the resource-type path

Specified by:
setPath in interface NRealResource

getDescription

public java.lang.String getDescription()
return the textual description of this resource

Specified by:
getDescription in interface NRealResource
Specified by:
getDescription in interface NResource

setDescription

public void setDescription(java.lang.String description)
set the textual description of this resource

Specified by:
setDescription in interface NRealResource

getAnnotator

public java.lang.String getAnnotator()
return the annotator for this resource - null if this is an automatic process. Each separate annotator should have a separate resource

Specified by:
getAnnotator in interface NRealResource

setAnnotator

public void setAnnotator(java.lang.String annotator)
set the annotator for this resource - should remain null if this is an automatic process. Each separate annotator should have a separate resource

Specified by:
setAnnotator in interface NRealResource

getType

public int getType()
return the type of this resource: AUTOMATIC or MANUAL

Specified by:
getType in interface NRealResource

setType

public void setType(int type)
set the type of this resource: AUTOMATIC or MANUAL

Specified by:
setType in interface NRealResource

getResourceGroup

public NResourceGroup getResourceGroup()
return the NResourceGroup to which this NResource belongs

Specified by:
getResourceGroup in interface NResource

isDefault

public boolean isDefault()
return true if this resource has a 'default' attribute that is set to 'true'

Specified by:
isDefault in interface NResource

getResponsible

public java.lang.String getResponsible()
return the responsible person or organisation as a String

Specified by:
getResponsible in interface NRealResource

setResponsible

public void setResponsible(java.lang.String responsible)
set the responsible person or organisation as a String

Specified by:
setResponsible in interface NRealResource

getCodingManualReference

public java.lang.String getCodingManualReference()
return the coding manual reference or URL as a String

Specified by:
getCodingManualReference in interface NRealResource

setCodingManualReference

public void setCodingManualReference(java.lang.String manual)
set the coding manual reference or URL as a String

Specified by:
setCodingManualReference in interface NRealResource

getQuality

public java.lang.String getQuality()
return the responsible person or organisation as a String

Specified by:
getQuality in interface NRealResource

setQuality

public void setQuality(java.lang.String quality)
set the responsible person or organisation as a String

Specified by:
setQuality in interface NRealResource

getCoverage

public java.lang.String getCoverage()
return the responsible person or organisation as a String

Specified by:
getCoverage in interface NRealResource

setCoverage

public void setCoverage(java.lang.String coverage)
set the responsible person or organisation as a String

Specified by:
setCoverage in interface NRealResource

getLastEdit

public java.lang.String getLastEdit()
return some details about the last edit to this resource as a String

Specified by:
getLastEdit in interface NRealResource

setLastEdit

public void setLastEdit(java.lang.String edit)
return some details about the last edit to this resource as a String

Specified by:
setLastEdit in interface NRealResource

getIncompatibleID

public java.lang.String getIncompatibleID()
return the value of the 'notloadedwith' attribute - i.e. an ID of a resource that should never be loaded with this one.

Specified by:
getIncompatibleID in interface NResource

setIncompatibleID

public void setIncompatibleID(java.lang.String inc)
set the value of the 'notloadedwith' attribute - i.e. an ID of a resource that should never be loaded with this one.

Specified by:
setIncompatibleID in interface NResource