TBKeyPath.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // FLEXKeyPath.h
  3. // FLEX
  4. //
  5. // Created by Tanner on 3/22/17.
  6. // Copyright © 2017 Tanner Bennett. All rights reserved.
  7. //
  8. #import "TBToken.h"
  9. @class FLEXMethod;
  10. NS_ASSUME_NONNULL_BEGIN
  11. /// A key path represents a query into a set of bundles or classes
  12. /// for a set of one or more methods. It is composed of three tokens:
  13. /// bundle, class, and method. A key path may be incomplete if it
  14. /// is missing any of the tokens. A key path is considered "absolute"
  15. /// if all tokens have no options and if methodKey.string begins
  16. /// with a + or a -.
  17. ///
  18. /// The @code TBKeyPathTokenizer @endcode class is used to create
  19. /// a key path from a string.
  20. @interface TBKeyPath : NSObject
  21. + (instancetype)empty;
  22. /// @param method must start with either a wildcard or a + or -.
  23. + (instancetype)bundle:(TBToken *)bundle
  24. class:(TBToken *)cls
  25. method:(TBToken *)method
  26. isInstance:(NSNumber *)instance
  27. string:(NSString *)keyPathString;
  28. @property (nonatomic, nullable, readonly) TBToken *bundleKey;
  29. @property (nonatomic, nullable, readonly) TBToken *classKey;
  30. @property (nonatomic, nullable, readonly) TBToken *methodKey;
  31. /// Indicates whether the method token specifies instance methods.
  32. /// Nil if not specified.
  33. @property (nonatomic, nullable, readonly) NSNumber *instanceMethods;
  34. @end
  35. NS_ASSUME_NONNULL_END