|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emf.importer.java.builder.JavaEcoreBuilder
public class JavaEcoreBuilder
Nested Class Summary | |
---|---|
protected static class |
JavaEcoreBuilder.RequiredClassifierType
|
Field Summary | |
---|---|
protected BasicDiagnostic |
basicDiagnostic
A collection of the problems encountered during the processing. |
protected java.util.Set<EClassifier> |
demandCreatedEClassifiers
The set of classifiers that were demand created. |
protected static java.util.regex.Pattern |
eAnnotationDetailExpression
|
protected static java.util.regex.Pattern |
eAnnotationExpression
|
protected java.util.Set<EAttribute> |
eAttributes
The attributes that must be treated as attributes because the are explicitly declared to be of that kind. |
protected java.util.Map<EGenericType,EGenericType> |
ecoreEGenericTypeToJavaEGenericTypeMap
A map from a generic type to the possibly null generic type that represents its proper Java type. |
protected EcoreUtil.EGenericTypeConverter |
eGenericTypeConverter
The utility used to convert a generate type to a fully qualified Java instance type. |
protected java.util.Map<EModelElement,JNode> |
eModelElementToJNodeMap
The map from a model element to the corresponding JNode. |
protected java.util.Map<EPackage,java.util.Map<java.lang.Object,java.lang.Integer>> |
ePackageToOrderingMap
The map from package to the map of ordering constants. |
protected java.util.Map<EPackage,java.lang.String> |
ePackageToPrefixMap
The map from package to the it's prefix. |
protected java.util.Map<EReference,java.util.List<java.lang.String>> |
eReferenceToKeyNamesMap
The map from a reference to the names of its keys. |
protected java.util.Map<EReference,java.lang.String> |
eReferenceToOppositeNameMap
The map from a reference to the name of its opposite. |
protected java.util.Set<EStructuralFeature> |
eStructuralFeatures
The features handled during the traversal. |
protected static java.util.regex.Pattern |
extendsAnnotationExpression
The pattern for extracting the @extends annotations. |
protected java.util.Collection<GenModel> |
externalGenModels
All the external GenModels from all required projects. |
protected java.util.Map<java.lang.String,EPackage> |
externalPackageNameToEPackageMap
The map from a package name to the corresponding package. |
protected static FacadeHelper |
facadeHelper
The factory used to create JNodes. |
protected boolean |
foundJava
Set to true when a compilation unit is processed and hence indicates if anything to process has been found. |
protected GenModel |
genModel
The GenModel being generated. |
protected IFile |
genModelFile
The file being generated. |
protected static java.util.regex.Pattern |
implementsAnnotationExpression
The pattern for extracting the @implements annotations. |
protected static java.lang.String |
MAP_ENTRY_CLASS_CONTAINER_ANNOTATION_SOURCE
|
protected static java.util.regex.Pattern |
modelAnnotationExpression
The pattern for extracting the @model annotations. |
protected static java.util.regex.Pattern |
modelDocExpression
The pattern for extracting the model documentation. |
protected GenModel |
oldGenModelVersion
The old version to against which to reconcile. |
protected java.util.Map<java.lang.String,EPackage> |
packageNameToEPackageMap
The map from a package name to the corresponding package. |
protected java.util.Set<EReference> |
transientEReferenceWithOpposite
The set of references that have opposites and have been explicitly marked as being transient. |
protected java.util.Collection<GenPackage> |
usedGenPackages
All the used GenPackages. |
Constructor Summary | |
---|---|
JavaEcoreBuilder(IFile genModelFile)
Creates a builder for the given file. |
|
JavaEcoreBuilder(IFile genModelFile,
GenModel oldGenModelVersion)
|
|
JavaEcoreBuilder(IFile genModelFile,
GenModel oldGenModelVersion,
GenModel genModel)
|
Method Summary | ||
---|---|---|
protected void |
addToPackage(EPackage ePackage,
EClassifier eClassifier)
|
|
protected void |
analyzeCompilationUnit(JCompilationUnit compilationUnit)
Walks the compilation unit to analyze the type. |
|
protected java.util.List<EGenericType> |
analyzeEGenericTypes(java.lang.String genericTypes)
|
|
protected void |
analyzeEnum(JEnum enumeration)
|
|
protected boolean |
analyzeEnumLiteral(EEnum eEnum,
JMember member)
Creates EEnumLiteral as appropriate. |
|
protected void |
analyzeMethod(EClass eClass,
JMethod method)
Creates an EOperation, EAttribute, or EReference as appropriate. |
|
protected ETypedElement |
analyzeMethod(EClass eClass,
java.lang.String modelAnnotation,
java.lang.String methodName,
java.lang.String returnType,
java.lang.String[] parameterNames,
java.lang.String[] parameterTypes,
java.lang.String[] exceptionTypes,
java.lang.String[] typeParameters)
|
|
protected IPath |
analyzeProject(IProject project)
|
|
protected void |
analyzeType(JType type)
Walks the type either as an EClass or an ENum to analyze either the methods or the fields. |
|
void |
computeEPackages(Monitor monitor,
ModelImporter modelImporter)
|
|
protected EStructuralFeature |
createFeature(EClass eClass,
java.lang.String name,
EGenericType eGenericType)
|
|
protected ResourceSet |
createResourceSet()
|
|
void |
determineExternalPackages(GenPackage genPackage)
|
|
protected void |
determineExternalPackages(GenPackage genPackage,
ModelImporter modelImporter)
|
|
protected void |
error(java.lang.String message)
Produces another IStatus in the MultiStatus. |
|
protected java.util.List<EAnnotation> |
extractEAnnotations(java.lang.String modelAnnotation)
|
|
void |
getAllGenModelFiles(java.util.Collection<IFile> result,
IContainer container)
Walks the container recursively. |
|
void |
getAllGenModelFiles(java.util.Collection<IFile> result,
IFile file)
Walks the container recursively. |
|
void |
getAllReferencedProjects(java.util.Collection<IProject> result,
IProject[] projects)
Walks the projects recursively. |
|
Diagnostic |
getDiagnostic()
Returns the diagnostic. |
|
protected EPackage |
getEPackage(JNode node)
|
|
protected java.lang.String |
getExtendsAnnotation(java.lang.String comment)
Returns the @extends/@implements annotation contents, or null. |
|
protected java.lang.String |
getFilteredModelAnnotations(java.lang.String modelAnnotation,
java.lang.String filter)
Returns the filtered matches xyzAttribute-name="value" or of xyxAttribute-name='value', or null. |
|
GenModel |
getGenModel()
Returns the generator model. |
|
protected JCompilationUnit |
getJCompilationUnit(EModelElement eModelElement)
|
|
protected java.lang.String |
getModelAnnotation(java.lang.String comment)
Returns the @model annotation contents, or null. |
|
protected java.lang.String |
getModelAnnotationAttribute(java.lang.String modelAnnotation,
java.lang.String attributeName)
Returns the unquoted value of attribute-name="value" or of attribute-name='value', or null. |
|
protected java.lang.String |
getModelAnnotationAttributes(java.lang.String modelAnnotation,
java.lang.String attributeName)
Returns the space separated concatenation of the unquoted value of each attribute-name="value" or attribute-name='value' repeat, or null. |
|
protected java.lang.String |
getModelDocumentation(java.lang.String comment)
Returns the model documentation, or null. |
|
protected
|
getNamedElement(java.util.List<T> namedElements,
java.lang.String name)
|
|
protected int |
getOrderingValue(ENamedElement eNamedElement,
java.util.Map<java.lang.Object,java.lang.Integer> nameToIDMap)
|
|
java.util.Collection<GenPackage> |
getUsedGenPackages()
Returns the list of used GenPackages. |
|
protected void |
handleETypedElement(ETypedElement eTypedElement,
java.lang.String name,
java.lang.String type,
java.lang.String modelAnnotation,
java.lang.String identifierName)
|
|
protected boolean |
isListType(java.lang.String type)
|
|
protected boolean |
isMapType(java.lang.String type)
|
|
protected void |
match(java.util.List<EGenericType> target,
java.util.List<EGenericType> javaEGenericTypes,
java.util.List<EGenericType> ecoreEGenericTypes)
|
|
protected void |
resolve(EModelElement eModelElement,
EGenericType ecoreEGenericType,
EGenericType javaEGenericType)
|
|
protected void |
resolve(EModelElement eModelElement,
EGenericType eGenericType,
JavaEcoreBuilder.RequiredClassifierType requiredClassifierType)
|
|
protected EGenericType |
resolve(EModelElement eModelElement,
java.lang.String typeName,
JavaEcoreBuilder.RequiredClassifierType requiredClassifierType,
boolean recordDemandCreatedEClassifier)
|
|
protected EGenericType |
resolveMapEntry(EPackage ePackage,
EGenericType keyEGenericType,
EGenericType valueEGenericType)
|
|
protected
|
sort(EList<T> namedElements,
java.util.Map<java.lang.Object,java.lang.Integer> nameToIDMap)
|
|
protected java.lang.String |
stripTypeArguments(java.lang.String type)
Strips the type arguments from the type, if it has any. |
|
void |
traverse(IContainer container,
java.util.Set<IResource> visited)
Walks the container recursively. |
|
void |
traverse(IFile file)
Analyzes .java files as compilation units. |
|
void |
used(EGenericType eGenericType)
|
|
void |
used(EModelElement modelElement)
|
|
protected void |
warning(java.lang.String message)
Produces another IStatus in the MultiStatus, with warning severity. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static FacadeHelper facadeHelper
protected IFile genModelFile
protected GenModel genModel
protected java.util.Map<java.lang.String,EPackage> externalPackageNameToEPackageMap
protected java.util.Map<java.lang.String,EPackage> packageNameToEPackageMap
protected java.util.Map<EPackage,java.util.Map<java.lang.Object,java.lang.Integer>> ePackageToOrderingMap
protected java.util.Map<EPackage,java.lang.String> ePackageToPrefixMap
protected java.util.Map<EModelElement,JNode> eModelElementToJNodeMap
protected java.util.Set<EStructuralFeature> eStructuralFeatures
protected java.util.Set<EAttribute> eAttributes
protected java.util.Map<EGenericType,EGenericType> ecoreEGenericTypeToJavaEGenericTypeMap
protected java.util.Set<EClassifier> demandCreatedEClassifiers
protected java.util.Map<EReference,java.lang.String> eReferenceToOppositeNameMap
protected java.util.Set<EReference> transientEReferenceWithOpposite
protected java.util.Map<EReference,java.util.List<java.lang.String>> eReferenceToKeyNamesMap
protected java.util.Collection<GenModel> externalGenModels
protected java.util.Collection<GenPackage> usedGenPackages
protected BasicDiagnostic basicDiagnostic
protected boolean foundJava
protected GenModel oldGenModelVersion
protected EcoreUtil.EGenericTypeConverter eGenericTypeConverter
protected static final java.lang.String MAP_ENTRY_CLASS_CONTAINER_ANNOTATION_SOURCE
protected static java.util.regex.Pattern modelDocExpression
protected static java.util.regex.Pattern modelAnnotationExpression
protected static java.util.regex.Pattern extendsAnnotationExpression
protected static java.util.regex.Pattern implementsAnnotationExpression
protected static java.util.regex.Pattern eAnnotationExpression
protected static java.util.regex.Pattern eAnnotationDetailExpression
Constructor Detail |
---|
public JavaEcoreBuilder(IFile genModelFile)
public JavaEcoreBuilder(IFile genModelFile, GenModel oldGenModelVersion)
public JavaEcoreBuilder(IFile genModelFile, GenModel oldGenModelVersion, GenModel genModel)
Method Detail |
---|
protected ResourceSet createResourceSet()
protected IPath analyzeProject(IProject project) throws java.lang.Exception
java.lang.Exception
public void computeEPackages(Monitor monitor, ModelImporter modelImporter) throws java.lang.Exception
java.lang.Exception
public void used(EGenericType eGenericType)
public void used(EModelElement modelElement)
public void determineExternalPackages(GenPackage genPackage)
protected void determineExternalPackages(GenPackage genPackage, ModelImporter modelImporter)
public void getAllReferencedProjects(java.util.Collection<IProject> result, IProject[] projects) throws CoreException
CoreException
public void getAllGenModelFiles(java.util.Collection<IFile> result, IContainer container) throws CoreException
CoreException
public void getAllGenModelFiles(java.util.Collection<IFile> result, IFile file) throws CoreException
CoreException
public void traverse(IContainer container, java.util.Set<IResource> visited) throws CoreException
CoreException
public void traverse(IFile file) throws CoreException
CoreException
protected void analyzeCompilationUnit(JCompilationUnit compilationUnit)
protected void analyzeEnum(JEnum enumeration)
protected EPackage getEPackage(JNode node)
protected void analyzeType(JType type)
protected void analyzeMethod(EClass eClass, JMethod method)
protected ETypedElement analyzeMethod(EClass eClass, java.lang.String modelAnnotation, java.lang.String methodName, java.lang.String returnType, java.lang.String[] parameterNames, java.lang.String[] parameterTypes, java.lang.String[] exceptionTypes, java.lang.String[] typeParameters)
protected java.util.List<EGenericType> analyzeEGenericTypes(java.lang.String genericTypes)
protected boolean isListType(java.lang.String type)
protected boolean isMapType(java.lang.String type)
protected void handleETypedElement(ETypedElement eTypedElement, java.lang.String name, java.lang.String type, java.lang.String modelAnnotation, java.lang.String identifierName)
protected JCompilationUnit getJCompilationUnit(EModelElement eModelElement)
protected java.lang.String stripTypeArguments(java.lang.String type)
protected EStructuralFeature createFeature(EClass eClass, java.lang.String name, EGenericType eGenericType)
protected boolean analyzeEnumLiteral(EEnum eEnum, JMember member)
true
when the method has created an EnumLiteral after
analyzing the JMemberprotected java.lang.String getModelDocumentation(java.lang.String comment)
protected java.lang.String getModelAnnotation(java.lang.String comment)
protected java.lang.String getExtendsAnnotation(java.lang.String comment)
protected java.lang.String getModelAnnotationAttribute(java.lang.String modelAnnotation, java.lang.String attributeName)
protected java.lang.String getModelAnnotationAttributes(java.lang.String modelAnnotation, java.lang.String attributeName)
protected java.util.List<EAnnotation> extractEAnnotations(java.lang.String modelAnnotation)
protected java.lang.String getFilteredModelAnnotations(java.lang.String modelAnnotation, java.lang.String filter)
protected void match(java.util.List<EGenericType> target, java.util.List<EGenericType> javaEGenericTypes, java.util.List<EGenericType> ecoreEGenericTypes)
protected void resolve(EModelElement eModelElement, EGenericType ecoreEGenericType, EGenericType javaEGenericType)
protected void resolve(EModelElement eModelElement, EGenericType eGenericType, JavaEcoreBuilder.RequiredClassifierType requiredClassifierType)
protected EGenericType resolve(EModelElement eModelElement, java.lang.String typeName, JavaEcoreBuilder.RequiredClassifierType requiredClassifierType, boolean recordDemandCreatedEClassifier)
protected void addToPackage(EPackage ePackage, EClassifier eClassifier)
protected EGenericType resolveMapEntry(EPackage ePackage, EGenericType keyEGenericType, EGenericType valueEGenericType)
protected <T extends ENamedElement> void sort(EList<T> namedElements, java.util.Map<java.lang.Object,java.lang.Integer> nameToIDMap)
protected int getOrderingValue(ENamedElement eNamedElement, java.util.Map<java.lang.Object,java.lang.Integer> nameToIDMap)
protected <T extends ENamedElement> T getNamedElement(java.util.List<T> namedElements, java.lang.String name)
public Diagnostic getDiagnostic()
public GenModel getGenModel()
public java.util.Collection<GenPackage> getUsedGenPackages()
protected void error(java.lang.String message)
message
- a description of the error.protected void warning(java.lang.String message)
message
- a description of the error.
|
Copyright 2001-2006 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |