Package org.apache.shiro.config
Class ReflectionBuilder
- java.lang.Object
-
- org.apache.shiro.config.ReflectionBuilder
-
public class ReflectionBuilder extends Object
Object builder that uses reflection and Apache Commons BeanUtils to build objects given a map of "property values". Typically these come from the Shiro INI configuration and are used to construct or modify the SecurityManager, its dependencies, and web-based security filters. RecognizesFactory
implementations and will callgetInstance
to satisfy any reference to this bean.- Since:
- 0.9
-
-
Constructor Summary
Constructors Constructor Description ReflectionBuilder()
ReflectionBuilder(Map<String,?> defaults)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
applyGlobalProperty(Map objects, String property, String value)
protected void
applyProperty(Object object, String propertyPath, Object value)
protected void
applyProperty(Object object, String propertyName, String stringValue)
protected void
applyProperty(String key, String value, Map objects)
protected void
applySingleProperty(Map objects, String name, String property, String value)
Map<String,?>
buildObjects(Map<String,String> kvPairs)
protected String
checkForNullOrEmptyLiteral(String stringValue)
protected void
createNewInstance(Map<String,Object> objects, String name, String value)
void
destroy()
protected EventBus
findEventBus(Map<String,?> objects)
Object
getBean(String id)
<T> T
getBean(String id, Class<T> requiredType)
protected String
getId(String referenceToken)
Map<String,?>
getObjects()
protected Object
getReferencedObject(String id)
protected boolean
isIndexedPropertyAssignment(String propertyPath)
protected boolean
isReference(String value)
protected boolean
isTypedProperty(Object object, String propertyName, Class clazz)
protected Object
resolveReference(String reference)
protected Object
resolveValue(String stringValue)
void
setInterpolator(Interpolator interpolator)
Sets theInterpolator
used when evaluating the right side of the expressions.void
setObjects(Map<String,?> objects)
protected byte[]
toBytes(String sValue)
protected Collection<?>
toCollection(String sValue)
protected List<?>
toList(String sValue)
protected Map<?,?>
toMap(String sValue)
protected Set<?>
toSet(String sValue)
protected String
unescapeIfNecessary(String value)
-
-
-
Constructor Detail
-
ReflectionBuilder
public ReflectionBuilder()
-
ReflectionBuilder
public ReflectionBuilder(Map<String,?> defaults)
-
-
Method Detail
-
getObjects
public Map<String,?> getObjects()
-
setObjects
public void setObjects(Map<String,?> objects)
- Parameters:
objects
-
-
findEventBus
protected EventBus findEventBus(Map<String,?> objects)
-
destroy
public void destroy()
-
createNewInstance
protected void createNewInstance(Map<String,Object> objects, String name, String value)
-
applyProperty
protected void applyProperty(String key, String value, Map objects)
-
applyGlobalProperty
protected void applyGlobalProperty(Map objects, String property, String value)
-
applySingleProperty
protected void applySingleProperty(Map objects, String name, String property, String value)
-
isReference
protected boolean isReference(String value)
-
getReferencedObject
protected Object getReferencedObject(String id)
-
unescapeIfNecessary
protected String unescapeIfNecessary(String value)
-
resolveReference
protected Object resolveReference(String reference)
-
isTypedProperty
protected boolean isTypedProperty(Object object, String propertyName, Class clazz)
-
toCollection
protected Collection<?> toCollection(String sValue)
-
resolveValue
protected Object resolveValue(String stringValue)
-
checkForNullOrEmptyLiteral
protected String checkForNullOrEmptyLiteral(String stringValue)
-
applyProperty
protected void applyProperty(Object object, String propertyPath, Object value)
-
isIndexedPropertyAssignment
protected boolean isIndexedPropertyAssignment(String propertyPath)
-
applyProperty
protected void applyProperty(Object object, String propertyName, String stringValue)
-
setInterpolator
public void setInterpolator(Interpolator interpolator)
Sets theInterpolator
used when evaluating the right side of the expressions.- Since:
- 1.4
-
-