|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.1.0) E17493-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.ide.config.DTCache
public final class DTCache
The DTCache
is a persisted cache that can be used to
store data that is not user-configurable. For example, this can be
used to "remember" pieces of information, such as history
information.
DTCache now only DOM-parses the dtcache file and creates a map of keys (String) to Node when the file is loaded. This is to eliminate creating each class that has persisted data into the file and thus having to load the class and thus the extension that provided the class. Now when the value is requested for the key we either: 1) pull the data out of the Node for simple objects (string, int, boolean) or 2) use Object2Dom to create an instance of the object for just that node When a complex object is requested we replace the map entry with the actual object instead of the DOM node. When we save the file we have to convert the objects back to a DOM node using Object2Dom for the complex objects. Note: we use Object2Dom for URLs so we can store the relative path instead of an absolute path
Constructor Summary | |
---|---|
DTCache()
Construct a new default DTCache instance. |
Method Summary | |
---|---|
java.lang.Object |
copyTo(java.lang.Object target)
Copies the internal state of this object to the
specified copy . |
boolean |
getBoolean(java.lang.String dataKey,
boolean defaultVal)
Retrieves a previously cached boolean using the specified key. |
java.lang.Object |
getData(java.lang.String dataKey)
Retrieves a previously added cached object from the cache using the specified key for lookup. |
java.lang.Object |
getData(java.lang.String dataKey,
java.lang.ClassLoader classLoader)
|
int |
getInteger(java.lang.String dataKey,
int defaultVal)
Retrieves a previously cached integer using the specified key. |
java.lang.String |
getString(java.lang.String dataKey)
Retrieves a previously cached String using the specified
key. |
java.net.URL |
getURL(java.lang.String dataKey)
Retrieves a previously cached URL using the specified key. |
boolean |
load()
Loads the registered data from the XML file. |
void |
putBoolean(java.lang.String dataKey,
boolean b)
Stores a boolean into the cache using the specified key
for lookup. |
void |
putBoolean(java.lang.String dataKey,
java.lang.Boolean b)
Stores a Boolean into the cache using the specified key for
lookup. |
void |
putData(java.lang.String dataKey,
Copyable data)
Stores an object into the cache using the specified key for lookup. |
void |
putData(java.lang.String dataKey,
java.util.List copyableList)
Stores a list into the cache using the specified key for lookup. |
void |
putData(java.lang.String dataKey,
java.util.Map copyableMap)
Stores a map into the cache using the specified key for lookup. |
void |
putInteger(java.lang.String dataKey,
int i)
Stores an int into the cache using the specified key for
lookup. |
void |
putInteger(java.lang.String dataKey,
java.lang.Integer i)
Stores an Integer into the cache using the specified key for
lookup. |
void |
putString(java.lang.String dataKey,
java.lang.String string)
Stores a String into the cache using the specified key for
lookup. |
void |
putURL(java.lang.String dataKey,
java.net.URL url)
|
java.lang.Object |
remove(java.lang.String dataKey)
Removes the specified dataKey from the DTCache. |
void |
removeAll()
Removes all entries from the DTCache, this is only for use in testing scenarios. |
boolean |
save()
Saves the registered data to the XML file. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DTCache()
DTCache
instance.
Method Detail |
---|
public java.lang.Object getData(java.lang.String dataKey)
dataKey
- the key to use for looking up the object
public java.lang.Object getData(java.lang.String dataKey, java.lang.ClassLoader classLoader)
public java.lang.String getString(java.lang.String dataKey)
String
using the specified
key.
dataKey
- the key to use for looking up the string
public int getInteger(java.lang.String dataKey, int defaultVal)
dataKey
- the key to use for looking up the valuedefaultVal
- the value to return if no cached value is found
defaultVal
is returnedpublic boolean getBoolean(java.lang.String dataKey, boolean defaultVal)
dataKey
- the key to use for looking up the valuedefaultVal
- the value to return if no cached value is found
defaultVal
is returnedpublic java.net.URL getURL(java.lang.String dataKey)
dataKey
- the key to use for looking up the value
public void putData(java.lang.String dataKey, Copyable data)
dataKey
- the key to use for looking up the objectdata
- the data to store in the cachepublic void putData(java.lang.String dataKey, java.util.List copyableList)
dataKey
- the key to use for looking up the objectcopyableList
- the list to store in the cachepublic void putData(java.lang.String dataKey, java.util.Map copyableMap)
dataKey
- the key to use for looking up the objectcopyableMap
- the map to store in the cachepublic void putString(java.lang.String dataKey, java.lang.String string)
String
into the cache using the specified key for
lookup.
dataKey
- the key to use for looking up the valuestring
- the value to storepublic void putBoolean(java.lang.String dataKey, boolean b)
boolean
into the cache using the specified key
for lookup.
dataKey
- the key to use for looking up the valueb
- the value to storepublic void putBoolean(java.lang.String dataKey, java.lang.Boolean b)
Boolean
into the cache using the specified key for
lookup.
dataKey
- the key to use for looking up the valueb
- the value to storepublic void putURL(java.lang.String dataKey, java.net.URL url)
public void putInteger(java.lang.String dataKey, int i)
int
into the cache using the specified key for
lookup.
dataKey
- the key to use for looking up the valuei
- the value to storepublic void putInteger(java.lang.String dataKey, java.lang.Integer i)
Integer
into the cache using the specified key for
lookup.
dataKey
- the key to use for looking up the valuei
- the value to storepublic java.lang.Object remove(java.lang.String dataKey)
dataKey
-
public void removeAll()
public boolean save()
public boolean load()
public java.lang.Object copyTo(java.lang.Object target)
this
object to the
specified copy
.
copyTo
in interface Copyable
-
this
object was copied. If the target
was
non-null
, then the return value is the same as the
target
object that was passed in; otherwise, the
return value is a new instance of this
class.public java.lang.String toString()
toString
in class java.lang.Object
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.1.0) E17493-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |