Project JXTA

net.jxta.ext.config
Class Resource

java.lang.Object
  extended by net.jxta.ext.config.Resource
Direct Known Subclasses:
ResourceManager

public class Resource
extends Object

Version:
$Id: Resource.java,v 1.15 2004/07/31 07:44:34 gonzo Exp $
Author:
james todd [gonzo at jxta dot org]

Constructor Summary
Resource()
          Constructor for the Resource object
 
Method Summary
 boolean contains(String key)
           
 String get(String key)
          Description of the Method
 String get(String key, String d)
          Description of the Method
 List getAll(String key)
          Gets the all attribute of the Resource object
 List getAll(String key, String d)
          Gets the all attribute of the Resource object
 boolean getBoolean(String key)
          Gets the boolean attribute of the Resource object
 boolean getBoolean(String key, boolean d)
          Gets the boolean attribute of the Resource object
 boolean getBoolean(String key, Boolean d)
          Gets the boolean attribute of the Resource object
 char getChar(String key)
          Gets the char attribute of the Resource object
 char getChar(String key, Character d)
          Gets the char attribute of the Resource object
 Class getClass(String key)
          Gets the class attribute of the Resource object
 Class getClass(String key, Class d)
          Gets the class attribute of the Resource object
 List getClasses(String key)
          Gets the classes attribute of the Resource object
 List getClasses(String key, URL d)
          Gets the classes attribute of the Resource object
 Color getColor(String key)
          Gets the color attribute of the Resource object
 Color getColor(String key, Color d)
          Gets the color attribute of the Resource object
 float getFloat(String key)
          Gets the float attribute of the Resource object
 float getFloat(String key, Float d)
          Gets the float attribute of the Resource object
 int getInt(String key)
          Gets the int attribute of the Resource object
 int getInt(String key, int d)
          Gets the int attribute of the Resource object
 int getInt(String key, Integer d)
          Gets the int attribute of the Resource object
 long getLong(String key)
          Gets the long attribute of the Resource object
 long getLong(String key, long d)
          Gets the long attribute of the Resource object
 long getLong(String key, Long d)
          Gets the long attribute of the Resource object
 Resource getResource(String key)
           
 InputStream getResourceAsStream(String resource)
          Gets the resourceAsStream attribute of the Resource object
 InputStream getResourceAsStream(String resource, Class clazz)
          Gets the resourceAsStream attribute of the Resource object
 List getResources(String key)
           
 URI getURI(String key)
          Gets the URI attribute of the Resource object
 URI getURI(String key, URI d)
          Gets the URI attribute of the Resource object
 List getURIs(String key)
          Gets the URIs attribute of the Resource object
 List getURIs(String key, URI d)
          Gets the URIs attribute of the Resource object
 URL getURL(String key)
          Gets the URL attribute of the Resource object
 URL getURL(String key, URL d)
          Gets the URL attribute of the Resource object
 List getURLs(String key)
          Gets the URLs attribute of the Resource object
 List getURLs(String key, URL d)
          Gets the URLs attribute of the Resource object
 void load(File resource)
          Description of the Method
 void load(InputStream is)
          Description of the Method
 void load(String resource)
          Description of the Method
 void load(String resource, Class clazz)
          Description of the Method
 void load(URL resource)
          Description of the Method
 void set(String key)
          Description of the Method
 void set(String key, String value)
          Description of the Method
 String toString()
          Description of the Method
static URL toURL(File f)
          Description of the Method
static URL toURL(String s)
          Description of the Method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Resource

public Resource()
Constructor for the Resource object

Method Detail

toURL

public static URL toURL(String s)
                 throws ConversionException
Description of the Method

Parameters:
s - Description of the Parameter
Returns:
Description of the Return Value
Throws:
ConversionException - Description of the Exception

toURL

public static URL toURL(File f)
                 throws ConversionException
Description of the Method

Parameters:
f - Description of the Parameter
Returns:
Description of the Return Value
Throws:
ConversionException - Description of the Exception

load

public void load(URL resource)
          throws ResourceNotFoundException
Description of the Method

Parameters:
resource - Description of the Parameter
Throws:
ResourceNotFoundException - Description of the Exception

load

public void load(String resource)
          throws ResourceNotFoundException
Description of the Method

Parameters:
resource - Description of the Parameter
Throws:
ResourceNotFoundException - Description of the Exception

load

public void load(File resource)
          throws ResourceNotFoundException,
                 MalformedURLException
Description of the Method

Parameters:
resource - Description of the Parameter
Throws:
ResourceNotFoundException - Description of the Exception
MalformedURLException - Description of the Exception

load

public void load(String resource,
                 Class clazz)
          throws ResourceNotFoundException
Description of the Method

Parameters:
resource - Description of the Parameter
clazz - Description of the Parameter
Throws:
ResourceNotFoundException - Description of the Exception

load

public void load(InputStream is)
          throws ResourceNotFoundException
Description of the Method

Parameters:
is - Description of the Parameter
Throws:
ResourceNotFoundException - Description of the Exception

getResourceAsStream

public InputStream getResourceAsStream(String resource)
Gets the resourceAsStream attribute of the Resource object

Parameters:
resource - Description of the Parameter
Returns:
The resourceAsStream value

getResourceAsStream

public InputStream getResourceAsStream(String resource,
                                       Class clazz)
Gets the resourceAsStream attribute of the Resource object

Parameters:
resource - Description of the Parameter
clazz - Description of the Parameter
Returns:
The resourceAsStream value

get

public String get(String key)
Description of the Method

Parameters:
key - Description of the Parameter
Returns:
Description of the Return Value

get

public String get(String key,
                  String d)
Description of the Method

Parameters:
key - Description of the Parameter
d - Description of the Parameter
Returns:
Description of the Return Value

getInt

public int getInt(String key)
           throws ConversionException
Gets the int attribute of the Resource object

Parameters:
key - Description of the Parameter
Returns:
The int value
Throws:
ConversionException - Description of the Exception

getInt

public int getInt(String key,
                  int d)
Gets the int attribute of the Resource object

Parameters:
key - Description of the Parameter
d - Description of the Parameter
Returns:
The int value

getInt

public int getInt(String key,
                  Integer d)
           throws ConversionException
Gets the int attribute of the Resource object

Parameters:
key - Description of the Parameter
d - Description of the Parameter
Returns:
The int value
Throws:
ConversionException - Description of the Exception

getLong

public long getLong(String key)
             throws ConversionException
Gets the long attribute of the Resource object

Parameters:
key - Description of the Parameter
Returns:
The long value
Throws:
ConversionException - Description of the Exception

getLong

public long getLong(String key,
                    long d)
Gets the long attribute of the Resource object

Parameters:
key - Description of the Parameter
d - Description of the Parameter
Returns:
The int value

getLong

public long getLong(String key,
                    Long d)
             throws ConversionException
Gets the long attribute of the Resource object

Parameters:
key - Description of the Parameter
d - Description of the Parameter
Returns:
The long value
Throws:
ConversionException - Description of the Exception

getFloat

public float getFloat(String key)
               throws ConversionException
Gets the float attribute of the Resource object

Parameters:
key - Description of the Parameter
Returns:
The float value
Throws:
ConversionException - Description of the Exception

getFloat

public float getFloat(String key,
                      Float d)
               throws ConversionException
Gets the float attribute of the Resource object

Parameters:
key - Description of the Parameter
d - Description of the Parameter
Returns:
The float value
Throws:
ConversionException - Description of the Exception

getBoolean

public boolean getBoolean(String key)
Gets the boolean attribute of the Resource object

Parameters:
key - Description of the Parameter
Returns:
The boolean value

getBoolean

public boolean getBoolean(String key,
                          boolean d)
Gets the boolean attribute of the Resource object

Parameters:
key - Description of the Parameter
d - Description of the Parameter
Returns:
The boolean value

getBoolean

public boolean getBoolean(String key,
                          Boolean d)
Gets the boolean attribute of the Resource object

Parameters:
key - Description of the Parameter
d - Description of the Parameter
Returns:
The boolean value

getChar

public char getChar(String key)
             throws ConversionException
Gets the char attribute of the Resource object

Parameters:
key - Description of the Parameter
Returns:
The char value
Throws:
ConversionException - Description of the Exception

getChar

public char getChar(String key,
                    Character d)
             throws ConversionException
Gets the char attribute of the Resource object

Parameters:
key - Description of the Parameter
d - Description of the Parameter
Returns:
The char value
Throws:
ConversionException - Description of the Exception

getURL

public URL getURL(String key)
           throws ConversionException
Gets the URL attribute of the Resource object

Parameters:
key - Description of the Parameter
Returns:
The URL value
Throws:
ConversionException - Description of the Exception

getURL

public URL getURL(String key,
                  URL d)
           throws ConversionException
Gets the URL attribute of the Resource object

Parameters:
key - Description of the Parameter
d - Description of the Parameter
Returns:
The URL value
Throws:
ConversionException - Description of the Exception

getURLs

public List getURLs(String key)
             throws ConversionException
Gets the URLs attribute of the Resource object

Parameters:
key - Description of the Parameter
Returns:
The URLs value
Throws:
ConversionException - Description of the Exception

getURLs

public List getURLs(String key,
                    URL d)
             throws ConversionException
Gets the URLs attribute of the Resource object

Parameters:
key - Description of the Parameter
d - Description of the Parameter
Returns:
The URLs value
Throws:
ConversionException - Description of the Exception

getURI

public URI getURI(String key)
           throws ConversionException
Gets the URI attribute of the Resource object

Parameters:
key - Description of the Parameter
Returns:
The URI value
Throws:
ConversionException - Description of the Exception

getURI

public URI getURI(String key,
                  URI d)
           throws ConversionException
Gets the URI attribute of the Resource object

Parameters:
key - Description of the Parameter
d - Description of the Parameter
Returns:
The URI value
Throws:
ConversionException - Description of the Exception

getURIs

public List getURIs(String key)
             throws ConversionException
Gets the URIs attribute of the Resource object

Parameters:
key - Description of the Parameter
Returns:
The URIs value
Throws:
ConversionException - Description of the Exception

getURIs

public List getURIs(String key,
                    URI d)
             throws ConversionException
Gets the URIs attribute of the Resource object

Parameters:
key - Description of the Parameter
d - Description of the Parameter
Returns:
The URIs value
Throws:
ConversionException - Description of the Exception

getColor

public Color getColor(String key)
               throws ConversionException
Gets the color attribute of the Resource object

Parameters:
key - Description of the Parameter
Returns:
The color value
Throws:
ConversionException - Description of the Exception

getColor

public Color getColor(String key,
                      Color d)
               throws ConversionException
Gets the color attribute of the Resource object

Parameters:
key - Description of the Parameter
d - Description of the Parameter
Returns:
The color value
Throws:
ConversionException - Description of the Exception

getResource

public Resource getResource(String key)

getResources

public List getResources(String key)

getClass

public Class getClass(String key)
               throws ConversionException
Gets the class attribute of the Resource object

Parameters:
key - Description of the Parameter
Returns:
The class value
Throws:
ConversionException - Description of the Exception

getClass

public Class getClass(String key,
                      Class d)
               throws ConversionException
Gets the class attribute of the Resource object

Parameters:
key - Description of the Parameter
d - Description of the Parameter
Returns:
The class value
Throws:
ConversionException - Description of the Exception

getClasses

public List getClasses(String key)
                throws ConversionException
Gets the classes attribute of the Resource object

Parameters:
key - Description of the Parameter
Returns:
The classes value
Throws:
ConversionException - Description of the Exception

getClasses

public List getClasses(String key,
                       URL d)
                throws ConversionException
Gets the classes attribute of the Resource object

Parameters:
key - Description of the Parameter
d - Description of the Parameter
Returns:
The classes value
Throws:
ConversionException - Description of the Exception

set

public void set(String key)
Description of the Method

Parameters:
key - Description of the Parameter

set

public void set(String key,
                String value)
Description of the Method

Parameters:
key - Description of the Parameter
value - Description of the Parameter

getAll

public List getAll(String key)
Gets the all attribute of the Resource object

Parameters:
key - Description of the Parameter
Returns:
The all value

getAll

public List getAll(String key,
                   String d)
Gets the all attribute of the Resource object

Parameters:
key - Description of the Parameter
d - Description of the Parameter
Returns:
The all value

contains

public boolean contains(String key)

toString

public String toString()
Description of the Method

Overrides:
toString in class Object
Returns:
Description of the Return Value

JXTA J2SE