Skip to content

Commit 8832182

Browse files
committed
#21 Support nested properties in code-completion
1 parent 63dd1f1 commit 8832182

File tree

4 files changed

+205
-65
lines changed

4 files changed

+205
-65
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Eclipse
22
.metadata
3+
.recommenders
34
.classpath
45
.project
56
.settings

org.mapstruct.eclipse/src/org/mapstruct/eclipse/internal/Bindings.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,30 +44,30 @@ private Bindings() {
4444

4545
/**
4646
* @param type the type
47-
* @return the method names declared in the class or a super type of it
47+
* @return the methods declared in the class or a super type of it
4848
*/
49-
public static Set<String> findAllMethodNames(ITypeBinding type) {
50-
Set<String> result = new HashSet<String>();
49+
public static Set<IMethodBinding> findAllMethods(ITypeBinding type) {
50+
Set<IMethodBinding> result = new HashSet<IMethodBinding>();
5151

52-
collectMethodNames( type, new HashSet<ITypeBinding>(), result );
52+
collectMethods( type, new HashSet<ITypeBinding>(), result );
5353

5454
return result;
5555
}
5656

57-
private static void collectMethodNames(ITypeBinding type, Set<ITypeBinding> visited,
58-
Collection<String> methodNames) {
57+
private static void collectMethods(ITypeBinding type, Set<ITypeBinding> visited,
58+
Collection<IMethodBinding> methods) {
5959
if ( !isJavaLangObject( type ) && visited.add( type ) ) {
6060
for ( IMethodBinding methodBinding : type.getDeclaredMethods() ) {
61-
methodNames.add( methodBinding.getName() );
61+
methods.add( methodBinding );
6262
}
6363

6464
for ( ITypeBinding ifc : type.getInterfaces() ) {
65-
collectMethodNames( ifc, visited, methodNames );
65+
collectMethods( ifc, visited, methods );
6666
}
6767

6868
ITypeBinding superClass = type.getSuperclass();
6969
if ( superClass != null ) {
70-
collectMethodNames( superClass, visited, methodNames );
70+
collectMethods( superClass, visited, methods );
7171
}
7272
}
7373
}

org.mapstruct.eclipse/src/org/mapstruct/eclipse/internal/MapStructAPIConstants.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,9 @@ private MapStructAPIConstants() {
9595
* Fully qualified name of the annotation MappingTarget
9696
*/
9797
public static final String MAPPING_TARGET_FQ_NAME = "org.mapstruct.MappingTarget"; //$NON-NLS-1$
98+
99+
/**
100+
* Fully qualified name of the annotation Context
101+
*/
102+
public static final String CONTEXT_FQ_NAME = "org.mapstruct.Context"; //$NON-NLS-1$
98103
}

0 commit comments

Comments
 (0)