/** * Unwrap meta value. * * @param metaValue the meta value * @return unwrapped value */ protected Object unwrap(MetaValue metaValue) { return valueFactory.unwrap(metaValue); }
/** * Convert a simple meta value to a String. * * @param value the simple meta value. * @return the string. */ protected String convertSimple2String(SimpleValue value) { if(value == null) throw new IllegalArgumentException("Null value."); Object unwrappedValue = getMetaValueFactory().unwrap(value); if(unwrappedValue == null) return null; // Convert to String return ("" + unwrappedValue); }
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if (Object.class.equals(method.getDeclaringClass())) return handleObjectInvocation(method.getName(), args); MetaValue value = compositeValue.get(getCompositeDataKey(method)); Type returnType = method.getGenericReturnType(); return factory.unwrap(value, returnType); }
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { Class<?> declaringClass = method.getDeclaringClass(); if (Object.class.equals(declaringClass)) return handleObjectInvocation(method.getName(), args); Type returnType = method.getGenericReturnType(); // size if(method.getName().equals("size")) return compositeValue.values().size(); MetaValue value = compositeValue.get(getCompositeDataKey(method)); return factory.unwrap(value, returnType); }
/** * Extract the value from the property MetaValue * @param info - template info * @param propName - the name of the property to return a value for * @return the unwrapped property value */ private Object getProperty(DeploymentTemplateInfo info, String propName) { Map<String, ManagedProperty> propsInfo = info.getProperties(); ManagedProperty prop = propsInfo.get(propName); if(prop == null) { return null; } Object value = prop.getValue(); if(value instanceof MetaValue) { return mvf.unwrap((MetaValue) value); } return value; }
public void setValue(BeanInfo beanInfo, ManagedProperty property, AbstractBeanMetaData attachment, MetaValue value) { String name = property.getName(); PropertyMetaData pmd = getExactPropertyMetaData(attachment, name); PropertyInfo propertyInfo = beanInfo.getProperty(name); if (pmd instanceof AbstractPropertyMetaData) { AbstractPropertyMetaData apmd = (AbstractPropertyMetaData)pmd; apmd.setValue(new AbstractValueMetaData(metaValueFactory.unwrap(value, propertyInfo.getType()))); } }
public void setValue(BeanInfo beanInfo, ManagedProperty property, AbstractBeanMetaData attachment, MetaValue value) { String name = property.getName(); PropertyMetaData pmd = getExactPropertyMetaData(attachment, name); PropertyInfo propertyInfo = beanInfo.getProperty(name); if (pmd instanceof AbstractPropertyMetaData) { AbstractPropertyMetaData apmd = (AbstractPropertyMetaData)pmd; apmd.setValue(new AbstractValueMetaData(metaValueFactory.unwrap(value, propertyInfo.getType()))); } }
String svalue = (String) getMetaValueFactory().unwrap(mapValue.get(name)); prop.setValue(svalue); list.add(prop);
String svalue = (String) getMetaValueFactory().unwrap(mapValue.get(name)); prop.setValue(svalue); list.add(prop);
Object unwrapped = metaValueFactory.unwrap(value, propertyInfo.getType()); if(unwrapped != null)
plainValue = metaValueFactory.unwrap(value, propertyInfo.getType());