use of com.axellience.vuegwt.core.annotations.component.PropDefault in project vue-gwt by Axellience.
the class ComponentJsTypeGenerator method processPropDefaultValues.
/**
* Process prop default values from the Component Class.
* @param component {@link VueComponent} to process
* @param optionsBuilder A {@link MethodSpec.Builder} for the method that creates the
* {@link VueComponentOptions}
*/
private void processPropDefaultValues(TypeElement component, MethodSpec.Builder optionsBuilder, Builder componentJsTypeBuilder) {
getMethodsWithAnnotation(component, PropDefault.class).forEach(method -> {
PropDefault propValidator = method.getAnnotation(PropDefault.class);
String propertyName = propValidator.value();
optionsBuilder.addStatement("options.addJavaPropDefaultValue($S, $S)", method.getSimpleName().toString(), propertyName);
addProxyJsTypeMethodIfNecessary(componentJsTypeBuilder, method);
});
}
Aggregations