/** * <copyright> * * Copyright (c) 2005, 2006, 2007, 2008 Springsite BV (The Netherlands) and others * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Martin Taal * </copyright> * * $Id: EContainerFeatureIDAccessor.java,v 1.5 2008/02/28 07:08:24 mtaal Exp $ */ package org.eclipse.emf.teneo.hibernate.mapping.econtainer; import org.eclipse.emf.teneo.extension.ExtensionManager; import org.eclipse.emf.teneo.extension.ExtensionManagerAware; import org.eclipse.emf.teneo.extension.ExtensionPoint; import org.hibernate.PropertyNotFoundException; import org.hibernate.property.Getter; import org.hibernate.property.PropertyAccessor; import org.hibernate.property.Setter; /** * Creates the getter and setter for eContainerFeatureID members. * * @author <a href="mailto:mtaal@elver.org">Martin Taal</a> * @version $Revision: 1.5 $ */ @SuppressWarnings("unchecked") public class EContainerFeatureIDAccessor implements PropertyAccessor, ExtensionPoint, ExtensionManagerAware { private ExtensionManager extensionManager; /* * (non-Javadoc) * * @see org.hibernate.property.PropertyAccessor#getGetter(java.lang.Class, java.lang.String) */ public Getter getGetter(Class theClass, String propertyName) throws PropertyNotFoundException { final EContainerFeatureIDPropertyHandler handler = extensionManager.getExtension(EContainerFeatureIDPropertyHandler.class); handler.initialize(propertyName); return handler; } /* * (non-Javadoc) * * @see org.hibernate.property.PropertyAccessor#getSetter(java.lang.Class, java.lang.String) */ public Setter getSetter(Class theClass, String propertyName) throws PropertyNotFoundException { final EContainerFeatureIDPropertyHandler handler = extensionManager.getExtension(EContainerFeatureIDPropertyHandler.class); handler.initialize(propertyName); return handler; } /* * (non-Javadoc) * * @see org.eclipse.emf.teneo.extension.ExtensionManagerAware#setExtensionManager(org.eclipse.emf.teneo.extension.ExtensionManager) */ public void setExtensionManager(ExtensionManager extensionManager) { this.extensionManager = extensionManager; } }