net.sourceforge.nite.meta.impl
Class NiteResourceGroup

java.lang.Object
  extended by net.sourceforge.nite.meta.impl.NiteResourceGroup
All Implemented Interfaces:
NResourceGroup

public class NiteResourceGroup
extends java.lang.Object
implements NResourceGroup

Handles a resource-type element in a resource file. These just group resources and virtual resources into sets that instantiate the same metadata coding.

Author:
jonathan

Constructor Summary
NiteResourceGroup(java.lang.String coding, java.lang.String path)
          Constructor for NiteResourceGroup takes two Strings: the coding instantiated by all its children and the path (if the path is relative it's relative to the resource file location).
NiteResourceGroup(java.lang.String coding, java.lang.String path, java.lang.String description)
          Constructor for NiteResourceGroup takes three Strings: the coding instantiated by all its children; the path (if the path is relative it's relative to the resource file location); and the description of this group
 
Method Summary
 void addDefaultedResource(NResource resource)
          add a defaulted resource to the group - defaults can be virtual or real
 void addRealResource(NRealResource nr)
          add a real resource to the group
 void addResource(NResource nr)
          add a resource to the group - this could be real or virtual
 void addVirtualResource(NVirtualResource nr)
          add a virtual resource to the group
 void deleteResource(NResource nr)
          remove a resource from the group - only insisting on implementation of the generic form where the NResource can be NRealResource or NVirtualResource.
 java.lang.String getCoding()
          get the name of the metadata coding that each resource in this group instantiates
 java.util.List getDefaultedResources()
          retrieve all the resources that implement the particular coding instantiated by this group and have their default attribute set to true.
 java.lang.String getDescription()
          return the generic description of the resource group.
 java.lang.String getPath()
          return the value of the 'path' attribute for this resource group.
 java.util.List getRealResources()
          retrieve all the (non-virtual) resources that implement the particular coding instantiated by this group
 java.util.List getVirtualResources()
          retrieve all the virtual resources that implement the particular coding instantiated by this group
 void setDescription(java.lang.String description)
          Set the value of the 'description' attribute for this resource group: a short textual description.
 void setPath(java.lang.String path)
          Set the value of the 'path' attribute for this resource group.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NiteResourceGroup

public NiteResourceGroup(java.lang.String coding,
                         java.lang.String path)
Constructor for NiteResourceGroup takes two Strings: the coding instantiated by all its children and the path (if the path is relative it's relative to the resource file location).


NiteResourceGroup

public NiteResourceGroup(java.lang.String coding,
                         java.lang.String path,
                         java.lang.String description)
Constructor for NiteResourceGroup takes three Strings: the coding instantiated by all its children; the path (if the path is relative it's relative to the resource file location); and the description of this group

Method Detail

addResource

public void addResource(NResource nr)
add a resource to the group - this could be real or virtual

Specified by:
addResource in interface NResourceGroup

addRealResource

public void addRealResource(NRealResource nr)
add a real resource to the group

Specified by:
addRealResource in interface NResourceGroup

addVirtualResource

public void addVirtualResource(NVirtualResource nr)
add a virtual resource to the group

Specified by:
addVirtualResource in interface NResourceGroup

addDefaultedResource

public void addDefaultedResource(NResource resource)
add a defaulted resource to the group - defaults can be virtual or real

Specified by:
addDefaultedResource in interface NResourceGroup

getRealResources

public java.util.List getRealResources()
retrieve all the (non-virtual) resources that implement the particular coding instantiated by this group

Specified by:
getRealResources in interface NResourceGroup

getVirtualResources

public java.util.List getVirtualResources()
retrieve all the virtual resources that implement the particular coding instantiated by this group

Specified by:
getVirtualResources in interface NResourceGroup

getDefaultedResources

public java.util.List getDefaultedResources()
retrieve all the resources that implement the particular coding instantiated by this group and have their default attribute set to true. Note: this can return a mixed list of virtual and non-virtual resources (if the resource file writer is mental).

Specified by:
getDefaultedResources in interface NResourceGroup

getCoding

public java.lang.String getCoding()
get the name of the metadata coding that each resource in this group instantiates

Specified by:
getCoding in interface NResourceGroup

deleteResource

public void deleteResource(NResource nr)
remove a resource from the group - only insisting on implementation of the generic form where the NResource can be NRealResource or NVirtualResource.

Specified by:
deleteResource in interface NResourceGroup

getPath

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

Specified by:
getPath in interface NResourceGroup

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 can be overridden by specific resource paths

Specified by:
setPath in interface NResourceGroup

getDescription

public java.lang.String getDescription()
return the generic description of the resource group.

Specified by:
getDescription in interface NResourceGroup

setDescription

public void setDescription(java.lang.String description)
Set the value of the 'description' attribute for this resource group: a short textual description.

Specified by:
setDescription in interface NResourceGroup