public static JsonPathCursor createCursor ( String attributePath ) { ArrayList < Triple > triples = new ArrayList < Triple > ( DEFAULT_PATH_ELEMENT_COUNT ) ; int start = 0 ; int end ; while ( start < attributePath . length ( ) ) { boolean isArray = false ; try { while ( attributePath . charAt ( start ) == ' ' || attributePath . charAt ( start ) == ' ' ) { start ++ ; } } catch ( IndexOutOfBoundsException e ) { throw createIllegalArgumentException ( attributePath ) ; } end = start + 1 ; while ( end < attributePath . length ( ) ) { char c = attributePath . charAt ( end ) ; if ( ' ' == c || ' ' == c ) { break ; } else if ( ' ' == c ) { isArray = true ; break ; } end ++ ; } String part = attributePath . substring ( start , end ) ; Triple triple = new Triple ( part , part . getBytes ( UTF8_CHARSET ) , isArray ) ; triples . add ( triple ) ; start = end + 1 ; } return new JsonPathCursor ( attributePath , triples ) ; }
Creates a new cursor from given attribute path .