Class 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.

    Recognizes Factory implementations and will call getInstance to satisfy any reference to this bean.
    Since:
    0.9
    • 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)
      • getBean

        public <T> T getBean(String id,
                             Class<T> requiredType)
      • 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)
      • toSet

        protected Set<?> toSet(String sValue)
      • toMap

        protected Map<?,?> toMap(String sValue)
      • toList

        protected List<?> toList(String sValue)
      • toBytes

        protected byte[] toBytes(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)