public abstract class Resource extends java.lang.Object implements Modifiable
| Modifier and Type | Field and Description |
|---|---|
protected java.beans.PropertyChangeSupport |
m_eventSupport
Deprecated.
Developers should use the setter/getters
associated with field.
|
protected long |
m_previousModified
Deprecated.
Developers should use the setter/getters
associated with field.
|
private java.util.Set |
m_propertyListeners
The set of listeners for this particular resource.
|
private java.lang.String |
m_resourceKey
The resource key is the identifier of the resource.
|
protected static java.lang.String |
MODIFIED |
| Constructor and Description |
|---|
Resource(java.lang.String resourceKey)
Required constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
This is the prefered method of registering a
PropertyChangeListener. |
protected void |
addPropertyChangeListener(java.lang.String property,
java.beans.PropertyChangeListener listener)
This is a convenience if you want to expose other properties for the Resource.
|
void |
addPropertyChangeListenersFrom(Resource other)
Abstract method to add the PropertyChangeListeners in another Resource to
this one.
|
protected void |
fireAndSetModifiedTime(long lastModified)
Fire a modify event and set the lastModified time as appropraite.
|
protected java.beans.PropertyChangeSupport |
getEventSupport() |
protected long |
getPreviousModified() |
java.lang.String |
getResourceKey()
Return the key for the resource.
|
boolean |
hasListeners()
This is the preferred method of determining if a Resource has listeners.
|
protected boolean |
hasListeners(java.lang.String property)
This is a convenience if you want to expose other properties for the Resource.
|
abstract long |
lastModified()
The time this was last modified.
|
void |
removeAllPropertyChangeListeners()
This cleanup method removes all listeners
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
This is the prefered method of unregistering a
PropertyChangeListener. |
protected void |
removePropertyChangeListener(java.lang.String property,
java.beans.PropertyChangeListener listener)
This is a convenience if you want to expose other properties for the Resource.
|
protected void |
setPreviousModified(long previousModified) |
void |
testModifiedAfter(long time)
Test whether this has been modified since time X
|
java.lang.String |
toString() |
protected static final java.lang.String MODIFIED
private final java.util.Set m_propertyListeners
protected java.beans.PropertyChangeSupport m_eventSupport
private final java.lang.String m_resourceKey
protected long m_previousModified
public Resource(java.lang.String resourceKey)
throws java.lang.Exception
String location is transformed by
the specific resource monitor. For instance, a FileResource will be able
to convert a string representation of a path to the proper File object.java.lang.Exceptionpublic final java.lang.String getResourceKey()
public abstract long lastModified()
lastModified in interface Modifiablepublic void testModifiedAfter(long time)
testModifiedAfter in interface Modifiableprotected void fireAndSetModifiedTime(long lastModified)
lastModified - the time modified atpublic void addPropertyChangeListenersFrom(Resource other)
public final void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
PropertyChangeListener.
It automatically registers the listener for the last modified event.protected void addPropertyChangeListener(java.lang.String property,
java.beans.PropertyChangeListener listener)
public final void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
PropertyChangeListener.
It automatically registers the listener for the last modified event.protected void removePropertyChangeListener(java.lang.String property,
java.beans.PropertyChangeListener listener)
public final boolean hasListeners()
public void removeAllPropertyChangeListeners()
protected boolean hasListeners(java.lang.String property)
protected final long getPreviousModified()
protected final void setPreviousModified(long previousModified)
protected final java.beans.PropertyChangeSupport getEventSupport()
public java.lang.String toString()
toString in class java.lang.Object