public class ClassloadingHelper extends Object
ClassloadingHelper.CLASS_TYPEs for a
MetaClass. The procedure to load a specific class is the following:System.getProperty(java.lang.String)#getClassNames(Sirius.server.middleware.types.MetaClass, de.cismet.cids.utils.ClassloadingHelper.CLASS_TYPE, java.lang.String)
for the domain of the MetaClass#getClassNames(Sirius.server.middleware.types.MetaClass, de.cismet.cids.utils.ClassloadingHelper.CLASS_TYPE, java.lang.String)
for the alternative domains defined by the CL_PROP_ALT_DOMAINS property| Modifier and Type | Class and Description |
|---|---|
static class |
ClassloadingHelper.CLASS_TYPE
Class types of the extension points supported by the cids system.
|
static class |
ClassloadingHelper.DOM_CTYPE_ORDER
Allowed domain classtype order directives.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
CL_PROP_ALT_DOMAINS
The property 'classloading.alternativeDomains' which can be used to specify alternative classloading domains.
|
static String |
CL_PROP_DOM_CTYPE_ORDER
The property 'classloading.domainClassTypeOrder' which can be used to specify the desired order during candidate
class name build.
|
static String |
CL_PROPERTIES
A property file 'classloading.properties' that may contain configurations concerning classloading.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
camelize(String toCamelize)
Camelises a given string.
|
static String |
capitalize(String toCapitalize)
Capitalises a given string.
|
static String |
getClassNameByConfiguration(MemberAttributeInfo mai,
ClassloadingHelper.CLASS_TYPE classType)
Loads the candidate class name from configuration according to the cids extension points.
|
static String |
getClassNameByConfiguration(MetaClass metaClass,
ClassloadingHelper.CLASS_TYPE classType)
Loads the candidate class name from configuration according to the cids extension points.
|
static String |
getClassNameByConfiguration(MetaClass metaClass,
MemberAttributeInfo mai,
ClassloadingHelper.CLASS_TYPE classType)
Deprecated.
support will most likely be dropped
|
static List<String> |
getClassNames(MetaClass metaClass,
ClassloadingHelper.CLASS_TYPE classType)
Produces candidate class names for a given
MetaClass and ClassloadingHelper.CLASS_TYPE. |
static List<String> |
getClassNames(MetaClass metaClass,
ClassloadingHelper.CLASS_TYPE classType,
String forDomain,
ClassloadingHelper.DOM_CTYPE_ORDER order)
Produces candidate names for a given
MetaClass, CLASS_TYPE, domain and order. |
static List<String> |
getClassNames(MetaClass metaClass,
MemberAttributeInfo mai,
ClassloadingHelper.CLASS_TYPE classType)
Deprecated.
support will most likely be dropped
|
static Class<?> |
getDynamicClass(MetaClass metaClass,
ClassloadingHelper.CLASS_TYPE classType)
Loads a
Class object for the given MetaClass of the given CLASS_TYPE by
first receiving a list of candidate names from
getClassNames(Sirius.server.middleware.types.MetaClass, de.cismet.cids.utils.ClassloadingHelper.CLASS_TYPE)
and then using loadClassFromCandidates(java.util.List). |
static Class<?> |
getDynamicClass(MetaClass metaClass,
MemberAttributeInfo mai,
ClassloadingHelper.CLASS_TYPE classType)
Deprecated.
support will most likely be dropped
|
static Class<?> |
loadClassFromCandidates(List<String> candidateClassNames)
Loads a
Class from candidate names. |
public static final String CL_PROPERTIES
ClassLoadingPackagePrefixProvider>.<domain of the
MetaClass>DefaultClassLoadingPackagePrefixProvider -> prefix= de.cismet.cids.customMetaClass -> domain= MY_DOMAINde.cismet.cids.custom.my_domain.classloading.propertiesClassLoadingPackagePrefixProvider,
StringUtils.toPackage(java.lang.String),
Constant Field Valuespublic static final String CL_PROP_ALT_DOMAINS
CL_PROPERTIES file if it shall be used by
the ClassloadingHelper to create candidate names.public static final String CL_PROP_DOM_CTYPE_ORDER
CL_PROPERTIES file if it shall be used by the
ClassloadingHelper to create candidate names.public static List<String> getClassNames(MetaClass metaClass, MemberAttributeInfo mai, ClassloadingHelper.CLASS_TYPE classType)
metaClass - DOCUMENT ME!mai - DOCUMENT ME!classType - DOCUMENT ME!public static String capitalize(String toCapitalize)
toCapitalize - the string to capitalisepublic static List<String> getClassNames(MetaClass metaClass, ClassloadingHelper.CLASS_TYPE classType)
MetaClass and ClassloadingHelper.CLASS_TYPE. It first produces candidate
class names from the domain of the MetaClass using
getClassNames(Sirius.server.middleware.types.MetaClass, de.cismet.cids.utils.ClassloadingHelper.CLASS_TYPE, java.lang.String, de.cismet.cids.utils.ClassloadingHelper.DOM_CTYPE_ORDER)
with the order defined by CL_PROP_DOM_CTYPE_ORDER. After that it iterates through the alternative
domains defined by CL_PROP_ALT_DOMAINS (if any).metaClass - the MetaClass to create candidate class names forclassType - the CLASS_TYPE to create candidate class names forgetClassNames(Sirius.server.middleware.types.MetaClass,de.cismet.cids.utils.ClassloadingHelper.CLASS_TYPE,
java.lang.String, de.cismet.cids.utils.ClassloadingHelper.DOM_CTYPE_ORDER)public static List<String> getClassNames(MetaClass metaClass, ClassloadingHelper.CLASS_TYPE classType, String forDomain, ClassloadingHelper.DOM_CTYPE_ORDER order)
MetaClass, CLASS_TYPE, domain and order. The
procedure to create candidate names is the following:System.getProperty(java.lang.String)buildCandidateNames(java.lang.String, java.lang.String, java.lang.String, de.cismet.cids.utils.ClassloadingHelper.CLASS_TYPE, de.cismet.cids.utils.ClassloadingHelper.DOM_CTYPE_ORDER)
getClassNameByConfiguration(Sirius.server.middleware.types.MetaClass, de.cismet.cids.utils.ClassloadingHelper.CLASS_TYPE)
ClassloadingHelper.CLASS_TYPE.overrideProperty>StringUtils.toPackage(java.lang.String).metaClass - the MetaClass to create candidate class names forclassType - the CLASS_TYPE to create candidate class names forforDomain - the domain to create candidate class names fororder - the order that shall be appliedClassLoadingPackagePrefixProvider,
StringUtils.toPackage(java.lang.String)public static String getClassNameByConfiguration(MetaClass metaClass, ClassloadingHelper.CLASS_TYPE classType)
metaClass - the MetaClass to get the configuration forclassType - the specific CLASS_TYPE to get the configuration fornull) or null if the given classType
is not recognisedpublic static String getClassNameByConfiguration(MemberAttributeInfo mai, ClassloadingHelper.CLASS_TYPE classType)
mai - the MemberAttributeInfo to get the configuration forclassType - the specific CLASS_TYPE to get the configuration fornull) or null if the given classType
is not recognisedpublic static String getClassNameByConfiguration(MetaClass metaClass, MemberAttributeInfo mai, ClassloadingHelper.CLASS_TYPE classType)
metaClass - DOCUMENT ME!mai - DOCUMENT ME!classType - DOCUMENT ME!public static String camelize(String toCamelize)
toCamelize - the string to camelisepublic static Class<?> loadClassFromCandidates(List<String> candidateClassNames)
Class from candidate names. The result of the first successful try will be returned.candidateClassNames - a list of class names that shall be triedClass object of the first successful try or null if none
of the candidate names could be used to load the classpublic static Class<?> getDynamicClass(MetaClass metaClass, MemberAttributeInfo mai, ClassloadingHelper.CLASS_TYPE classType)
metaClass - DOCUMENT ME!mai - DOCUMENT ME!classType - DOCUMENT ME!public static Class<?> getDynamicClass(MetaClass metaClass, ClassloadingHelper.CLASS_TYPE classType)
Class object for the given MetaClass of the given CLASS_TYPE by
first receiving a list of candidate names from
getClassNames(Sirius.server.middleware.types.MetaClass, de.cismet.cids.utils.ClassloadingHelper.CLASS_TYPE)
and then using loadClassFromCandidates(java.util.List).metaClass - the MetaClass to load a Class object of the given
CLASS_TYPE forclassType - the requested CLASS_TYPE to loadClass of requested type or null if no class of the given
type for the given MetaClass could be foundIllegalArgumentException - if metaClass or classType is nullCopyright © 2012–2026 cismet GmbH. All rights reserved.