default Object getRawValue(Object bean) { return getValue(bean); }
@Override public Object getAttribute(String name) throws AttributeNotFoundException, MBeanException, ReflectionException { MAttribute a = this.attributes.get(name); if(null == a) { throw new AttributeNotFoundException("Attribute '" + name + "' not found in '" + bean.getClass() + "'"); } try{ Object value = a.valued().getValue(bean); if(a.isOpen()) { value = MConverts.convert(value, a.getOpenType()); } return value; }catch(ReflectException e) { throw new ReflectionException(e); }catch(Exception e) { throw new MBeanException(e); } }
protected void doBeanConfigureDynaProperty(Object bean, ReflectValued v, String key, String defaultValue) { Property value = (Property)v.getValue(bean);
private void configureNested(Object bean, String keyPrefix, ReflectValued member, Configurable.Nested nested) { String nestedPrefix = nested.prefix(); if(Strings.isEmpty(nestedPrefix)) { nestedPrefix = Strings.lowerUnderscore(member.getName()); if(nestedPrefix.endsWith("_config")) { nestedPrefix = Strings.removeEnd(nestedPrefix, "_config"); } } String fullKeyPrefix = keyPrefix(keyPrefix + nestedPrefix); Object nestedBean = member.getValue(bean); BeanType nestedType; if(null == nestedBean) { nestedType = BeanType.of(member.getType()); nestedBean = nestedType.newInstance(); member.setValue(bean, nestedBean); }else{ nestedType = BeanType.of(nestedBean.getClass()); } configure(nestedBean, nestedType, fullKeyPrefix); }