|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.dpml.library.impl.DefaultDictionary net.dpml.library.impl.DefaultLibrary
Utility class used for construction of a module model from an XML source.
Field Summary |
Fields inherited from interface net.dpml.library.Library |
INDEX_FILENAME |
Constructor Summary | |
DefaultLibrary(Logger logger)
Creation of a new library. |
|
DefaultLibrary(Logger logger,
File source)
Creation of a new library. |
Method Summary | |
Module[] |
getAllModules()
Return a array of all modules in the library. |
Module |
getModule(String ref)
Return a named module. |
Module[] |
getModules()
Return an array of the top-level modules within the library. |
String |
getProperty(String key)
Return a property value. |
String |
getProperty(String key,
String value)
Return a property value. |
String[] |
getPropertyNames()
Return the property names associated with the dictionary. |
Resource |
getResource(String ref)
Recursively lookup a resource using a fully qualified reference. |
Resource |
locate(File base)
Locate a resource relative to a base directory. |
Resource[] |
select(File base)
Select all local projects with a basedir equal to or deeper than the supplied directory. |
Resource[] |
select(File base,
boolean self)
Select all local projects relative to the supplied basedir. |
Resource[] |
select(String criteria,
boolean sort)
Select a set of resource matching a supplied a resource selection constraint. |
Resource[] |
select(String criteria,
boolean local,
boolean sort)
Select a set of resource matching a supplied a resource selection constraint. |
Resource[] |
sort(Resource[] resources)
Utility operation to sort a collection of resources. |
Methods inherited from class net.dpml.library.impl.DefaultDictionary |
getBooleanProperty, getIntegerProperty, getLocalPropertyNames, resolve |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DefaultLibrary(Logger logger) throws Exception
logger
- the assigned logging channel
Exception
- if an error occurs during defintion loadingpublic DefaultLibrary(Logger logger, File source) throws Exception
logger
- the assigned logging channelsource
- the index source defintion
Exception
- if an error occurs during defintion loadingMethod Detail |
public Resource[] sort(Resource[] resources)
sort
in interface Library
resources
- the resources to sort
public Module[] getModules()
getModules
in interface Library
public Module[] getAllModules()
getAllModules
in interface Library
public Module getModule(String ref) throws ModuleNotFoundException
getModule
in interface Library
ref
- the fully qualified module name
ModuleNotFoundException
- if the module cannot be foundpublic Resource getResource(String ref) throws ResourceNotFoundException
getResource
in interface Library
ref
- the fully qualified resource name
ResourceNotFoundException
- if the resource cannot be foundpublic Resource[] select(String criteria, boolean sort)
Select a set of resource matching a supplied a resource selection constraint. The constraint may contain the wildcards '**' and '*'.
select
in interface Library
criteria
- the selection criteriasort
- if true the returned array will be sorted relative to dependencies
otherwise the array will be sorted alphanumerically with respect to the resource
path
public Resource[] select(String criteria, boolean local, boolean sort)
Select a set of resource matching a supplied a resource selection constraint. The constraint may contain the wildcards '**' and '*'.
select
in interface Library
criteria
- the selection criterialocal
- if true restrict selection to local projectssort
- if true the returned array will be sorted relative to dependencies
otherwise the array will be sorted alphanumerically with respect to the resource
path
public Resource[] select(File base)
select
in interface Library
base
- the reference basedir
public Resource[] select(File base, boolean self)
select
in interface Library
base
- the reference basedirself
- if true and the basedir resolves to a project then include the project
otherwise the project will be expluded from selection
public Resource locate(File base) throws ResourceNotFoundException
locate
in interface Library
base
- the base directory
ResourceNotFoundException
- if resource match relative to the supplied basepublic String[] getPropertyNames()
getPropertyNames
in interface Dictionary
getPropertyNames
in class DefaultDictionary
public String getProperty(String key)
getProperty
in interface Dictionary
getProperty
in class DefaultDictionary
key
- the property key
public String getProperty(String key, String value)
getProperty
in interface Dictionary
getProperty
in class DefaultDictionary
key
- the property keyvalue
- the default value
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |