diff options
Diffstat (limited to 'hibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapping/econtainer/EContainerFeatureIDAccessor.java')
-rwxr-xr-x | hibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapping/econtainer/EContainerFeatureIDAccessor.java | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/hibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapping/econtainer/EContainerFeatureIDAccessor.java b/hibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapping/econtainer/EContainerFeatureIDAccessor.java new file mode 100755 index 000000000..fbc6a7a31 --- /dev/null +++ b/hibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapping/econtainer/EContainerFeatureIDAccessor.java @@ -0,0 +1,71 @@ +/** + * <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.6 2010/02/04 10:53:07 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.6 $ + */ +public class EContainerFeatureIDAccessor implements PropertyAccessor, ExtensionPoint, ExtensionManagerAware { + + private ExtensionManager extensionManager; + + /* + * (non-Javadoc) + * + * @see org.hibernate.property.PropertyAccessor#getGetter(java.lang.Class, java.lang.String) + */ + @SuppressWarnings("rawtypes") + 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) + */ + @SuppressWarnings("rawtypes") + 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; + } +}
\ No newline at end of file |