oracle.cloud.scanning.api.config

## Interface IClassConfiguration

- All Superinterfaces:
    IConfiguration

      public interface IClassConfiguration
      extends IConfiguration

  An interface that allows to check if a class, method or a field is allowed.

  The user of this interface is expected to parse the source class that has to pass the compliance check. Since the configuration is static, users can cache the result of a call for later use.

  See Also:
    `ConfigurationFactory.getDefaultClassConfiguration()`

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Result` | `checkClassAllowed(String clazz)` Checks if a class is allowed or not.
    `Result` | `checkFieldAllowed(String clazz, String field)` Checks if a field is allowed or not
    `Result` | `checkMethodAllowed(String clazz, String method, List<String> arguments)` Checks if a method is allowed or not.
    `IAnnotationConfiguration` | `getClassAnnotationConfiguration(String annotation)` Gets if there are any constraints for annotations that can go on top of a class.

    - ### Methods inherited from interface oracle.cloud.scanning.api.config.IConfiguration

      `getVersion`

- - ### Method Detail

    - #### checkClassAllowed

          Result checkClassAllowed(String clazz)

      Checks if a class is allowed or not. An array of a class is allowed if and only if the class is allowed.
      Parameters:
        `clazz` - fully qualified class name that is to be checked if that is allowed.
      Returns:
        Result object that contains the status and the localized message when the class is not allowed.

        if the clazz contains [], it will be ignored. For e.g) oracle.test.API[] will be treated as oracle.test.API

    - #### checkFieldAllowed

          Result checkFieldAllowed(String clazz,
                                 String field)

      Checks if a field is allowed or not
      Parameters:
        `clazz` - the fully qualified name of the class that defines the field
        `field` - the name of the field to be tested if that is allowed.
      Returns:
        Result object that contains the status and the localized message when the field is not allowed.

        The clazz is checked first if that is allowed.

      See Also:
        `checkClassAllowed(java.lang.String)`

    - #### checkMethodAllowed

          Result checkMethodAllowed(String clazz,
                                  String method,
                                  List<String> arguments)

      Checks if a method is allowed or not.
      Parameters:
        `clazz` - the fully qualified name of the class that declares the method
        `method` - the name of the method. The value of null or <init> will indicate that it is a constructor.
        `arguments` - the list of arguments in the same order.
      Returns:
        Result object that contains the status and the localized message when the method is not allowed.

        The clazz, the list of arguments are checked first if they are allowed.

      See Also:
        `checkClassAllowed(java.lang.String)`

    - #### getClassAnnotationConfiguration

          IAnnotationConfiguration getClassAnnotationConfiguration(String annotation)

      Gets if there are any constraints for annotations that can go on top of a class. When this method returns a non null value, the caller needs to build the model for the entire annotation. The model must implement `Annotation`. The model is required to validate the annotation further.

      Note:The caller is expected to have validated if annotation class itself is allowed by calling `checkClassAllowed(String)`. This method is to be called only if the annotation class is valid.

      Parameters:
        `annotation` - the fully qualified class name of the annotation that needs to be validated.
      Returns:
        IAnnotationConfiguration the annotation configuration if there is any annotation configuration defined, null otherwise. If the method returns null, the annotation is fully valid.

Copyright © 2018 Oracle. All rights reserved.