The ATGJSONPathParser filters content in the JSON object based on the path token it is given.

None of the methods take the entire JSON path as input. The manager tokenizes the path and determines which of the methods in the parser should be invoked for each token. All methods in this class are synchronous.

If the parser encounters an object within the JSON that is not an NSDictionary or NSArray, it attempts to get an object of one of these types from the delegate. An exception is thrown if the attempt fails.

Interface
// Fetches the root object. This method exists for the sake of completeness and
// simply returns the same object it gets as input.
- (id) getContentFromRoot:(id) contentJSON;

// Handles the recursive descent operator.
- (id) getDescendantsRecursively:(id) contentJSON withNodename:(NSString *) nodename forNodeFilter:(NSString *) nodeFilter pathManager:(ATGJSONPathManager *) manager;

// Fetches the immediate child with key nodename.
- (id) getChild:(id) contentJSON withNodename:(NSString *) nodename;

// Generic method that determines the type of filter to apply to the given
// JSON and returns the results of performing the filter by invoking the
// appropriate filter method. Takes as input a reference to the invoking
// manager in order to access the parser it uses.
- (id) getContentFromCurrent:(id) contentJSON forNodeFilter:(NSString *) nodeFilter pathManager:(ATGJSONPathManager *) manager;

// Fetches content at the given index. In the case that the index value is
// invalid or does not exist, this method returns nil.
- (id) getContentFromCurrent:(id) contentJSON atIndex:(NSInteger) index;

// Filters content using applicable keywords of the underlying language.
// Valid keywords in this case are count and lastObject.
- (id) getContentFromCurrent:(id) contentJSON forScriptFilter:(NSString *) script;

// Fetches content satisfying a query expression. Takes as input a reference to
// the invoking manager in order to access the tokenizer it uses.
- (id) getContentFromCurrent:(id) contentJSON forExpressionFilter:(NSString *) expression pathManager:(ATGJSONPathManager *) manager;

// Fetches content satisfying the given boolean statement. statementTokens *must*
// contain three NSString objects in the following order:
//  - left-hand-side of the boolean expression
//  - boolean-operator
//  - right-hand-side of the boolean expression
- (id) getContentFromCurrent:(id) contentJSON satisfyingBooleanStatement:(NSArray *) statementTokens;

// Fetches content based on a union expression. Takes as input a reference to
// the invoking manager in order to access the manager's tokenizer.
- (id) getContentFromCurrent:(id) contentJSON withUnionOf:(NSString *) unionExpression pathManager:(ATGJSONPathManager *)manager;

// Fetches content based on the slice expression. Takes as input a reference to
// the invoking manager in order to access the manager's tokenizer.
- (id) getContentFromCurrent:(id) contentJSON forSliceFilter:(NSString *) sliceExpression pathManager:(ATGJSONPathManager *) manager;

// A helper method for getContentFromCurrent:forExpressionFilter that returns YES
// if a given path exists in the JSON object; NO otherwise. Used to filter content
// for paths containing nested descendant accesses within a filter, i.e. paths
// with
// format $.*.nodename[(@.child1.child2.*)].*
- (BOOL) pathExists:(NSArray *)pathTokens inContent:(id) contentJSON;

Copyright © 1997, 2013 Oracle and/or its affiliates. All rights reserved. Legal Notices