| /******************************************************************************* |
| * Copyright (c) 2010 Oracle. 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: |
| * Oracle - initial API and implementation |
| ******************************************************************************/ |
| package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java; |
| |
| import org.eclipse.jpt.common.utility.internal.ArrayTools; |
| import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable; |
| import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition; |
| import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaBasicMappingDefinition; |
| import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConvertAnnotation; |
| import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMutableAnnotation; |
| |
| public class JavaEclipseLinkBasicMappingDefinition |
| extends AbstractJavaBasicMappingDefinition |
| { |
| // singleton |
| private static final DefaultJavaAttributeMappingDefinition INSTANCE = new JavaEclipseLinkBasicMappingDefinition(); |
| |
| /** |
| * Return the singleton. |
| */ |
| public static DefaultJavaAttributeMappingDefinition instance() { |
| return INSTANCE; |
| } |
| |
| |
| /** |
| * Enforce singleton usage |
| */ |
| private JavaEclipseLinkBasicMappingDefinition() { |
| super(); |
| } |
| |
| @Override |
| public Iterable<String> getSupportingAnnotationNames() { |
| return COMBINED_SUPPORTING_ANNOTATION_NAMES; |
| } |
| |
| // the EclipseLink Id and Version mappings also support these annotations |
| public static final String[] ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] { |
| EclipseLinkMutableAnnotation.ANNOTATION_NAME, |
| EclipseLinkConvertAnnotation.ANNOTATION_NAME, |
| }; |
| |
| protected static final String[] COMBINED_SUPPORTING_ANNOTATION_NAMES_ARRAY = ArrayTools.concatenate( |
| SUPPORTING_ANNOTATION_NAMES_ARRAY, |
| ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY |
| ); |
| protected static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(COMBINED_SUPPORTING_ANNOTATION_NAMES_ARRAY); |
| } |