/** * Creates an {@link AnnotationUsage} with the specified {@code Type} and * adds it to this model. * * @param annotation the new annotation usage * @return a reference to this * * @since 2.5 */ default T annotate(final Type annotation) { return annotate(AnnotationUsage.of(annotation)); }
@Override public AnnotationUsage copy() { final AnnotationUsage copy = AnnotationUsage.of(getType()); getValue().ifPresent(copy::set); return copy; } }
protected AnnotationUsage generated() { final String owner = infoComponent.getTitle(); return AnnotationUsage.of(GeneratedCode.class).set(Value.ofText(owner)); }
/** * Creates an {@link AnnotationUsage} with the specified {@code Type} and * adds it to this model. This method will also set the {@code value()} * of the annotation to {@code textValue}. * * @param annotation the new annotation usage * @param textValue the value of the text for this annotation * @return a reference to this * * @since 2.5 */ default T annotate(final Type annotation, String textValue) { return annotate(AnnotationUsage.of(annotation).set(ofText(textValue))); }
private AnnotationUsage withExecuteBefore(File file) { file.add(Import.of(State.class).static_().setStaticMember("RESOLVED")); return AnnotationUsage.of(ExecuteBefore.class).set(Value.ofReference("RESOLVED")); }
/** * Creates an {@link AnnotationUsage} with the specified {@code Type} and * adds it to this model. * * @param annotation the new annotation usage * @return a reference to this * * @since 2.5 */ default T annotate(final Type annotation) { return annotate(AnnotationUsage.of(annotation)); }
@Override public AnnotationUsage copy() { final AnnotationUsage copy = AnnotationUsage.of(getType()); getValue().ifPresent(copy::set); return copy; } }
@Override public AnnotationUsage copy() { final AnnotationUsage copy = AnnotationUsage.of(getType()); getValue().ifPresent(copy::set); return copy; } }
/** * Creates an {@link AnnotationUsage} with the specified {@code Type} and * adds it to this model. This method will also set the {@code value()} * of the annotation to {@code textValue}. * * @param annotation the new annotation usage * @param textValue the value of the text for this annotation * @return a reference to this * * @since 2.5 */ default T annotate(final Type annotation, String textValue) { return annotate(AnnotationUsage.of(annotation).set(ofText(textValue))); }
private AnnotationUsage withExecuteBefore(File file) { file.add(Import.of(State.class).static_().setStaticMember("RESOLVED")); return AnnotationUsage.of(ExecuteBefore.class).set(Value.ofReference("RESOLVED")); }