blob: 94d71a1a50b3509dd99ea11ed54ea2db56b0e518 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2009, 2011 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.core.internal.jpa2.resource.java;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.binary.BinaryMapKeyJoinColumn2_0Annotation;
import org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.source.SourceMapKeyJoinColumn2_0Annotation;
import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
/**
* javax.persistence.MapKeyJoinColumn
*/
public final class MapKeyJoinColumn2_0AnnotationDefinition
implements NestableAnnotationDefinition
{
// singleton
private static final NestableAnnotationDefinition INSTANCE = new MapKeyJoinColumn2_0AnnotationDefinition();
/**
* Return the singleton.
*/
public static NestableAnnotationDefinition instance() {
return INSTANCE;
}
/**
* Ensure single instance.
*/
private MapKeyJoinColumn2_0AnnotationDefinition() {
super();
}
public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index) {
return SourceMapKeyJoinColumn2_0Annotation.buildSourceMapKeyJoinColumnAnnotation(parent, annotatedElement, index);
}
public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation, int index) {
return new BinaryMapKeyJoinColumn2_0Annotation(parent, jdtAnnotation);
}
public String getNestableAnnotationName() {
return JPA2_0.MAP_KEY_JOIN_COLUMN;
}
public String getContainerAnnotationName() {
return JPA2_0.MAP_KEY_JOIN_COLUMNS;
}
public String getElementName() {
return JPA2_0.MAP_KEY_JOIN_COLUMNS__VALUE;
}
}