|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.w3c.tools.resources.AttributeHolder org.w3c.tools.resources.Resource
public class Resource
The resource class describes an object, accessible through the server. Resource objects are required to have the following properties:
These resource objects do not define how they are accessed. See the sub-classes for specific accesses.
Field Summary | |
---|---|
protected static int |
ATTR_CONTEXT
Attribute index - The hierarchical context of the resource. |
protected static int |
ATTR_HELP_URL
Attribute index - The help URL for this resource (Ref doc) |
protected static int |
ATTR_IDENTIFIER
Attribute index - The index for the identifier attribute. |
protected static int |
ATTR_LAST_MODIFIED
Attribute index - The index for the last-modified attribute. |
protected static int |
ATTR_PARENT
Attribute index - The index for our parent attribute. |
protected static int |
ATTR_RESOURCE_FRAMES
Attribute index - Associated resource frames |
protected static int |
ATTR_STORE_ENTRY
Attribute index - The index of the resource store entry attribute. |
protected static int |
ATTR_URL
Attribute index - The index for our URL attribute. |
static java.lang.String |
co
|
static java.lang.String |
id
|
Fields inherited from class org.w3c.tools.resources.AttributeHolder |
---|
attributes, values |
Constructor Summary | |
---|---|
Resource()
Create an empty resource instance. |
Method Summary | |
---|---|
boolean |
acceptUnload()
Is that resource willing to be unloaded. |
protected void |
checkMultipleLock(ResourceReference rr)
Check if this resource is loked more than one time. |
ResourceFrame[] |
collectFrames(java.lang.Class c)
Collect any frame that's an instance of the given class. |
void |
delete()
Delete this Resource instance, and remove it from its store. |
java.lang.Object |
getClone(java.lang.Object[] values)
Clone this attribute holder, and init it with the given attributes. |
protected ResourceContext |
getContext()
Get the hierarchical context for that resource. |
ResourceFrame |
getFrame(java.lang.Class c)
Get the first occurence of a frame of the given class. |
ResourceFrame[] |
getFrames()
Collect all frames. |
java.lang.String |
getHelpURL()
Get this resource's help url. |
java.lang.String |
getHelpURL(java.lang.String topics)
Get the help URL for that resource's topic. |
java.lang.String |
getIdentifier()
Get this resource identifier. |
long |
getLastModified()
Get this resource last modification time. |
ResourceReference |
getParent()
Get this resource parent resource. |
ResourceReference |
getResourceReference()
Get the ResourceReference of that resource. |
ServerInterface |
getServer()
Get the server this resource is served by. |
protected ResourceSpace |
getSpace()
Get the ResourceSpace where this resource is stored. |
protected SpaceEntry |
getSpaceEntry()
Get the space entry for that resource. |
java.lang.Object |
getStoreEntry()
Get the store entry for that resource. |
java.lang.String |
getURLPath()
Get the file part of the URL this resource is attached to. |
java.lang.Object |
getValue(java.lang.Class c,
int idx,
java.lang.Object def)
Get an attached frame attribute value. |
java.lang.Object |
getValue(int idx,
java.lang.Object def)
Generic get of an attribute value. |
void |
initialize(java.util.Hashtable defs)
Initialization method for attribute holders. |
void |
initialize(java.lang.Object[] values)
Initialization method for attribute holders. |
boolean |
isInitialized()
|
boolean |
isUnloaded()
unloaded? |
void |
markModified()
Mark this resource as having been modified. |
void |
notifyUnload()
This resource is being unloaded. |
void |
pickleValues(java.util.Hashtable defs)
Set the values. |
void |
registerFrame(ResourceFrame frame,
java.util.Hashtable defs)
Initialize and attach a new ResourceFrame to that resource. |
protected void |
setContext(ResourceContext context)
Set the given context as the current context of this resource. |
protected void |
setContext(ResourceContext context,
boolean keepmodules)
Set the given context as the current context of this resource. |
void |
setValue(java.lang.Class c,
int idx,
java.lang.Object val)
Set an attached frame attribute value. |
void |
setValue(int idx,
java.lang.Object value)
We overide setValue, to mark the resource as modified. |
void |
unregisterFrame(ResourceFrame frame)
Unregister a resource frame from the given resource. |
protected ResourceContext |
unsafeGetContext()
|
ResourceFrame |
unsafeGetFrame(java.lang.Class c)
Get the first occurence of a frame of the given class. |
ResourceFrame[] |
unsafeGetFrames()
Collect all frames. |
java.lang.String |
unsafeGetIdentifier()
Get this resource identifier. |
ResourceReference |
unsafeGetResourceReference()
Get the ResourceReference of that resource. |
java.lang.String |
unsafeGetURLPath()
Get the file part of the URL this resource is attached to. |
java.lang.Object |
unsafeGetValue(int idx,
java.lang.Object def)
Generic get of an attribute value. |
void |
updateAttributes()
The web admin wants us to update any out of date attribute. |
Methods inherited from class org.w3c.tools.resources.AttributeHolder |
---|
definesAttribute, definesAttribute, getAttributes, getBoolean, getChar, getClone, getClone, getDouble, getFloat, getInt, getLong, getString, getValue, lookupAttribute, print, setBoolean, setChar, setDouble, setFloat, setInt, setLong, setString, setValue, unsafeDefinesAttribute, unsafeGetDouble, unsafeGetString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static int ATTR_STORE_ENTRY
protected static int ATTR_IDENTIFIER
protected static int ATTR_RESOURCE_FRAMES
protected static int ATTR_PARENT
protected static int ATTR_CONTEXT
protected static int ATTR_URL
protected static int ATTR_LAST_MODIFIED
protected static int ATTR_HELP_URL
public static java.lang.String id
public static java.lang.String co
Constructor Detail |
---|
public Resource()
Method Detail |
---|
public java.lang.Object getClone(java.lang.Object[] values)
AttributeHolder
getClone
in class AttributeHolder
values
- Attribute values to overide in the clone.
public ResourceReference getParent()
public java.lang.String getURLPath()
public java.lang.String unsafeGetURLPath()
public ServerInterface getServer()
public java.lang.String getHelpURL()
public java.lang.Object getValue(int idx, java.lang.Object def)
AttributeHolder
getValue
in class AttributeHolder
idx
- The index of the attribute whose value is queried.def
- The default value (if the attribute isn't defined).
public java.lang.Object unsafeGetValue(int idx, java.lang.Object def)
AttributeHolder
unsafeGetValue
in class AttributeHolder
idx
- The index of the attribute whose value is queried.def
- The default value (if the attribute isn't defined).
public java.lang.String getHelpURL(java.lang.String topics)
topic
- The topic you want help for.
protected ResourceContext getContext()
protected ResourceContext unsafeGetContext()
protected void setContext(ResourceContext context)
context
- The new context.protected void setContext(ResourceContext context, boolean keepmodules)
context
- The new context.keepmodules
- If true the new context will have the same
modules than the old one.public java.lang.Object getStoreEntry()
public java.lang.String getIdentifier()
public java.lang.String unsafeGetIdentifier()
protected SpaceEntry getSpaceEntry()
protected ResourceSpace getSpace()
public ResourceReference getResourceReference()
public ResourceReference unsafeGetResourceReference()
public void registerFrame(ResourceFrame frame, java.util.Hashtable defs)
frame
- An uninitialized ResourceFrame instance.defs
- A default set of attribute values.public void unregisterFrame(ResourceFrame frame)
frame
- The frame to unregister from the resource.public ResourceFrame[] getFrames()
public ResourceFrame[] unsafeGetFrames()
public ResourceFrame[] collectFrames(java.lang.Class c)
cls
- The class of frames we are looking for.
public ResourceFrame getFrame(java.lang.Class c)
cls
- The class of te frame to look for.
public ResourceFrame unsafeGetFrame(java.lang.Class c)
cls
- The class of te frame to look for.
public java.lang.Object getValue(java.lang.Class c, int idx, java.lang.Object def)
getFrame
and getValue
method call.
cls
- The class of the frame we want the value of.idx
- The attribute index.def
- The default value (if the attribute value isn't defined).
public void setValue(java.lang.Class c, int idx, java.lang.Object val)
getFrame
and a setValue
method call.
cls
- The class of the frame we want to modify.idx
- The attribute to modify.val
- The new attribute value.public long getLastModified()
public void markModified()
public void setValue(int idx, java.lang.Object value)
setValue
in class AttributeHolder
idx
- The index of the attribute to modify.value
- The new attribute value.public boolean acceptUnload()
notifyUnload
method).
Returning false should never be needed, except for very strange resources.
public void notifyUnload()
public boolean isUnloaded()
public void updateAttributes()
protected void checkMultipleLock(ResourceReference rr) throws MultipleLockException
MultipleLockException
- is thrown if true.public void delete() throws MultipleLockException
MultipleLockException
- if someone else has locked this
resourcepublic boolean isInitialized()
public void pickleValues(java.util.Hashtable defs)
pickleValues
in class AttributeHolder
defs
- The Hashtable containing the values.public void initialize(java.util.Hashtable defs)
initialize
in class AttributeHolder
defs
- The Hashtable containing the default values.public void initialize(java.lang.Object[] values)
AttributeHolder
initialize
method gets called. The holder should initialize itself with the set
of provided values and perform any additional startup code.
initialize
in class AttributeHolder
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |