Package com.vaadin.copilot.rewriter
Interface ClassDeclarationModifier.Operations
- All Known Implementing Classes:
JavaModifier.CompilationUnitOperations
- Enclosing interface:
ClassDeclarationModifier
public static interface ClassDeclarationModifier.Operations
What a caller may do to a class header.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddClassAnnotation(Class<? extends Annotation> annotation, String value) Adds an annotation taking a string, as in@StyleSheet("styles.css").voidaddClassAnnotationWithConstant(Class<? extends Annotation> annotation, String constantClassFqn, String constantField) Adds an annotation taking a constant, as in@StyleSheet(Aura.STYLESHEET).voidaddInterface(Class<?> interfaceClass) Adds an interface to the class, doing nothing when it is already there.
-
Method Details
-
addClassAnnotation
Adds an annotation taking a string, as in@StyleSheet("styles.css").- Parameters:
annotation- the annotation to addvalue- its single value- Throws:
IOException- if the source cannot be read
-
addClassAnnotationWithConstant
void addClassAnnotationWithConstant(Class<? extends Annotation> annotation, String constantClassFqn, String constantField) throws IOException Adds an annotation taking a constant, as in@StyleSheet(Aura.STYLESHEET).The constant is named by its fully qualified class rather than by a
Classobject because the class declaring it is on the application's classpath and not on Copilot's.- Parameters:
annotation- the annotation to addconstantClassFqn- the fully qualified name of the class declaring the constantconstantField- the constant's name- Throws:
IOException- if the source cannot be read
-
addInterface
Adds an interface to the class, doing nothing when it is already there.- Parameters:
interfaceClass- the interface to implement- Throws:
IOException- if the source cannot be read
-