edu.wisc.trace.urcsdk.client.resources
Class ResourceSheet

java.lang.Object
  extended by edu.wisc.trace.urcsdk.client.resources.ResourceSheet

public class ResourceSheet
extends java.lang.Object

ResourceSheet is the object form of a Resource Sheet. It is parsed in two stages. The first being a preamble parse where it just looks for the scents related to this resource sheet (cheap). The second performs the parse of all resource descriptions within the file and should only be done when there is a resource that needs to be retrieved from this file (expensive).

Version:
$Revision: 1.21 $
Author:
Andrew Martin, Trace R&D Center Created on: Sep 10, 2004

Constructor Summary
ResourceSheet(ResourceDirectory parent, org.w3c.dom.Element rootElement)
          Creates a new ResourceSheet instance.
ResourceSheet(java.lang.String rdfAsString)
          Constructs a ResourceSheet object from an in-memory RDF (as a Java String).
ResourceSheet(java.net.URI resSheetURI)
          Creates a new ResourceSheet instance.
 
Method Summary
 java.net.URI getBaseURI()
          getBaseURI returns the URI without any file names added, for use in referring to the base directory this document loaded from.
 java.util.List<java.lang.String> getDomains()
          Returns the domains that this ResourceSheet contains.
 java.util.List<java.lang.String> getFormats()
          Returns all formats used in this ResourceSheet.
 java.util.List<java.lang.String> getLangs()
          Returns all languages used in this ResourceSheet.
 java.util.List<IResource> getResources()
           
 java.util.List<java.net.URI> getResourceSheetURIs()
           
 java.util.List<Constants.ResourceRole> getRoles()
           
 org.w3c.dom.Element getRootElement()
           
 java.util.List<Constants.ResourceType> getTypes()
           
 java.net.URI getUri()
           
 boolean hasUserPreferences(UserPreferences uprefs)
          Describe hasUserPreferences method here.
 boolean isDescriptionParsed()
           
 boolean isParsed()
          Describe isParsed method here.
 boolean isPreambleParsed()
           
 void parseDescriptions()
          Describe parseDescriptions method here.
 void parsePreamble()
          Describe parsePreamble method here.
 void resetParseFlag()
          Describe resetParseFlag method here.
 java.lang.String toString()
          Describe toString method here.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceSheet

public ResourceSheet(ResourceDirectory parent,
                     org.w3c.dom.Element rootElement)
              throws UrcException
Creates a new ResourceSheet instance.

Parameters:
parent - a ResourceDirectory value
rootElement - an Element value
Throws:
UrcException - if an error occurs

ResourceSheet

public ResourceSheet(java.lang.String rdfAsString)
              throws UrcException
Constructs a ResourceSheet object from an in-memory RDF (as a Java String).

Parameters:
rdfAsString - the String representing the RDF resource file.
Throws:
UrcException - if there is a failure to parse the RDF.

ResourceSheet

public ResourceSheet(java.net.URI resSheetURI)
              throws UrcException
Creates a new ResourceSheet instance.

Parameters:
resSheetURI - an URI value
Throws:
UrcException - if an error occurs
Method Detail

getBaseURI

public java.net.URI getBaseURI()
getBaseURI returns the URI without any file names added, for use in referring to the base directory this document loaded from.

Returns:
an URI value

getDomains

public java.util.List<java.lang.String> getDomains()
Returns the domains that this ResourceSheet contains.

Returns:
List<String> of domains.

getFormats

public java.util.List<java.lang.String> getFormats()
Returns all formats used in this ResourceSheet.

Returns:
a list of Strings representing the different formats.

getLangs

public java.util.List<java.lang.String> getLangs()
Returns all languages used in this ResourceSheet.

Returns:
a list of Strings representing the different languages used (in their two-letter ISO encoding).

getResourceSheetURIs

public java.util.List<java.net.URI> getResourceSheetURIs()
Returns:
list of URIs for the resource sheet.

getRoles

public java.util.List<Constants.ResourceRole> getRoles()
Returns:
list of the roles for the resource sheet.

getRootElement

public org.w3c.dom.Element getRootElement()
Returns:
root element for the resource sheet.

getTypes

public java.util.List<Constants.ResourceType> getTypes()
Returns:
list of the types present in the resource sheet.

getUri

public java.net.URI getUri()
Returns:
URI of the resource sheet.

hasUserPreferences

public boolean hasUserPreferences(UserPreferences uprefs)
Describe hasUserPreferences method here.

Parameters:
uprefs - an UserPreferences value
Returns:
a boolean value

isDescriptionParsed

public boolean isDescriptionParsed()
Returns:
boolean representing whether or not the description of the resource sheet has been parsed.

isParsed

public boolean isParsed()
Describe isParsed method here.

Returns:
a boolean value

isPreambleParsed

public boolean isPreambleParsed()

parseDescriptions

public void parseDescriptions()
                       throws UrcException
Describe parseDescriptions method here.

Throws:
UrcException - if an error occurs

parsePreamble

public void parsePreamble()
                   throws UrcException
Describe parsePreamble method here.

Throws:
UrcException - if an error occurs

resetParseFlag

public void resetParseFlag()
Describe resetParseFlag method here.


toString

public java.lang.String toString()
Describe toString method here.

Overrides:
toString in class java.lang.Object
Returns:
a String value

getResources

public java.util.List<IResource> getResources()
Returns:
a List of resources


Copyright © 2006 Trace R&D Center, University of Wisconsin-Madison. All Rights Reserved.