net.jbock.annotated.ExecutableParameter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jbock-compiler Show documentation
Show all versions of jbock-compiler Show documentation
jbock annotation processor
package net.jbock.annotated;
import net.jbock.Parameter;
import net.jbock.common.EnumName;
import javax.lang.model.element.ExecutableElement;
import java.util.List;
import java.util.Optional;
import static net.jbock.annotated.AnnotatedParameter.createParameter;
import static net.jbock.common.Constants.optionalString;
final class ExecutableParameter extends Executable {
private final Parameter parameter;
ExecutableParameter(ExecutableElement method, Parameter parameter) {
super(method);
this.parameter = parameter;
}
@Override
AnnotatedMethod annotatedMethod(EnumName enumName) {
return createParameter(this, enumName);
}
@Override
Optional descriptionKey() {
return optionalString(parameter.descriptionKey());
}
@Override
List description() {
return List.of(parameter.description());
}
Optional paramLabel() {
return optionalString(parameter.paramLabel());
}
int index() {
return parameter.index();
}
}