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<java.lang.String> |
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, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitloadChildgetBaseDir, getName, getParent, isValidpublic 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 IFrameworkResourceParentname - name of childpublic IFrameworkResource getChild(java.lang.String name)
FrameworkResourceException if not found.getChild in interface IFrameworkResourceParentname - Name of childprotected java.util.Map getChildren()
public boolean existsChild(java.lang.String name)
existsChild in interface IFrameworkResourceParentname - key to lookup childpublic java.util.Collection listChildren()
FrameworkResource child resources.listChildren in interface IFrameworkResourceParentIFrameworkResource childrenpublic void remove(java.lang.String name)
remove in interface IFrameworkResourceParentname - Name of objectpublic void initialize()
initialize in interface IFrameworkResourceParentpublic java.util.Collection<java.lang.String> listChildNames()
listChildNames in interface IFrameworkResourceParentpublic boolean childCouldBeLoaded(java.lang.String name)
existsChildResourceDirectory(String))
Should be overridden by subtypes if this is not the desired behavior.childCouldBeLoaded in interface IFrameworkResourceParentname - child namepublic boolean existsChildResourceDirectory(java.lang.String name)
existsChildResourceDirectory in interface IFrameworkResourceParentname - Child resource name