Package org.mycore.common.config
Class MCRComponent
java.lang.Object
org.mycore.common.config.MCRComponent
- All Implemented Interfaces:
Comparable<MCRComponent>
This class abstracts different MyCoRe component types.
As every component (mycore component, application module) holds it configuration in different places,
you can use this class to get uniform access to these configuration resources.
As this class is immutable it could be used as key in a
Map
- Since:
- 2013.12
- Author:
- Thomas Scheffler (yagee)
- See Also:
-
Constructor Summary
ConstructorDescriptionMCRComponent
(String artifactId, Manifest manifest) MCRComponent
(String artifactId, Manifest manifest, File jarFile) -
Method Summary
Modifier and TypeMethodDescriptionint
Compares this component to other component.boolean
getConfigFileStream
(String filename) getConfigURL
(String filename) Returns the jar file ornull
if nothing was set.Returns the mainfest main attribute value for given attribute name.getName()
A short name for this component.Returns resource base path to this components config resources.int
hashCode()
boolean
Returns true, if this component is application moduleboolean
Returns true, if this component is part of MyCoRetoString()
-
Constructor Details
-
MCRComponent
-
MCRComponent
-
-
Method Details
-
getConfigFileStream
-
getConfigURL
-
getResourceBase
Returns resource base path to this components config resources. -
isMyCoReComponent
public boolean isMyCoReComponent()Returns true, if this component is part of MyCoRe -
isAppModule
public boolean isAppModule()Returns true, if this component is application module -
getName
A short name for this component. E.g. mycore-base would return "base" here. -
getJarFile
Returns the jar file ornull
if nothing was set.- Returns:
- the jar file
-
getManifestMainAttribute
Returns the mainfest main attribute value for given attribute name.- Parameters:
name
- the attribute name- Returns:
- the attribute value
-
compareTo
Compares this component to other component. Basic order is:- complete
- base
- component
- module
getName()
.- Specified by:
compareTo
in interfaceComparable<MCRComponent>
-
hashCode
public int hashCode() -
equals
-
toString
-