public class ConfigurationManager extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DUMMY_NS_ATTR_VALUE |
static String |
SUBSTITUTION_ATTR |
| Constructor and Description |
|---|
ConfigurationManager()
Creates a new instance of ConfigurationManager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConfigurable(Configurable configurable)
Appends specified
Configurable to the list configurables. |
void |
configure()
Configures all
Configurable in configuables; Uses the deafault Path to the local root
Object. |
void |
configure(Configurable singleConfig)
Configures the specified
Configurable; Uses the default Path to the local root Object. |
void |
configure(Configurable singleConfig,
String path)
Configures the specified
Configurable; Uses a specified path to the local Object. |
void |
configure(Configurable singleConfig,
String path,
boolean merge)
Configures the specified
Configurable; Uses a specified path to the local Object. |
void |
configure(String path)
Configures all
Configurable in configuables; Uses a specified Path to the local root
Object. |
void |
configure(String path,
boolean merge)
Configures all
Configurable in configurables; Uses a specified Path to the local root
Object. |
void |
configureFromClasspath()
Configures all
Configurable in configurables; Uses the Classpath to the local root
Object. |
void |
configureFromClasspath(Configurable singleConfig)
Configures the specified
Configurable; Uses the Classpath to the local root Object. |
void |
configureFromClasspath(String url,
Configurable singleConfig)
Configures the specified
Configurable; Uses the Classpath to the local root Object. |
Set<org.jdom.Element> |
createElements(String xmlSnippet)
Creates a
Set from the given xml snippet. |
String |
getClassPathFolder()
Getter for
classPathFolder. |
org.jdom.Document |
getConfigurationDocument()
Writes a Configuration File in specified path.
|
String |
getDefaultFileName()
Getter for
defaultFileName. |
String |
getFallBackFileName()
Getter for
fallBackFileName. |
String |
getFileName()
Getter for
fileName. |
String |
getFileSeperator()
Getter for
fs. |
String |
getFolder()
Getter for
folder. |
String |
getHome()
Getter for
home. |
String |
getLocalAbsoluteConfigurationFolder()
Returns the Url "~/.cismet/"
|
String |
getSubstitutionAttr(org.jdom.Element e)
Returns the value of the substitution attribute of the given
Element. |
boolean |
hasSubstitutionAttr(org.jdom.Element e)
Checks whether the given
Element has a substitution attribute. |
void |
initialiseLocalConfigurationClasspath()
Initialises the Local Configuration Classpath.
|
boolean |
isEqual(org.jdom.Document doc1,
org.jdom.Document doc2)
Writes a Configuration File in specified path.
|
void |
removeConfigurable(Configurable configurable)
Removes specified
Configurable from the list configurables. |
void |
removeVoid(org.jdom.Element child)
Removes an
Element from its parent if the Element does not have any children or any attributes
except the substitution attribute. |
void |
resolveNamespace(org.jdom.Element parent,
Set<org.jdom.Element> newChildren)
Iterates through all the given children and tries to resolve every children's DUMMY
Namespace against the
given parent. |
void |
setClassPathFolder(String classPathFolder)
Setter for
classPathFolder. |
void |
setDefaultFileName(String defaultFileName)
Setter for
defaultFileName. |
void |
setFallBackFileName(String fallBackFileName)
Setter for
fallBackFileName. |
void |
setFileName(String fileName)
Setter for
fileName. |
void |
setFileSeperator(String fs)
Setter for
fs. |
void |
setFolder(String folder)
Setter for
folder. |
void |
setHome(String home)
Setter for
home. |
void |
writeConfiguration()
Writes a new Configuration File into the LocalAbsouluteConfigurationFolder.
|
void |
writeConfiguration(String path)
Writes a Configuration File in specified path.
|
public static final String SUBSTITUTION_ATTR
public static final String DUMMY_NS_ATTR_VALUE
public ConfigurationManager()
public void addConfigurable(Configurable configurable)
Configurable to the list configurables.configurable - Configurable, which should get append to the Listpublic void removeConfigurable(Configurable configurable)
Configurable from the list configurables.configurable - Configurable, which should get removed from the Listpublic void setFileName(String fileName)
fileName.fileName - fileNamepublic void configure()
Configurable in configuables; Uses the deafault Path to the local root
Object.public void configure(String path)
Configurable in configuables; Uses a specified Path to the local root
Object. This is a convenient method for configure(String, false)path - specified pathconfigure(de.cismet.tools.configuration.Configurable, java.lang.String),
configure(java.lang.String, boolean)public void configure(Configurable singleConfig)
Configurable; Uses the default Path to the local root Object.singleConfig - specified Configurable; if ==null: uses all Configurable in
configurables.configure(de.cismet.tools.configuration.Configurable, java.lang.String)public void configure(Configurable singleConfig, String path)
Configurable; Uses a specified path to the local Object.singleConfig - specified Configurable; if ==null: uses all Configurable in
configurables.path - specified path to the local root Object.#pureConfigure(de.cismet.tools.configuration.Configurable, org.jdom.Element, org.jdom.Element)public void configure(Configurable singleConfig, String path, boolean merge)
Configurable; Uses a specified path to the local Object.singleConfig - specified Configurable; if ==null: uses all Configurable in
configurables.path - specified path to the local root Object.merge - iff true, the given configuration will be merged with the current configuration#pureConfigure(de.cismet.tools.configuration.Configurable, org.jdom.Element, org.jdom.Element)public void configureFromClasspath()
Configurable in configurables; Uses the Classpath to the local root
Object.public void configureFromClasspath(Configurable singleConfig)
Configurable; Uses the Classpath to the local root Object.singleConfig - specified Configurable; if ==null uses all Configurable in
configurables.#pureConfigure(de.cismet.tools.configuration.Configurable, org.jdom.Element, org.jdom.Element)public void configureFromClasspath(String url, Configurable singleConfig) throws Exception
Configurable; Uses the Classpath to the local root Object.url - pathsingleConfig - singleConfig specified Configurable; if ==null uses all
Configurable in configurables.Exception - Throws Excpetion if anything went wrong.#pureConfigure(de.cismet.tools.configuration.Configurable, org.jdom.Element, org.jdom.Element)public void configure(String path, boolean merge)
Configurable in configurables; Uses a specified Path to the local root
Object.path - specified pathmerge - iff true, the given configuration will be merged with the current configurationconfigure(de.cismet.tools.configuration.Configurable, java.lang.String)public void initialiseLocalConfigurationClasspath()
public void resolveNamespace(org.jdom.Element parent,
Set<org.jdom.Element> newChildren)
Namespace against the
given parent. The implementation traverses upwards beginning with the given parent Element and uses the
value of the first occurrence of the child's DUMMYNamespace prefix as a new Namespace for the
child.parent - the Element used for resolving the NamespacesnewChildren - the candidate Elements probably being resolvedDUMMY_NS_ATTR_VALUEpublic boolean hasSubstitutionAttr(org.jdom.Element e)
Element has a substitution attribute.e - the Element to be checked for a substitution attributeElement has a substitution attribute, false otherwiseSUBSTITUTION_ATTRpublic String getSubstitutionAttr(org.jdom.Element e)
Element.e - the Element containing the substitution attributeElementSUBSTITUTION_ATTRpublic Set<org.jdom.Element> createElements(String xmlSnippet)
Set from the given xml snippet. This implementation assumes that there is a single root
Element whose only purpose is to wrap the Elements to be created. In other words this
implementation will return the child Elements of the Document's root Element. The
returned Elements are detached from their root so they can be inserted into another Document.xmlSnippet - the xml String the consisting of a single root Element and the desired child
ElementsElement of the given xml snippetpublic void removeVoid(org.jdom.Element child)
Element from its parent if the Element does not have any children or any attributes
except the substitution attribute.child - the child that is a candidate for removalpublic void writeConfiguration()
public String getLocalAbsoluteConfigurationFolder()
public boolean isEqual(org.jdom.Document doc1,
org.jdom.Document doc2)
doc1 - path pathdoc2 - DOCUMENT ME!public void writeConfiguration(String path)
path - pathpublic org.jdom.Document getConfigurationDocument()
public String getDefaultFileName()
defaultFileName.defaultFileNamepublic void setDefaultFileName(String defaultFileName)
defaultFileName.defaultFileName - defaultFileNamepublic String getClassPathFolder()
classPathFolder.classPathFolderpublic void setClassPathFolder(String classPathFolder)
classPathFolder.classPathFolder - classPathFolderpublic void setFileSeperator(String fs)
fs.fs - file seperatorpublic String getFallBackFileName()
fallBackFileName.public void setFallBackFileName(String fallBackFileName)
fallBackFileName.fallBackFileName - fallBackFileNameCopyright © 2012–2026 cismet GmbH. All rights reserved.