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. RecognizesFactoryimplementations and will callgetInstanceto 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 voidapplyGlobalProperty(Map objects, String property, String value)protected voidapplyProperty(Object object, String propertyPath, Object value)protected voidapplyProperty(Object object, String propertyName, String stringValue)protected voidapplyProperty(String key, String value, Map objects)protected voidapplySingleProperty(Map objects, String name, String property, String value)Map<String,?>buildObjects(Map<String,String> kvPairs)protected StringcheckForNullOrEmptyLiteral(String stringValue)protected voidcreateNewInstance(Map<String,Object> objects, String name, String value)voiddestroy()protected org.apache.shiro.event.EventBusfindEventBus(Map<String,?> objects)ObjectgetBean(String id)<T> TgetBean(String id, Class<T> requiredType)protected StringgetId(String referenceToken)Map<String,?>getObjects()protected ObjectgetReferencedObject(String id)protected booleanisIndexedPropertyAssignment(String propertyPath)protected booleanisReference(String value)protected booleanisTypedProperty(Object object, String propertyName, Class clazz)protected ObjectresolveReference(String reference)protected ObjectresolveValue(String stringValue)voidsetInterpolator(Interpolator interpolator)Sets theInterpolatorused when evaluating the right side of the expressions.voidsetObjects(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 StringunescapeIfNecessary(String value)
-
-
-
Method Detail
-
destroy
public void destroy()
-
createNewInstance
protected void createNewInstance(Map<String,Object> objects, String name, String value)
-
applySingleProperty
protected void applySingleProperty(Map objects, String name, String property, String value)
-
isReference
protected boolean isReference(String value)
-
toCollection
protected Collection<?> toCollection(String sValue)
-
toBytes
protected byte[] toBytes(String sValue)
-
isIndexedPropertyAssignment
protected boolean isIndexedPropertyAssignment(String propertyPath)
-
setInterpolator
public void setInterpolator(Interpolator interpolator)
Sets theInterpolatorused when evaluating the right side of the expressions.- Since:
- 1.4
-
-