public abstract class FrameworkResourceParent extends FrameworkResource implements IFrameworkResourceParent
FrameworkResource
instances.
Modifier and Type | Class and Description |
---|---|
static class |
FrameworkResourceParent.NoSuchResourceException |
VALID_RESOURCE_NAME_CHARSET_REGEX, VALID_RESOURCE_NAME_REGEX
Constructor and Description |
---|
FrameworkResourceParent(java.lang.String name,
java.io.File dir,
IFrameworkResourceParent parent)
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
childCouldBeLoaded(java.lang.String name)
Default implementation checks whether a subdir under the basedir exists with the specified name.
|
IFrameworkResource |
createChild(java.lang.String name)
create a new child resource
|
boolean |
existsChild(java.lang.String name)
Checks if there is a child FrameworkResource with specified name.
|
boolean |
existsChildResourceDirectory(java.lang.String name)
Given a child resource name, checks if a subdirectory by that name exists
|
IFrameworkResource |
getChild(java.lang.String name)
Gets requested child FrameworkResource.
|
protected java.util.Map |
getChildren() |
void |
initialize()
Initializes state from any loaded children.
|
java.util.Collection |
listChildNames()
Default implementation lists the subdirectory names and adds any existing child names
|
java.util.Collection |
listChildren()
Returns a collection of
FrameworkResource child resources. |
void |
remove(java.lang.String name)
Remove the resource by its name.
|
getBaseDir, getLogger, getName, getParent, isValid, storeProperties, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
loadChild
getBaseDir, getName, getParent, isValid
public FrameworkResourceParent(java.lang.String name, java.io.File dir, IFrameworkResourceParent parent)
name
- Name of resourcedir
- Base directory of resourceparent
- parentpublic IFrameworkResource createChild(java.lang.String name)
createChild
in interface IFrameworkResourceParent
name
- name of childpublic IFrameworkResource getChild(java.lang.String name)
FrameworkResourceException
if not found.getChild
in interface IFrameworkResourceParent
name
- Name of childprotected java.util.Map getChildren()
public boolean existsChild(java.lang.String name)
existsChild
in interface IFrameworkResourceParent
name
- key to lookup childpublic java.util.Collection listChildren()
FrameworkResource
child resources.listChildren
in interface IFrameworkResourceParent
IFrameworkResource
childrenpublic void remove(java.lang.String name)
remove
in interface IFrameworkResourceParent
name
- Name of objectpublic void initialize()
initialize
in interface IFrameworkResourceParent
public java.util.Collection listChildNames()
listChildNames
in interface IFrameworkResourceParent
public boolean childCouldBeLoaded(java.lang.String name)
existsChildResourceDirectory(String)
)
Should be overridden by subtypes if this is not the desired behavior.childCouldBeLoaded
in interface IFrameworkResourceParent
name
- child namepublic boolean existsChildResourceDirectory(java.lang.String name)
existsChildResourceDirectory
in interface IFrameworkResourceParent
name
- Child resource name