Class ConfigHelper
java.lang.Object
org.apache.jackrabbit.vault.fs.config.ConfigHelper
ConfigHelper...-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates an instance for the given config element, requiring the configured class to be of the given expected type.getDefaultClass(String name) getDefaultPackage(String name) static Methodstatic StringgetMethodName(String prefix, String name) static booleanstatic <T> TinvokeGetter(Object obj, String name, Class<T> T) static boolean
-
Constructor Details
-
ConfigHelper
public ConfigHelper()
-
-
Method Details
-
getDefaultPackages
-
getDefaultClasses
-
getMappings
-
getDefaultPackage
-
getDefaultClass
-
create
- Throws:
ConfigurationException
-
create
Creates an instance for the given config element, requiring the configured class to be of the given expected type. Configurations are frequently read from untrusted sources (e.g.META-INF/vault/config.xmlinside a content package, parsed when the package is opened), so the class named by theclassattribute must never be instantiated - and its static initializer therefore never triggered - unless it is of the type the caller will actually use. For the same reason the historicClass#FIELDstatic field access syntax is rejected: reading an arbitrary static field of an arbitrary class is not a configuration mechanism but a code-execution primitive.- Parameters:
elem- the config elementexpectedType- the type the configured class must be assignable to- Returns:
- the new instance (or the element's text content if no class is configured)
- Throws:
ConfigurationException- if the class cannot be resolved, is not assignable toexpectedType, uses the rejected#field syntax, or cannot be instantiated- Since:
- 2.10.0 (Bundle version 4.3.0)
-
getMethodName
-
getMethod
-
hasSetter
- Throws:
ConfigurationException
-
setField
- Throws:
ConfigurationException
-
invokeGetter
- Throws:
ConfigurationException
-