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 Details

    • addClassAnnotation

      void addClassAnnotation(Class<? extends Annotation> annotation, String value) throws IOException
      Adds an annotation taking a string, as in @StyleSheet("styles.css").
      Parameters:
      annotation - the annotation to add
      value - 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 Class object because the class declaring it is on the application's classpath and not on Copilot's.

      Parameters:
      annotation - the annotation to add
      constantClassFqn - the fully qualified name of the class declaring the constant
      constantField - the constant's name
      Throws:
      IOException - if the source cannot be read
    • addInterface

      void addInterface(Class<?> interfaceClass) throws IOException
      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