/** * {@inheritDoc} */ public IAccessor createPropertyAccessor(String property, Class<?> beanClass) { return getAccessorDelegate(beanClass).createPropertyAccessor(property, beanClass); }
/** * {@inheritDoc} */ public ICollectionAccessor createCollectionPropertyAccessor(String property, Class<?> beanClass, Class<?> elementClass) { return getAccessorDelegate(beanClass).createCollectionPropertyAccessor( property, beanClass, elementClass); }
try { entityFactory.getAccessorFactory().createPropertyAccessor(propertyName, componentDescriptor.getComponentContract()).getValue(componentToClone); } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { entityFactory.getAccessorFactory().createPropertyAccessor(propertyName, getComponentContract(componentToClone)).getValue(componentToClone); } catch (IllegalAccessException | NoSuchMethodException ex) { .getReferencedDescriptor().getElementDescriptor().getComponentContract(); ICollectionAccessor collectionAccessor = entityFactory.getAccessorFactory().createCollectionPropertyAccessor( collectionDescriptor.getName(), masterContract, getComponentContract(clonedComponent)); if (collectionAccessor instanceof IModelDescriptorAware) {
private void registerDependsOnListeners(DependsOn dependsOn, IPropertyChangeCapable sourceBean, Method method, IAccessorFactoryProvider accessorFactoryProvider) { IAccessorFactory accessorFactory = accessorFactoryProvider.getAccessorFactory(); AccessorInfo accessorInfo = accessorFactory.getAccessorInfo(method); String targetProperty = accessorInfo.getAccessedPropertyName(); EAccessorType accessorType = accessorInfo.getAccessorType();
getAccessorFactory().createPropertyAccessor(propertyName, componentContract).getValue(component); if (propertyDescriptor instanceof IReferencePropertyDescriptor && propertyValue instanceof IEntity) { if (((IRelationshipEndPropertyDescriptor) propertyDescriptor).isComposition()) { getAccessorFactory().createPropertyAccessor(reversePropertyDescriptor.getName(), getComponentContract(((IComponent) propertyValue))).setValue(propertyValue, null); Collection<Object> reverseCollection = getAccessorFactory().createPropertyAccessor( reversePropertyDescriptor.getName(), getComponentContract(((IComponent) propertyValue))) .getValue(propertyValue); propertyValue, reverseCollection, component); } else { getAccessorFactory().createCollectionPropertyAccessor(reversePropertyDescriptor.getName(), getComponentContract(((IComponent) propertyValue)), componentContract).removeFromValue( propertyValue, component); getAccessorFactory().createPropertyAccessor(reversePropertyDescriptor.getName(), getComponentContract((IComponent) collectionElement)).setValue(collectionElement, null); Collection<Object> reverseCollection = getAccessorFactory().createPropertyAccessor( reversePropertyDescriptor.getName(), getComponentContract((IComponent) collectionElement)).getValue(collectionElement); collectionElement, reverseCollection, component); } else { getAccessorFactory().createCollectionPropertyAccessor(reversePropertyDescriptor.getName(), getComponentContract((IComponent) collectionElement), componentContract) .removeFromValue(collectionElement, component);
private void unregisterDependsOnListeners(DependsOn dependsOn, IPropertyChangeCapable sourceBean, Method method, IAccessorFactoryProvider accessorFactoryProvider) { IAccessorFactory accessorFactory = accessorFactoryProvider.getAccessorFactory(); AccessorInfo accessorInfo = accessorFactory.getAccessorInfo(method); String targetProperty = accessorInfo.getAccessedPropertyName(); EAccessorType accessorType = accessorInfo.getAccessorType();
/** * {@inheritDoc} * * @param propertyName * the property name * @return the object */ @Override public Object get(String propertyName) { try { return accessorFactory.createPropertyAccessor(propertyName, getClass()).getValue(this); } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException ex) { throw new ComponentException(ex, "Can not read component property " + propertyName + " on " + getClass().getName()); } }
oldProperty = accessorFactory.createPropertyAccessor(propertyName, componentDescriptor.getComponentContract()) .getValue(proxy); } catch (IllegalAccessException | NoSuchMethodException ex) { ((IRelationshipEndPropertyDescriptor) propertyDescriptor)); IAccessor reversePropertyAccessor = accessorFactory.createPropertyAccessor( reversePropertyDescriptor.getName(), ((IReferencePropertyDescriptor<?>) propertyDescriptor).getReferencedDescriptor() ICollectionAccessor reversePropertyAccessor = accessorFactory.createCollectionPropertyAccessor( reversePropertyDescriptor.getName(), ((IReferencePropertyDescriptor<?>) propertyDescriptor).getReferencedDescriptor() oldPropertyElementsToRemove.removeAll(propertyElementsToKeep); newPropertyElementsToAdd.removeAll(propertyElementsToKeep); ICollectionAccessor propertyAccessor = accessorFactory.createCollectionPropertyAccessor(propertyName, componentDescriptor.getComponentContract(), ((ICollectionPropertyDescriptor<?>) propertyDescriptor).getCollectionDescriptor().getElementDescriptor()
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { String methodName = method.getName(); ICollectionAccessor wrappedAccessor = accessorFactory.createCollectionPropertyAccessor(propertyName, holder.getComponentContract(), elementType); switch (methodName) {
return invokeLifecycleInterceptors(proxy, method, args); AccessorInfo accessorInfo = getAccessorFactory().getAccessorInfo(method); EAccessorType accessorType = accessorInfo.getAccessorType(); IPropertyDescriptor propertyDescriptor = null;
/** * {@inheritDoc} * * @param propertyName * the property name * @param propertyValue * the property value */ @Override public void set(String propertyName, Object propertyValue) { try { accessorFactory.createPropertyAccessor(propertyName, getClass()).setValue(this, propertyValue); } catch (NoSuchMethodException | InvocationTargetException | IllegalArgumentException | IllegalAccessException ex) { throw new ComponentException(ex, "Can not write component property " + propertyName + " on " + getClass().getName()); } } }
if (reversePropertyDescriptor != null) { if (reversePropertyDescriptor instanceof IReferencePropertyDescriptor<?>) { accessorFactory.createPropertyAccessor(reversePropertyDescriptor.getName(), propertyDescriptor.getReferencedDescriptor().getElementDescriptor().getComponentContract()).setValue( value, proxy); } else if (reversePropertyDescriptor instanceof ICollectionPropertyDescriptor<?>) { ICollectionAccessor collectionAccessor = accessorFactory.createCollectionPropertyAccessor( reversePropertyDescriptor.getName(), propertyDescriptor.getReferencedDescriptor().getElementDescriptor().getComponentContract(),
.getComponentContract(); ICollectionAccessor translationsAccessor = getAccessorFactory(). createCollectionPropertyAccessor( translationsPropertyName, getComponentContract(),
elementContract = elt.getClass(); IAccessor accessor = accessorFactory.createPropertyAccessor( propertyName, elementContract); E modelValue = accessor.getValue(elt);
if (reversePropertyDescriptor != null) { if (reversePropertyDescriptor instanceof IReferencePropertyDescriptor<?>) { accessorFactory.createPropertyAccessor(reversePropertyDescriptor.getName(), propertyDescriptor.getReferencedDescriptor().getElementDescriptor().getComponentContract()).setValue( value, null); } else if (reversePropertyDescriptor instanceof ICollectionPropertyDescriptor<?>) { ICollectionAccessor collectionAccessor = accessorFactory.createCollectionPropertyAccessor( reversePropertyDescriptor.getName(), propertyDescriptor.getReferencedDescriptor().getElementDescriptor().getComponentContract(),
Class<?> newComponentContract = addedComponentDescriptor.getComponentContract(); Object master = collectionConnector.getParentConnector().getConnectorValue(); ICollectionAccessor collectionAccessor = getAccessorFactory(context).createCollectionPropertyAccessor( collectionConnector.getId(), master.getClass()
/** * {@inheritDoc} */ @Override protected Object retrievePropertyValue(String propertyName) { try { return getAccessorFactory().createPropertyAccessor(propertyName, getComponentContract()).getValue(delegate); } catch (IllegalAccessException | NoSuchMethodException ex) { throw new ComponentException(ex); } catch (InvocationTargetException ex) { if (ex.getCause() instanceof RuntimeException) { throw (RuntimeException) ex.getCause(); } throw new ComponentException(ex.getCause()); } }
targetContract = master.getClass(); ICollectionAccessor collectionAccessor = getAccessorFactory(context).createCollectionPropertyAccessor( collectionConnector.getId(), targetContract
try { IAccessor sessionAccessor = getAccessorFactory() .createPropertyAccessor(sessionProperty, sessionContract); initValue = sessionAccessor.getValue(applicationSession); if (LOG.isDebugEnabled()) {
.createCollectionPropertyAccessor( collectionConnector.getId(), targetContract