TBKeyPath.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // TBKeyPath.h
  3. // TBTweakViewController
  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. /// @param method must start with either a wildcard or a + or -.
  22. + (instancetype)bundle:(TBToken *)bundle
  23. class:(TBToken *)cls
  24. method:(TBToken *)method
  25. isInstance:(NSNumber *)instance
  26. string:(NSString *)keyPathString;
  27. @property (nonatomic, nullable, readonly) TBToken *bundleKey;
  28. @property (nonatomic, nullable, readonly) TBToken *classKey;
  29. @property (nonatomic, nullable, readonly) TBToken *methodKey;
  30. /// Indicates whether the method token specifies instance methods.
  31. /// Nil if not specified.
  32. @property (nonatomic, nullable, readonly) NSNumber *instanceMethods;
  33. @end
  34. NS_ASSUME_NONNULL_END