java.lang.Object
org.apache.felix.dm.annotation.plugin.bnd.Patterns

public class Patterns extends Object
Class containings pattern matching helper methods.
Author:
Felix Project Team
  • Field Details

    • VOID

      public static final Pattern VOID
    • COMPOSITION

      public static final Pattern COMPOSITION
    • BIND_CLASS1

      public static final Pattern BIND_CLASS1
    • BIND_CLASS2

      public static final Pattern BIND_CLASS2
    • BIND_CLASS3

      public static final Pattern BIND_CLASS3
    • BIND_CLASS4

      public static final Pattern BIND_CLASS4
    • BIND_CLASS5

      public static final Pattern BIND_CLASS5
    • BIND_CLASS6

      public static final Pattern BIND_CLASS6
    • BIND_CLASS7

      public static final Pattern BIND_CLASS7
    • BIND_CLASS8

      public static final Pattern BIND_CLASS8
    • BIND_CLASS9

      public static final Pattern BIND_CLASS9
    • CLASS

      public static final Pattern CLASS
    • RUNNABLE

      public static final Pattern RUNNABLE
    • BUNDLE_CONTEXT

      public static final Pattern BUNDLE_CONTEXT
    • BUNDLE

      public static final Pattern BUNDLE
    • DEPENDENCY_MANAGER

      public static final Pattern DEPENDENCY_MANAGER
    • COMPONENT

      public static final Pattern COMPONENT
    • SERVICE_REGISTRATION

      public static final Pattern SERVICE_REGISTRATION
    • METHOD_RETURN_MAP

      public static final Pattern METHOD_RETURN_MAP
    • UPDATED_NO_CONFIG_TYPES

      public static final Pattern UPDATED_NO_CONFIG_TYPES
    • UPDATED_CONFIG_TYPES

      public static final Pattern UPDATED_CONFIG_TYPES
  • Constructor Details

    • Patterns

      public Patterns()
  • Method Details

    • inferTypeFromGenericType

      public static String inferTypeFromGenericType(String methodDescriptor, String signature, Logger m_logger)
      Infer service dependency type from a bind method accepting a ServiceReference or a ServiceObject parameter
      Parameters:
      m_logger -
    • parseClass

      public static String parseClass(String clazz, Pattern pattern, int group)
      Parses a class.
      Parameters:
      clazz - the class to be parsed (the package is "/" separated).
      pattern - the pattern used to match the class.
      group - the pattern group index where the class can be retrieved.
      Returns:
      the parsed class.
    • parseClass

      public static String parseClass(String clazz, Pattern pattern, int group, boolean throwException)
      Parses a class.
      Parameters:
      clazz - the class to be parsed (the package is "/" separated).
      pattern - the pattern used to match the class.
      group - the pattern group index where the class can be retrieved.
      throwException - true if an Exception must be thrown in case the clazz does not match the pattern.
      Returns:
      the parsed class.
    • parseMethod

      public static void parseMethod(String method, String descriptor, Pattern pattern)
      Checks if a method descriptor matches a given pattern.
      Parameters:
      pattern - the pattern used to check the method signature descriptor
      the - method whose signature descriptor is checked
      Throws:
      IllegalArgumentException - if the method signature descriptor does not match the given pattern.
    • parseField

      public static void parseField(String field, String descriptor, Pattern pattern)
      Checks if a field descriptor matches a given pattern.
      Parameters:
      field - the field whose type descriptor is checked
      descriptor - the field descriptor to be checked
      pattern - the pattern to use
      Throws:
      IllegalArgumentException - if the method signature descriptor does not match the given pattern.