Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*******************************************************************************
* Copyright (c) 1998, 2013 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Contributors:
* 08/10/2009-2.0 Guy Pelletier
* - 267391: JPA 2.0 implement/extend/use an APT tooling library for MetaModel API canonical classes
* 08/25/2010-2.2 Guy Pelletier
* - 309445: CannonicalModelProcessor process all files
* 11/23/2010-2.2 Guy Pelletier
* - 330660: Canonical model generator throws ClassCastException when using package-info.java
******************************************************************************/
package org.eclipse.persistence.internal.jpa.modelgen.visitors;
import java.util.List;
import java.util.Set;
import javax.annotation.processing.ProcessingEnvironment;
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.TypeParameterElement;
import javax.lang.model.element.VariableElement;
import javax.lang.model.type.TypeMirror;
import javax.lang.model.util.AbstractElementVisitor6;
import javax.tools.Diagnostic.Kind;
import org.eclipse.persistence.internal.helper.Helper;
import org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAnnotatedElement;
import org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAnnotation;
import org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataClass;
import org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataField;
import org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataMethod;
import org.eclipse.persistence.internal.jpa.modelgen.MetadataMirrorFactory;
import org.eclipse.persistence.internal.jpa.modelgen.visitors.AnnotationValueVisitor;
import org.eclipse.persistence.internal.jpa.modelgen.visitors.TypeVisitor;
import static org.eclipse.persistence.internal.jpa.metadata.MetadataConstants.JPA_PERSISTENCE_PACKAGE_PREFIX;
import static org.eclipse.persistence.internal.jpa.metadata.MetadataConstants.ECLIPSELINK_PERSISTENCE_PACKAGE_PREFIX;
/**
* An element visitor.
*
* @author Guy Pelletier
* @since EclipseLink 1.2
*/
public class ElementVisitor extends AbstractElementVisitor6 {
private ProcessingEnvironment processingEnv;
private TypeVisitor typeVisitor;
/**
* INTERNAL:
*/
public ElementVisitor(ProcessingEnvironment processingEnv) {
this.processingEnv = processingEnv;
typeVisitor = new TypeVisitor();
}
/**
* INTERNAL:
* The pre-processing stages requires some knowledge of the annotation
* values (e.g. targetEntity) so we will visit the annotation values
* and build complete MetadataAnnotation from the mirrors.
*/
protected void buildMetadataAnnotations(MetadataAnnotatedElement annotatedElement, List annotationMirrors) {
AnnotationValueVisitor