blob: 42a60a11a5ba2a34f344ed4ec8d5e6551347d56d [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2009 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.core.internal.jpa2.resource.java;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinaryGeneratedAnnotation;
import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceGeneratedAnnotation;
import org.eclipse.jpt.core.jpa2.resource.java.GeneratedAnnotation;
import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.core.utility.jdt.Member;
import org.eclipse.jpt.core.utility.jdt.Type;
/**
* javax.annotation.Generated
* <p>
* This annotation definition is not really required; it's just here for a bit
* of consistency....
*/
public final class GeneratedAnnotationDefinition
implements AnnotationDefinition
{
// singleton
private static final GeneratedAnnotationDefinition INSTANCE = new GeneratedAnnotationDefinition();
/**
* Return the singleton.
*/
public static GeneratedAnnotationDefinition instance() {
return INSTANCE;
}
/**
* Ensure single instance.
*/
private GeneratedAnnotationDefinition() {
super();
}
public GeneratedAnnotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
return new SourceGeneratedAnnotation((JavaResourcePersistentType) parent, (Type) member);
}
public GeneratedAnnotation buildNullAnnotation(JavaResourcePersistentMember parent) {
return null;
}
public GeneratedAnnotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
return new BinaryGeneratedAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
}
public String getAnnotationName() {
return GeneratedAnnotation.ANNOTATION_NAME;
}
}