public abstract class AbstractResource<T> extends Object implements Resource<T>
| Modifier and Type | Field and Description |
|---|---|
protected EnumSet<ResourceFlag> |
flags |
protected Resource<?> |
parent |
protected ResourceFactory |
resourceFactory |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractResource(ResourceFactory factory,
Resource<?> parent) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract List<Resource<?>> |
doListResources()
Strategy method for returning child resources.
|
boolean |
equals(Object obj) |
Set<ResourceFlag> |
getFlags() |
String |
getFullyQualifiedName()
Return the fully qualified name of the resource (if applicable).
|
Resource<?> |
getParent()
Get the parent of the current resource.
|
ResourceFactory |
getResourceFactory()
Return the
ResourceFactory with which this Resource was created. |
int |
hashCode() |
boolean |
isFlagSet(ResourceFlag flag)
Return true if the given
ResourceFlag is set. |
List<Resource<?>> |
listResources()
Return a list of child resources of the current resource.
|
List<Resource<?>> |
listResources(ResourceFilter filter)
Return a list of child resources of the current resource matching the given
ResourceFilter. |
<R extends Resource<?>> |
reify(Class<R> type)
Ask this
Resource if it is actually a resource of the given type; if it is, return a new reference to the
resource as the given type, otherwise return null. |
void |
setFlag(ResourceFlag flag)
Set the given
ResourceFlag. |
void |
unsetFlag(ResourceFlag flag)
Unset the given
ResourceFlag. |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitcreateFrom, delete, delete, exists, getChild, getName, getResourceInputStream, getUnderlyingResourceObjectprotected final ResourceFactory resourceFactory
protected Resource<?> parent
protected EnumSet<ResourceFlag> flags
protected AbstractResource(ResourceFactory factory, Resource<?> parent)
public ResourceFactory getResourceFactory()
ResourceResourceFactory with which this Resource was created. If no factory was used, return
null.getResourceFactory in interface Resource<T>public String getFullyQualifiedName()
ResourcegetFullyQualifiedName in interface Resource<T>public Resource<?> getParent()
Resourcepublic void setFlag(ResourceFlag flag)
ResourceResourceFlag.public void unsetFlag(ResourceFlag flag)
ResourceResourceFlag.public boolean isFlagSet(ResourceFlag flag)
ResourceResourceFlag is set.public Set<ResourceFlag> getFlags()
public <R extends Resource<?>> R reify(Class<R> type)
ResourceResource if it is actually a resource of the given type; if it is, return a new reference to the
resource as the given type, otherwise return null.protected abstract List<Resource<?>> doListResources()
public List<Resource<?>> listResources()
ResourcelistResources in interface Resource<T>public List<Resource<?>> listResources(ResourceFilter filter)
ResourceResourceFilter.listResources in interface Resource<T>Copyright © 2013 JBoss by Red Hat. All Rights Reserved.