Search in sources :

Example 1 with PropDefault

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);
    });
}
Also used : PropDefault(com.axellience.vuegwt.core.annotations.component.PropDefault)

Aggregations

PropDefault (com.axellience.vuegwt.core.annotations.component.PropDefault)1