File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed
processors/src/main/java/com/axellience/vuegwt/processors Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 11package com .axellience .vuegwt .processors .component .template ;
22
3- import static com .axellience .vuegwt .processors .utils .ComponentGeneratorsUtil .getComponentLocalComponents ;
4- import static com .axellience .vuegwt .processors .utils .ComponentGeneratorsUtil .getSuperComponentType ;
3+ import static com .axellience .vuegwt .processors .utils .ComponentGeneratorsUtil .*;
54import static com .axellience .vuegwt .processors .utils .GeneratorsNameUtil .componentToTagName ;
65import static com .axellience .vuegwt .processors .utils .GeneratorsNameUtil .computedPropertyNameToFieldName ;
76import static com .axellience .vuegwt .processors .utils .GeneratorsUtil .getComputedPropertyName ;
@@ -175,6 +174,13 @@ private void registerFieldsAndMethodsInContext(TemplateParserContext templatePar
175174 superComponent ,
176175 alreadyDoneVariable ,
177176 alreadyDoneMethods ));
177+
178+ getInterfaceTypes (componentTypeElement )
179+ .forEach (iface -> registerFieldsAndMethodsInContext (
180+ templateParserContext ,
181+ iface ,
182+ alreadyDoneVariable ,
183+ alreadyDoneMethods ));
178184 }
179185
180186 /**
Original file line number Diff line number Diff line change @@ -193,6 +193,23 @@ public static Optional<TypeElement> getSuperComponentType(TypeElement component)
193193 return Optional .of ((TypeElement ) ((DeclaredType ) component .getSuperclass ()).asElement ());
194194 }
195195
196+ /**
197+ * Return the {@link TypeElement}s of the interfaces of a given {@link
198+ * IsVueComponent}. If the {@link IsVueComponent} has not interfaces,
199+ * return an empty {@link List}
200+ *
201+ * @param component The {@link IsVueComponent} to get the super type of
202+ * @return The List of {@link TypeElement}s of the interfaces or an empty.
203+ */
204+ public static List <TypeElement > getInterfaceTypes (TypeElement component ) {
205+ List <TypeElement > interfaceElements = new LinkedList <>();
206+ for (TypeMirror m : component .getInterfaces ()) {
207+ interfaceElements .add ((TypeElement ) ((DeclaredType ) m ).asElement ());
208+ }
209+ return interfaceElements ;
210+ }
211+
212+
196213 /**
197214 * Return the number of super component in the chain of parents
198215 *
You can’t perform that action at this time.
0 commit comments